@extends('layouts.app') @section('title', 'Bill '.($bill->bill_no ?: '#'.$bill->id)) @section('content') @php $paid = $bill->paid(); $due = $bill->due(); $pct = (float) $bill->amount > 0 ? min(100, round($paid / (float) $bill->amount * 100)) : 0; @endphp @if ($due > 0.004) @can('payments.create') Pay this bill @endcan @endif @can('vendor_bills.edit') Edit @endcan @can('vendor_bills.delete') @endcan
Amount
{{ money($bill->amount) }}
Paid{{ money($paid) }}
Balance{{ money($due) }}
Details
Vendor
{{ $bill->vendor->name }}
Bill date
{{ $bill->bill_date->format('d M Y') }}
Due date
{{ $bill->due_date?->format('d M Y') ?? '—' }}@if ($bill->isOverdue()) (overdue)@endif
Order
@if ($bill->order){{ $bill->order->order_no }} · {{ $bill->order->client->name }}@else — @endif
Description
{{ $bill->description ?: '—' }}
@if ($bill->notes)
Notes
{!! nl2br(e($bill->notes)) !!}
@endif
@can('payments.view')
Payments against this bill
@forelse ($bill->payments as $p) @empty @endforelse
DateMethodReferenceAmount
{{ $p->paid_on->format('d M Y') }} {{ \App\Models\Payment::METHODS[$p->method] ?? $p->method }} {{ $p->reference ?: '—' }} −{{ money($p->amount) }}
@endcan
@endsection