@php $months = $reportData['months']; $tree = $reportData['tree']; $supplierSection = $reportData['supplierSection']; $customerSection = $reportData['customerSection']; $colCount = 12 + 3; $fmt = fn($v) => $v == 0 ? '-' : ($v < 0 ? '(' . number_format(abs($v), 0) . ')' : number_format($v, 0)); @endphp
M.D.S
مابوار کھاتہ موازنہ    Accounts Comparision Report
Start Date : {{ \Carbon\Carbon::parse($reportData['startDate'])->format('d/m/Y') }}
@foreach($months as $m)@endforeach {{-- ── Account Hierarchy ── --}} @foreach($tree as $ma) @foreach($ma['children'] as $ca) @foreach($ca['children'] as $sca) @foreach($sca['children'] as $tacc) @if($tacc['total'] != 0) @foreach($tacc['monthly'] as $val) @endforeach @endif @endforeach @endforeach @if($ca['total'] != 0) @foreach($ca['monthly'] as $val) @endforeach @endif @endforeach @if($ma['total'] != 0) @foreach($ma['monthly'] as $val) @endforeach @endif @endforeach {{-- ── SUPPLIERS ── --}} @if(!empty($supplierSection['children'])) @foreach($supplierSection['children'] as $row) @foreach($row['monthly'] as $val) @endforeach @endforeach @foreach($supplierSection['monthly'] as $val) @endforeach @endif {{-- ── CUSTOMERS ── --}} @if(!empty($customerSection['children'])) @foreach($customerSection['children'] as $row) @foreach($row['monthly'] as $val) @endforeach @endforeach @foreach($customerSection['monthly'] as $val) @endforeach @endif
Account Code {{ $m->format('M,y') }}Average Total
{{ strtoupper($ma['name']) }}
{{ $tacc['code'] }} {{ $fmt($val) }}{{ $fmt($tacc['average']) }} {{ $fmt($tacc['total']) }}
{{ $fmt($val) }}{{ $fmt($ca['average']) }} {{ $fmt($ca['total']) }}
{{ $fmt($val) }}{{ $fmt($ma['average']) }} {{ $fmt($ma['total']) }}
SUPPLIERS — سپلائرز
{{ $row['code'] }} {{ $fmt($val) }}{{ $fmt($row['average']) }} {{ $fmt($row['total']) }}
{{ $fmt($val) }}{{ $fmt($supplierSection['average']) }} {{ $fmt($supplierSection['total']) }}
CUSTOMERS — کسٹمرز
{{ $row['code'] }} {{ $fmt($val) }}{{ $fmt($row['average']) }} {{ $fmt($row['total']) }}
{{ $fmt($val) }}{{ $fmt($customerSection['average']) }} {{ $fmt($customerSection['total']) }}