@use('App\Services\Date') @if(request()->all())

@lang('reports::reports.Balance Sheet')

{{ $data['companyName'] }}

@lang('reports::reports.balance_sheet_as_of') {{$data['to']}}

@foreach ($data['categories'] as $category) {{ $category['category']->name}} @foreach($category['subCategories'] as $subCategory) {{$subCategory['name']}} @if($subCategory['total'] == 0) {{ number_format($subCategory['total'],2) }} @endif @foreach($subCategory['accounts'] as $account) @if($account['current_balance']!=0||$account['total']!=0) {{$account['code']}} - {{$account['name']}} @if($account['current_balance']>=0) {{ number_format($account['current_balance'],2)}} @else ({{ number_format(abs($account['current_balance']),2)}}) @endif @php if(isset($account['tree'])){ $tree=$account['tree']['directChildren']; } @endphp @isset($account['tree']) {!! generateHTMLForBalanceSheetCustomLevel($tree,1,request('level')+1) !!} @endisset @if($account['current_balance']!=$account['total']) @lang('reports::reports.total') {{$account['name']}} @if($account['total']>=0) {{ number_format($account['total'],2)}} @else ({{ number_format(abs($account['total']),2)}}) @endif @endif @endif @endforeach @if($subCategory['total'] != 0) @lang('reports::reports.total') {{$subCategory['name']}} @if($subCategory['total']>0) {{ number_format($subCategory['total'],2) }} @else ({{ number_format(abs($subCategory['total']),2)}}) @endif @endif @endforeach @lang('reports::reports.total') {{$category['category']->name}} @if($category['total']>=0) {{ number_format($category['total'],2) }} @else ({{ number_format(abs($category['total']),2)}}) @endif @if($loop->iteration==1) {{-- I depeand here the fact that here is only one debit category which is the first one --}} @lang('reports::reports.balance_sheet_total_debit') @if($data['totalDebit']>=0) {{ number_format($data['totalDebit'],2) }} @else ({{ number_format(abs($data['totalDebit']),2)}}) @endif {{-- I depeand here the fact that here is only one debit category which is the first one --}} @else @endif @endforeach @lang('reports::reports.net_earnings') @if($data['net']>=0) {{ number_format($data['net'],2) }} @else ({{ number_format(abs($data['net']),2)}}) @endif @lang('reports::reports.balance_sheet_total_credit') @if($data['totalCredit']>=0) {{ number_format($data['totalCredit'],2) }} @else ({{ number_format(abs($data['totalCredit']),2)}}) @endif @lang('reports::reports.accrual_basis') {{ Date::format(now(), 'datetime') }}
@endif