@extends('layouts.app')
@section('title', 'Payments')
@section('content')
@php
$pills = filter_pills([
'direction' => ['Type', ['received' => 'Received', 'paid' => 'Paid']],
'client_id' => ['Client', fn ($id) => optional($clients->firstWhere('id', $id))->name ?? $id],
'vendor_id' => ['Vendor', fn ($id) => optional($vendors->firstWhere('id', $id))->name ?? $id],
'method' => ['Method', \App\Models\Payment::METHODS],
'from' => ['From', fn ($d) => pretty_date($d)],
'to' => ['To', fn ($d) => pretty_date($d)],
]);
$filtered = count($pills) > 0 || request()->filled('q');
$in = (int) ($directionCounts['received'] ?? 0);
$out = (int) ($directionCounts['paid'] ?? 0);
@endphp
| Party | Against | Reference | Actions | ||||
|---|---|---|---|---|---|---|---|
| {{ $p->paid_on->format('d M Y') }} | {{ $p->isReceived() ? 'Received' : 'Paid' }} | @if ($p->isReceived()){{ $p->client->name }} @else{{ $p->vendor->name }}@endif | @if ($p->order){{ $p->order->order_no }} @elseif ($p->vendorAssignment){{ $p->vendorAssignment->number() }}@if ($p->vendorAssignmentItem){{ $p->vendorAssignmentItem->label() }}@endif @elseif ($p->vendorBill)Bill {{ $p->vendorBill->bill_no ?: '#'.$p->vendorBill->id }} @elseOn account@endif | {{ \App\Models\Payment::METHODS[$p->method] ?? $p->method }} | {{ $p->reference ?: '—' }} | {{ $p->isReceived() ? '+' : '−' }}{{ money($p->amount) }} |
|
|
| |||||||