@extends('master.app') @section('title', 'Suppliers') @section('body')
{{-- 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)) Logo @endif
{{-- SUMMARY TABLE --}}
Supplier Summary (By Currency)
Auto Calculated
@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 @endforeach
Currency Total Purchase Payments Advance Paid (Pay+Adv) Balance Status
{{ $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 }}
Note: Balance = Purchase - (Payments + Advance)
{{-- CHARTS --}}
Purchases vs Paid (Per Currency)
Balance (Per Currency)
{{-- FOOTER (PRINT ONLY) --}}

Generated: {{ date('Y-m-d H:i') }}
Powered by OomClick Software Company
@endsection @section('pageJs') {{-- Chart.js --}} {{-- Print behavior inside main page (optional) --}} @endsection