@if(empty($rows))
কোন বকেয়া পেমেন্ট ইতিহাস পাওয়া যায়নি।
@else
@php
$totalAmount = collect($rows)->sum(fn ($r) => (float) ($r['payment_amount'] ?? 0));
$paidCount = collect($rows)->filter(fn ($r) => in_array($r['payment_status'] ?? '', ['approved', 'completed', 'paid'], true))->count();
$pendingCount = collect($rows)->filter(fn ($r) => ($r['payment_status'] ?? '') === 'pending')->count();
$rejectedCount = collect($rows)->filter(fn ($r) => ($r['payment_status'] ?? '') === 'rejected')->count();
@endphp
| Payment # |
Payment Date |
Payment Method |
Payment Amount |
Overage Count |
Status |
Details |
@foreach($rows as $row)
@php
$st = $row['payment_status'] ?? 'pending';
$stClass = match($st) {
'approved', 'completed', 'paid' => 'success',
'pending' => 'warning',
'rejected' => 'danger',
default => 'secondary',
};
$method = $row['payment_method'] ?? 'bank_transfer';
$overages = is_array($row['overages'] ?? null) ? $row['overages'] : [];
@endphp
| #{{ $row['payment_id'] ?? substr($row['id'] ?? '—', 0, 8) }} |
{{ isset($row['payment_date']) ? \Carbon\Carbon::parse($row['payment_date'])->format('d M Y, h:i A') : '—' }}
|
{{ $row['payment_method_text'] ?? ($method === 'bank_transfer' ? 'Bank Transfer' : ucfirst($method)) }}
|
{{ number_format($row['payment_amount'] ?? 0, 2) }} ৳ |
{{ (int) ($row['overage_count'] ?? count($overages)) }} টি বকেয়া |
{{ ucfirst($st) }}
@if(! empty($row['status_text']))
{{ $row['status_text'] }}
@endif
|
@if(! empty($overages))
@else
—
@endif
|
@endforeach
| Total Payments: |
{{ count($rows) }} times |
| Total Amount: |
{{ number_format($totalAmount, 2) }} ৳ |
@if($paidCount > 0)
| Paid: |
{{ $paidCount }} times |
@endif
@if($pendingCount > 0)
| Pending: |
{{ $pendingCount }} times |
@endif
@if($rejectedCount > 0)
| Rejected: |
{{ $rejectedCount }} times |
@endif
@foreach($rows as $row)
@php $overages = is_array($row['overages'] ?? null) ? $row['overages'] : []; @endphp
@if(! empty($overages))
Overage paid in this payment:
| Order # |
Date |
Rate |
Amount |
@foreach($overages as $item)
| {{ $item['order_id'] ?? '—' }} |
{{ $item['date'] ?? '—' }} |
{{ number_format($item['rate'] ?? 0, 2) }} ৳ |
{{ number_format($item['amount'] ?? 0, 2) }} ৳ |
@endforeach
@endif
@endforeach
@endif