Request Transaction History
{{$filters["from"]??""}} - {{$filters["to"]??""}}
Date
Time
Reference No.
Description
Debit
Credit
Balance
@php
$first = $soa_query->first();
if ($first) {
if ($first->type === 'CREDIT') {
$starting_balance = $first->balance - $first->amount;
} elseif ($first->type === 'DEBIT') {
$starting_balance = $first->balance + $first->amount;
} else {
$starting_balance = $first->balance ?? 0;
}
} else {
$starting_balance = 0;
}
@endphp
@php
$total_debit = 0;
$total_credit = 0;
@endphp
@foreach($soa_query as $soa)
@php
if ($soa->type === 'DEBIT') $total_debit += $soa->amount;
if ($soa->type === 'CREDIT') $total_credit += $soa->amount;
@endphp
-
{{ date('M d, Y', strtotime($soa->created_at)) }}
{{ date('h:i A', strtotime($soa->created_at)) }}
{{ $soa->reference }}
{{ $soa->description }}
@if($soa->type === 'DEBIT')
₱{{ number_format($soa->amount, 2) }}
@endif
@if($soa->type === 'CREDIT')
₱{{ number_format($soa->amount, 2) }}
@endif
₱{{ number_format($soa->balance, 2) }}
@endforeach
@php
$ending_balance = $soa_query->last()->balance ?? 0;
@endphp