@php $reconciled_transactions = explode(',',$report->reconciled_trans_ids); $unreconciled_transactions = explode(',',$report->unreconciled_trans_ids); $total_cleared_credit = $total_cleared_debit = 0; $total_uncleared_credit = $total_uncleared_debit = 0; $total_uncleared = $total_cleared = 0; @endphp
@include('layouts.header_pdf_print')
BANK RECONCILIATION REPORT
{{ $chart_of_accounts[$report->bank] }} as at {{ streamline_date($report->reconciliation_period) }}
{{-- RECONCILED BY: {{ get_full_name($report->created_by, "id", "first_name", "last_name", "users")}}
--}}Date: {{ streamline_date($report->created_at) }}
@php $beginning_of_month = \Carbon\Carbon::parse($report->reconciliation_period)->startOfMonth()->toDateTimeString(); @endphp @php $last_banking_record = \Streamline\Models\Banking::where('reconciled',$report->id)->orderBy('id', 'desc')->first(); @endphp @if ($last_banking_record->memo == "bank reconciliation adjustment") @else @endif @if ($report->memo) @endif
Reconciliation Summary
Stre@mline Opening Balance As Of {{ streamline_date($beginning_of_month) }}: {{ ugandan_shillings($report->opening_streamline_balance) }}
Bank Statement Ending Balance As Of {{ streamline_date($report->reconciliation_period) }}: {{ ugandan_shillings($report->ending_bank_statement_balance) }}
@php $banking_record = get_latest_banking_record($report->bank, $report->reconciliation_period); $bank_balance_that_day = ($banking_record != null) ? (int)$banking_record->account_balance : 0; $orderByCreatedAtIfTransDateIsTheSame = "created_at DESC"; $orderByIdIfTransDateIsTheSame = "id DESC"; $last_record_that_month = DB::table('banking') ->whereNull('deleted_at') ->where('bank', '=', $report->bank) ->where('memo', '!=', 'bank reconciliation adjustment') ->whereDate('trans_date', '<=', \Carbon\Carbon::parse($report->reconciliation_period)->toDateString()) ->orderBy('trans_date', 'desc') ->orderByRaw($orderByCreatedAtIfTransDateIsTheSame) ->orderByRaw($orderByIdIfTransDateIsTheSame) ->first(); $last_running_balance_of_month = ($last_record_that_month != null) ? (int)$last_record_that_month->account_balance : 0; @endphp Bank Register Closing Balance As Of {{ streamline_date($report->reconciliation_period) }}: {{ ugandan_shillings($last_running_balance_of_month) }}
Reconciliation Discrepancy Balance : {{ $last_banking_record->credit ? ugandan_shillings($last_banking_record->credit) : "-".ugandan_shillings(abs($last_banking_record->debit)) }} Reconciliation Discrepancy Balance : {{ ugandan_shillings(0) }}
Memo : {{ $report->memo }}
Cleared Transactions
Checks and Payments @if(count($reconciled_transactions) > 0)
@foreach($reconciled_transactions as $trans_id) @php $transaction = \Streamline\Models\Banking::find($trans_id); @endphp @if(!is_null($transaction)) @if($transaction->trans_type == 'PAYMENT' || $transaction->trans_type == 'TRANSFER') @php $other_accounts_array = explode(',',$transaction->other_accounts); @endphp @php $total_cleared_debit += (int)$transaction->debit; @endphp @endif @endif @endforeach
From To Memo Date Amount
{{ $chart_of_accounts[$transaction->bank] }} @for($x = 0; $x < count($other_accounts_array); $x ++) @if(isset($chart_of_accounts[$other_accounts_array[$x]])) {{ $chart_of_accounts[$other_accounts_array[$x]] }} @else @php $item = isset($payment_items[$other_accounts_array[$x]]) ? $payment_items[$other_accounts_array[$x]] : ""; @endphp {{ $item }} @endif @endfor {{ $transaction->memo }} {{ streamline_date($transaction->trans_date) }} - {{ ugandan_shillings($transaction->debit) }}
@endif Deposits and Credits @if(count($reconciled_transactions) > 0) @foreach($reconciled_transactions as $trans_id) @php $transaction = \Streamline\Models\Banking::find($trans_id); @endphp @if(!is_null($transaction)) @if($transaction->trans_type == 'DEPOSIT') @php $other_accounts_array = explode(',',$transaction->other_accounts); @endphp @php $total_cleared_credit += (int)$transaction->credit; @endphp @endif @endif @endforeach @endif
From To Memo Date Amount
@for($x = 0; $x < count($other_accounts_array); $x ++) @if(isset($chart_of_accounts[$other_accounts_array[$x]])) {{ $chart_of_accounts[$other_accounts_array[$x]] }} @else @php $item = isset($payment_items[$other_accounts_array[$x]]) ? $payment_items[$other_accounts_array[$x]] : ""; @endphp {{ $item }} @endif @endfor {{ $chart_of_accounts[$transaction->bank] }} {{ $transaction->memo }} {{ streamline_date($transaction->trans_date) }}{{ ugandan_shillings($transaction->credit) }}
Total Cleared Balance : {{ ugandan_shillings($total_cleared = ($total_cleared_credit - $total_cleared_debit)) }}


