Opening Balance |
{{ $balance < 0 ? '(' . number_format(abs($balance), 0) . ')' : number_format($balance, 0) }}
|
{{-- ✅ Existing detail rows --}}
@foreach($data as $row)
@php
$amount = floatval($row->Amount);
$balance += $amount;
if ($amount > 0) $totalDebit += $amount;
if ($amount < 0) $totalCredit += abs($amount);
@endphp
{{ $row->Voucher ?? '' }} |
{{ \Carbon\Carbon::parse($row->Voucher_Date)->format('d-m-Y') }} |
{{ $row->Remarks }} |
{{ $row->Cheque_No }} |
{{ $row->Other_Account ?? 'N/A' }} |
{{ $amount > 0 ? number_format($amount, 0) : '' }} |
{{ $amount < 0 ? number_format(abs($amount), 0) : '' }} |
{{ $balance < 0 ? '(' . number_format(abs($balance), 0) . ')' : number_format($balance, 0) }}
|
@endforeach
{{-- ✅ Totals row remains unchanged --}}
Totals |
{{ number_format($totalDebit, 0) }} |
{{ number_format($totalCredit, 0) }} |
{{ $balance < 0 ? '(' . number_format(abs($balance), 0) . ')' : number_format($balance, 0) }}
|