@extends('layouts.app') @section('title', 'Pay Suppliers') @section('content')

Pay Suppliers

Manage supplier balances and record payments against their invoices

Suppliers

@foreach ($suppliers as $s) @endforeach
Supplier Contact Owed
{{ $s->name }} {{ $s->contact }} KES {{ number_format($s->outstanding_balance, 2) }}
@php $selected = \Illuminate\Support\Facades\DB::table('suppliers')->where('outstanding_balance', '>', 0)->orderBy('name')->first(); @endphp @if ($selected) @php $openInvoices = \Illuminate\Support\Facades\DB::table('supplier_invoices') ->where('supplier_id', $selected->id)->where('balance', '>', 0)->orderBy('date')->get(); $totalOwed = $openInvoices->sum('balance'); @endphp

Pay {{ $selected->name }}

Outstanding: KES {{ number_format($totalOwed, 2) }}

@csrf @foreach ($openInvoices as $inv) @endforeach
Invoice Date Balance Pay
{{ $inv->invoice_no }} {{ $inv->date }} KES {{ number_format($inv->balance, 2) }}
@endif

Supplier Invoices

@foreach ($invoices as $inv) @endforeach
Invoice Supplier Date Amount Paid Balance
{{ $inv->invoice_no }} {{ $inv->supplier_name }} {{ $inv->date }} KES {{ number_format($inv->amount, 2) }} KES {{ number_format($inv->paid, 2) }} KES {{ number_format($inv->balance, 2) }}

Payment History

@foreach ($payments as $p) @endforeach
Voucher Supplier Date Method Amount Status Actions
{{ $p->voucher_no }} {{ $p->supplier_name }} {{ $p->date }} {{ $p->method }} KES {{ number_format($p->amount, 2) }} {{ $p->status }}
PDF @if ($p->status !== 'Voided')
@csrf
@endif
@endsection