Uncleared Transactions
Checks and Payments @if(count($unreconciled_transactions) > 0) @foreach($unreconciled_transactions as $trans_id) @php $transaction = \Streamline\Models\Banking::find($trans_id); @endphp @if(!is_null($transaction)) @if($transaction->trans_type == 'PAYMENT' || $transaction->trans_type == 'TRANSFER') @php $total_uncleared_debit += (int)$transaction->debit; @endphp @endif @endif @endforeach
From To Memo Date Amount
{{ $chart_of_accounts[$transaction->bank] }} @php $uncleared_other_accounts_string = $transaction->other_accounts; $uncleared_other_accounts_array = is_null($uncleared_other_accounts_string) ? [] : explode(",", $uncleared_other_accounts_string); @endphp @for($x = 0; $x < count($uncleared_other_accounts_array); $x ++) @if(isset($chart_of_accounts[$uncleared_other_accounts_array[$x]])) {{ $chart_of_accounts[$uncleared_other_accounts_array[$x]] }} @else @php $item = $payment_items[$uncleared_other_accounts_array[$x]] ?? ""; @endphp {{ $item }} @endif @endfor {{ $transaction->memo }} {{ streamline_date($transaction->trans_date) }}{{ ugandan_shillings($transaction->debit) }}
@endif Deposits and Credits @if(count($unreconciled_transactions) > 0) @foreach($unreconciled_transactions as $trans_id) @php $transaction = \Streamline\Models\Banking::find($trans_id)@endphp @if(!is_null($transaction)) @if($transaction->trans_type == 'DEPOSIT') @php $other_accounts_array = explode(',',$transaction->other_accounts); @endphp @php $total_uncleared_credit += (int)$transaction->credit; @endphp @endif @endif @endforeach @endif
From To Memo Date Amount
@for($x = 0; $x < count($other_accounts_array); $x ++) @if(isset($chart_of_accounts[$other_accounts_array[$x]])) {{ $chart_of_accounts[$other_accounts_array[$x]] }} @else @php $item = isset($payment_items[$other_accounts_array[$x]]) ? $payment_items[$other_accounts_array[$x]] : ""; @endphp {{ $item }} @endif @endfor {{ $chart_of_accounts[$transaction->bank] }} {{ $transaction->memo }} {{ streamline_date($transaction->trans_date) }}{{ ugandan_shillings($transaction->credit) }}
Total Uncleared Balance : {{ ugandan_shillings($total_uncleared = ($total_uncleared_credit - $total_uncleared_debit)) }}

Reconciled By: {{ get_full_name($report->created_by, "id", "first_name", "last_name", "users")}}
Checked By: .................................
Approved By: ..................................
{{-- @php $last_banking_record = \Streamline\Models\Banking::where('reconciled',$report->id)->orderBy('id', 'desc')->first(); @endphp @if ($last_banking_record->memo == "bank reconciliation adjustment") Reconciliation Discrepancy Balance : {{ $last_banking_record->credit ? ugandan_shillings($last_banking_record->credit) : "-".ugandan_shillings(abs($last_banking_record->debit))}}
@else Reconciliation Discrepancy Balance : {{ ugandan_shillings(0) }}
@endif @php $beginning_of_month = \Carbon\Carbon::parse($report->reconciliation_period)->startOfMonth()->toDateTimeString(); @endphp Stre@mline Opening Balance ({{ streamline_date($beginning_of_month) }}): {{ ugandan_shillings($report->opening_streamline_balance) }} Bank Statement Ending Balance ({{ streamline_date($report->reconciliation_period) }}): {{ ugandan_shillings($report->ending_bank_statement_balance) }} @php $banking_record = get_latest_banking_record($report->bank, $report->reconciliation_period); $bank_balance_that_day = ($banking_record != null) ? (int)$banking_record->account_balance : 0; @endphp Register Bank Closing Balance ({{ streamline_date($report->reconciliation_period) }}): {{ ugandan_shillings($bank_balance_that_day) }} --}}