@use('App\Services\Date') @extends('reports::layouts.master_pdf') @php $subdomain = request()->route()->parameter('subdomain'); $is_student = app(\Hyn\Tenancy\Repositories\HostnameRepository::class)->findByHostname($subdomain)->website->company->is_student; @endphp @section('koolreport') @if(request()->all())
@if($is_student) @include('draft_report') @endif

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

{{ $data['companyName'] }}

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

@if(isset($data['periods'])) {{-- Comparison mode table header --}} @foreach($data['periods'] as $period) @endforeach @else {{-- Single period mode header --}}
{{ Date::format($period, 'date') }}
@endif @foreach ($data['categories'] as $category) @foreach($category['subCategories'] as $subCategory) @foreach($subCategory['accounts'] as $account) @if($account['current_balance']!=0||$account['total']!=0) @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']) @endif @endif @endforeach @if($subCategory['total'] != 0) @endif @endforeach @if($loop->iteration==1) {{-- I depeand here the fact that here is only one debit category which is the first one --}} {{-- I depeand here the fact that here is only one debit category which is the first one --}} @else @endif @endforeach
@lang('reports::reports.balance') / @lang('reports::reports.total')
{{ $category['category']->name}}
{{$subCategory['name']}} @if($subCategory['total'] == 0) {{ number_format($subCategory['total'],2) }} @endif
{{$account['code']}} - {{$account['name']}} @if($account['current_balance']>=0) {{ number_format($account['current_balance'],2)}} @else ({{ number_format(abs($account['current_balance']),2)}}) @endif
@lang('reports::reports.total') {{$account['name']}} @if($account['total']>=0) {{ number_format($account['total'],2)}} @else ({{ number_format(abs($account['total']),2)}}) @endif
@lang('reports::reports.total') {{$subCategory['name']}} @if($subCategory['total']>0) {{ number_format($subCategory['total'],2) }} @else ({{ number_format(abs($subCategory['total']),2)}}) @endif
@lang('reports::reports.total') {{$category['category']->name}} @if($category['total']>=0) {{ number_format($category['total'],2) }} @else ({{ number_format(abs($category['total']),2)}}) @endif
@lang('reports::reports.balance_sheet_total_debit') @if($data['totalDebit']>=0) {{ number_format($data['totalDebit'],2) }} @else ({{ number_format(abs($data['totalDebit']),2)}}) @endif
@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::now('datetime')}}
@endif @endsection