@extends('layouts.app') @section('content')

Payments For Due

Back to Sales
Reset
@foreach($payments as $i => $p) @endforeach
# Type Customer Method Previous Due Paid Current Due Allocations By Time Invoices Action
{{ $payments->firstItem() + $i }} {{ strtoupper($p->payment_type ?? '-') }} {{ $p->customer_name ?? 'Unknown' }} @if(!empty($p->customer_pin))
PIN: {{ $p->customer_pin }}
@endif
{{ strtoupper($p->method ?? 'cash') }} @if(($p->payment_type ?? '') === 'due') {{ number_format((float)($p->balance_before ?? 0), 2) }} @else - @endif {{ number_format((float)($p->paid ?? 0), 2) }} @if(($p->payment_type ?? '') === 'due') {{ number_format((float)($p->balance_after ?? 0), 2) }} @else - @endif {{ (int)($p->allocations ?? 0) }} {{ $p->user_name ?? '-' }} {{ !empty($p->paid_at) ? \Carbon\Carbon::parse($p->paid_at)->format('Y-m-d h:i A') : '-' }} @php $invoiceNumbers = collect(explode(', ', (string)($p->invoice_numbers ?? ''))) ->filter(fn($v) => trim((string)$v) !== '') ->unique() ->values(); @endphp @if($invoiceNumbers->isEmpty()) - @else {{ $invoiceNumbers->take(3)->implode(', ') }} @if($invoiceNumbers->count() > 3) (+{{ $invoiceNumbers->count() - 3 }}) @endif @endif @if(($p->payment_type ?? '') === 'due') Print @php $editAmount = number_format((float)($p->amount_requested ?? $p->paid ?? 0), 2, '.', ''); $editMethod = strtolower($p->method ?? 'cash'); $editAt = !empty($p->paid_at) ? \Carbon\Carbon::parse($p->paid_at)->format('Y-m-d\\TH:i') : ''; @endphp @elseif(($p->payment_type ?? '') === 'invoice') @if(!empty($p->invoice_id)) View Invoice @else - @endif @else - @endif
{{ $payments->links() }}
@endsection