<<<<<<< HEAD Bank Reconciliation PDF

CHM ERP Statement

Period: {{ $label ?? '-' }}

Opening Balance: UGX {{ number_format($openingBalance ?? 0, 0) }}

Closing Balance: UGX {{ number_format($closingBalance ?? 0, 0) }}

@php $runningBalance = $openingBalance ?? 0; $totalDebits = 0; $totalCredits = 0; @endphp @foreach ($transactions ?? [] as $tx) @php $debit = $tx->debit ?? 0; $credit = $tx->credit ?? 0; $totalDebits += $debit; $totalCredits += $credit; $runningBalance += ($debit - $credit); preg_match('/to\s+(.*?)\s+for\s+GRN#/i', $tx->memo ?? '', $nameMatches); $name = $nameMatches[1] ?? null; preg_match('/GRN#(\d+)/', $tx->entry->reference ?? '', $matches); $voucherNo = $matches[1] ?? null; @endphp @endforeach
Date Description Reference Debit Credit Closing Balance
{{ \Carbon\Carbon::parse($tx->entry->entry_date ?? $tx->created_at)->format('Y-m-d') }} {{ $name ?? ($tx->memo ?? '-') }} @if(!empty($voucherNo)) Voucher No. {{ $voucherNo }} @else - @endif {{ $debit ? number_format($debit, 0) : '-' }} {{ $credit ? number_format($credit, 0) : '-' }} {{ number_format($runningBalance, 0) }}
Totals UGX {{ number_format($totalDebits, 0) }} UGX {{ number_format($totalCredits, 0) }} UGX {{ number_format($runningBalance, 0) }}
======= @extends('layouts.pdf.base') @section('pdf-title', 'Bank Statement') @section('pdf-subtitle') {{ $label ?? 'Reconciliation period' }} @endsection @section('pdf-meta') Opening balance: UGX {{ number_format($openingBalance ?? 0, 0) }} ยท Closing balance: UGX {{ number_format($closingBalance ?? 0, 0) }} @endsection @section('pdf-content') @php $runningBalance = $openingBalance ?? 0; $totalDebits = 0; $totalCredits = 0; @endphp @foreach ($transactions ?? [] as $tx) @php $debit = $tx->debit ?? 0; $credit = $tx->credit ?? 0; $totalDebits += $debit; $totalCredits += $credit; $runningBalance += ($debit - $credit); preg_match('/to\s+(.*?)\s+for\s+GRN#/i', $tx->memo ?? '', $nameMatches); $name = $nameMatches[1] ?? null; preg_match('/GRN#(\d+)/', $tx->entry->reference ?? '', $matches); $voucherNo = $matches[1] ?? null; @endphp @endforeach
Date Description Reference Debit Credit Closing Balance
{{ \Carbon\Carbon::parse($tx->entry->entry_date ?? $tx->created_at)->format('Y-m-d') }} {{ $name ?? ($tx->memo ?? '-') }} {{ ! empty($voucherNo) ? 'Voucher No. '.$voucherNo : '-' }} {{ $debit ? number_format($debit, 0) : '-' }} {{ $credit ? number_format($credit, 0) : '-' }} {{ number_format($runningBalance, 0) }}
Totals UGX {{ number_format($totalDebits, 0) }} UGX {{ number_format($totalCredits, 0) }} UGX {{ number_format($runningBalance, 0) }}
@endsection >>>>>>> origin/main