@extends('layouts.app')
@section('title', 'Vendor bills')
@section('content')
@php
$pills = filter_pills([
'status' => ['Status', ['unpaid' => 'Unpaid', 'partial' => 'Partly paid', 'paid' => 'Paid', 'overdue' => 'Overdue']],
'vendor_id' => ['Vendor', fn ($id) => optional($vendors->firstWhere('id', $id))->name ?? $id],
'from' => ['From', fn ($d) => pretty_date($d)],
'to' => ['To', fn ($d) => pretty_date($d)],
]);
$filtered = count($pills) > 0 || request()->filled('q');
$chips = [[null, 'All', 'all'], ['unpaid', 'Unpaid', 'unpaid'], ['partial', 'Partly paid', 'partial'], ['paid', 'Paid', 'paid'], ['overdue', 'Overdue', 'overdue']];
@endphp
| Order | Actions | |||||||
|---|---|---|---|---|---|---|---|---|
| {{ $b->bill_no ?: '#'.$b->id }} @if ($b->description){{ $b->description }}@endif | {{ $b->vendor->name }} | {{ $b->bill_date->format('d M Y') }} | {{ $b->due_date?->format('d M Y') ?? '—' }}@if ($b->isOverdue())overdue@endif | @if ($b->order){{ $b->order->order_no }}@else —@endif | {{ money($b->amount) }} | {{ money($b->due()) }} |
|
|
|
| ||||||||
| All {{ $bills->total() }} matching {{ \Illuminate\Support\Str::plural('bill', $bills->total()) }} | {{ money($sums['amount']) }} | {{ money($sums['paid']) }} paid | {{ money($sums['due']) }} | |||||