@extends('backend.partials.master') @section('title') {{ ___('admin.supplier_ledger_858d51') }} @endsection @section('maincontent') {{-- Pick a supplier to see its statement; the totals above always reflect the current filter so a period can be reconciled on its own. --}}
{{ ___('admin.billed_763fe5') }}{{ $selected ? '' : ___('admin.all_suppliers_a5e4d7') }}

{{ currency_symbol() }}{{ number_format($totalBilled) }}

{{ ___('admin.paid_dc9d45') }}

{{ currency_symbol() }}{{ number_format($totalPaid) }}

{{ $selected ? ___('admin.outstanding_691735') . $selected->name : ___('admin.total_payables_bc4568') }}

{{ currency_symbol() }}{{ number_format($selected ? (float) $selected->balance : $totalBalance) }}

@if(hasPermission('supplier_create')) {{-- Recording an entry is the whole point of a ledger, so the form lives on the page rather than behind another screen. --}}
{{ ___('admin.record_an_entry_0fbd53') }}
@csrf
@error('supplier_id') {{ $message }} @enderror
{{-- Only a payment moves money, and the books need to know which account it left. --}}
@error('txn_date') {{ $message }} @enderror
@error('amount') {{ $message }} @enderror
@endif @forelse($entries as $e) @php $isCredit = (float) $e->credit > 0; @endphp {{ $e->txn_date?->translatedFormat('d M Y') }} {{ $e->supplier->name ?? '—' }} @if($e->description)
{{ $e->description }}
@endif {{ admin_label($e->type) }} {{ $e->reference ?: '—' }} {{ $isCredit ? currency_symbol() . number_format((float) $e->credit) : '—' }} {{ ! $isCredit ? currency_symbol() . number_format((float) $e->debit) : '—' }} {{ currency_symbol() }}{{ number_format((float) $e->balance_after) }} @if(hasPermission('supplier_delete')) @endif @empty @endforelse
@endsection @push('scripts') @endpush