@extends('layouts.inspinia') @section('title', 'Debtors & Creditors Summary') @section('content_header', 'Debtors & Creditors Summary') @section('breadcrumb') @endsection @section('content')
Read-only report. Balances are derived from customers.current_balance and suppliers.current_balance maintained by the Sales and Purchase posting engines. These are operational balances, not GL ledger accounts.
{{-- Search --}}
Search
Clear
{{-- Net Position Cards --}}

{{ number_format($totalReceivable, 2) }}

Total Receivable {{ $debtorCount }} customers with balance

{{ number_format($totalPayable, 2) }}

Total Payable {{ $creditorCount }} suppliers with balance

{{ number_format($netPosition, 2) }}

Net Position {{ $netPosition >= 0 ? '(Net Receivable)' : '(Net Payable)' }}

{{ $totalCustomers }} / {{ $totalSuppliers }}

Customers / Suppliers (Total)

{{-- Top Debtors --}}
Top 10 Debtors
@if($topDebtors->isEmpty())
No debtors found.
@else @foreach($topDebtors as $i => $d) @endforeach
#CustomerPhoneBalance (TZS)
{{ $i + 1 }} {{ $d->name }} {{ $d->phone ?? '—' }} {{ number_format($d->current_balance, 2) }}
@endif
{{-- Top Creditors --}}
Top 10 Creditors
@if($topCreditors->isEmpty())
No creditors found.
@else @foreach($topCreditors as $i => $c) @endforeach
#SupplierPhoneBalance (TZS)
{{ $i + 1 }} {{ $c->name }} {{ $c->phone ?? '—' }} {{ number_format($c->current_balance, 2) }}
@endif
{{-- Full Debtor List --}}
All Debtors (Balance > 0) {{ $debtors->total() }} records
@if($debtors->isEmpty())
No outstanding customer balances.
@else
@foreach($debtors as $d) @endforeach
CustomerPhoneEmailBalance (TZS)
{{ $d->name }} {{ $d->phone ?? '—' }} {{ $d->email ?? '—' }} {{ number_format($d->current_balance, 2) }}
{{ $debtors->links() }}
@endif
{{-- Full Creditor List --}}
All Creditors (Balance > 0) {{ $creditors->total() }} records
@if($creditors->isEmpty())
No outstanding supplier balances.
@else
@foreach($creditors as $c) @endforeach
SupplierPhoneEmailBalance (TZS)
{{ $c->name }} {{ $c->phone ?? '—' }} {{ $c->email ?? '—' }} {{ number_format($c->current_balance, 2) }}
{{ $creditors->links() }}
@endif
@endsection