@extends('layouts.app')
@section('title', __('Balance Sheet'))
@section('content')
@php($assets = $cash + $receivable + $inventory + $fixedAssets)
@php($equity = $assets - $payable)
<div class="card mb-3">
    <div class="card-body p-4">
        @include('reports.partials.header', ['title' => __('Balance Sheet'), 'period' => __('As of').' '.\App\Support\DualDate::format(now(), 'Y-m-d')])
        <button onclick="window.print()" class="btn btn-light btn-sm no-print"><i class="fa-solid fa-print me-1"></i>{{ __('Print') }}</button>
    </div>
</div>
<div class="row g-3">
    <div class="col-lg-6">
        <div class="card"><div class="card-body p-4"><h5>{{ __('Assets') }}</h5><div class="d-flex justify-content-between py-2 border-bottom"><span>{{ __('Cash Position') }}</span><strong class="money">{{ number_format($cash, 2) }} {{ $moneyCode }}</strong></div><div class="d-flex justify-content-between py-2 border-bottom"><span>{{ __('Accounts Receivable') }}</span><strong class="money">{{ number_format($receivable, 2) }} {{ $moneyCode }}</strong></div><div class="d-flex justify-content-between py-2 border-bottom"><span>{{ __('Inventory Value') }}</span><strong class="money">{{ number_format($inventory, 2) }} {{ $moneyCode }}</strong></div><div class="d-flex justify-content-between py-2 border-bottom"><span>{{ __('Fixed Assets') }}</span><strong class="money">{{ number_format($fixedAssets, 2) }} {{ $moneyCode }}</strong></div><div class="d-flex justify-content-between pt-3 fs-5"><strong>{{ __('Total Assets') }}</strong><strong class="money">{{ number_format($assets, 2) }} {{ $moneyCode }}</strong></div></div></div>
    </div>
    <div class="col-lg-6">
        <div class="card"><div class="card-body p-4"><h5>{{ __('Liabilities & Equity') }}</h5><div class="d-flex justify-content-between py-2 border-bottom"><span>{{ __('Supplier Payables') }}</span><strong class="money">{{ number_format($payable, 2) }} {{ $moneyCode }}</strong></div><div class="d-flex justify-content-between py-2 border-bottom"><span>{{ __('Owner Equity') }}</span><strong class="money">{{ number_format($equity, 2) }} {{ $moneyCode }}</strong></div><div class="d-flex justify-content-between pt-3 fs-5"><strong>{{ __('Total') }}</strong><strong class="money">{{ number_format($payable + $equity, 2) }} {{ $moneyCode }}</strong></div></div></div>
    </div>
</div>
@if(!empty($appSettings['report_footer']))<p class="text-center text-muted small mt-3">{{ $appSettings['report_footer'] }}</p>@endif
@endsection
