{{-- Header --}}
Logo

{{ $shop_infos->shop_name ?? '' }}

{{ $shop_infos->address ?? '' }}


Sub-Ledger Statement — {{ $subledger->subledger_name }}
Period: {{ \Carbon\Carbon::parse($startDate)->format('d-m-Y') }}{{ \Carbon\Carbon::parse($endDate)->format('d-m-Y') }}
@php $total_debit = $subledgerTrans->sum('dr_amount'); $total_credit = $subledgerTrans->sum('cr_amount'); $runningBalance = $openingBalance; foreach ($subledgerTrans as $t) { if ($subledger->type == 'D') { $runningBalance += $t->dr_amount - $t->cr_amount; } else { $runningBalance += $t->cr_amount - $t->dr_amount; } } $closingBalance = $runningBalance; $runningBalance = $openingBalance; @endphp {{-- Summary Cards (screen only) --}}
Opening Balance
{{ number_format($openingBalance, 2) }}
Total Debit
{{ number_format($total_debit, 2) }}
Total Credit
{{ number_format($total_credit, 2) }}
Closing Balance
{{ number_format($closingBalance, 2) }}
{{-- Transactions Table --}} @forelse($subledgerTrans as $key => $transaction) @php if ($subledger->type == 'D') { $runningBalance += $transaction->dr_amount - $transaction->cr_amount; } else { $runningBalance += $transaction->cr_amount - $transaction->dr_amount; } @endphp @empty @endforelse
# Date Invoice No Description Debit (Dr) Credit (Cr) Balance
{{ \Carbon\Carbon::parse($startDate)->format('d-m-Y') }} Opening Balance {{ number_format($runningBalance, 2) }}
{{ $key + 1 }} {{ \Carbon\Carbon::parse($transaction->date)->format('d-m-Y') }} {{ $transaction->invoice_no ?? '—' }} {{ $transaction->description ?? '—' }} {{ $transaction->dr_amount > 0 ? number_format($transaction->dr_amount, 2) : '—' }} {{ $transaction->cr_amount > 0 ? number_format($transaction->cr_amount, 2) : '—' }} {{ number_format($runningBalance, 2) }}
No transactions found for this period.
Period Total {{ number_format($total_debit, 2) }} {{ number_format($total_credit, 2) }}
Opening Balance : {{ number_format($openingBalance, 2) }}
+ Total Debit : {{ number_format($total_debit, 2) }}
− Total Credit : {{ number_format($total_credit, 2) }}
Closing Balance : {{ number_format($closingBalance, 2) }}