@include('templates.pdf_header', [ 'organisation' => $organisation, 'title' => 'BALANCE SHEET DETAIL', 'currency_code' => $currency ]) @php function fmtAmount($value) { return ($value ?? 0) != 0 ? number_format($value, 0) : ''; } function renderBalanceSheet($items, $level = 0) { foreach ($items as $item) { $amount = $item['value_current']; // Skip zero-value non-header rows if ( isset($item['row_type']) && $item['row_type'] !== 'header' && (($item['value_current'] ?? 0) == 0) && (($item['value_previous'] ?? 0) == 0) ) { continue; } if(isset($item['level']) && ($item['level'] == "subcategory" || $item['level'] == "subcategory") ){ $amount = 0; } $indentClass = $level > 0 ? "indent-{$level}" : ''; echo ''; echo ''; echo ''; echo ''; if (!empty($item['children'])) { renderBalanceSheet($item['children'], $level + 1); } } } @endphp @php renderBalanceSheet($data); @endphp
Particulars Amount
' . e($item['label'] ?? '') . '' . fmtAmount($amount ?? 0) . '
MWENYEKITI
MENEJA MKUU
MJUMBE