{{-- TOP HEADER --}}
{{ $supplier->name ?? 'Supplier' }}
{{ $supplier->phone ?? '-' }}
{{ $supplier->email ?? '-' }}
{{ $supplier->address ?? '-' }}
{{-- QUICK ACTION --}}
{{-- REPORT AREA (ONLY THIS WILL PRINT) --}}
{{-- LETTER HEAD (PRINT ONLY) --}}
{{ $bname ?? config('app.name') }}
@if (!empty($blogo))
 }})
@endif
{{-- SUMMARY TABLE --}}
| Currency |
Total Purchase |
Payments |
Advance |
Paid (Pay+Adv) |
Balance |
Status |
@foreach($currencies as $c)
@php
$s = $summary[$c->id] ?? ['purchase'=>0,'payment'=>0,'advance'=>0,'paid'=>0,'balance'=>0];
$bal = (float) $s['balance'];
// supplier logic:
// balance > 0 => Payable (we owe supplier)
// balance < 0 => Credit (supplier has extra/prepaid)
// balance == 0 => Settled
$statusText = $bal > 0 ? 'PAYABLE' : ($bal < 0 ? 'CREDIT' : 'SETTLED');
$badge = $bal > 0 ? 'bg-danger' : ($bal < 0 ? 'bg-success' : 'bg-secondary');
@endphp
| {{ $c->title_ps ?? $c->title_en }} |
{{ number_format($s['purchase'], 2) }}
|
{{ number_format($s['payment'], 2) }}
|
{{ number_format($s['advance'], 2) }}
|
{{ number_format($s['paid'], 2) }}
|
{{ number_format($bal, 2) }}
|
{{ $statusText }}
|
@endforeach
Note: Balance = Purchase - (Payments + Advance)
{{-- CHARTS --}}
{{-- FOOTER (PRINT ONLY) --}}
Generated: {{ date('Y-m-d H:i') }}
Powered by OomClick Software Company