Bill No: {{ $bill->bill_no }}
Date: {{ optional($bill->bill_date)->format('d - m - Y') }}
Category: {{ $bill->category?->name }}
Status: {{ strtoupper($bill->status) }}
Total: {{ number_format((float)$bill->total_amount, 2) }}
Paid: {{ number_format((float)$bill->paid_amount, 2) }}
Remaining: {{ number_format((float)$bill->remaining_amount, 2) }}
Vendor: {{ $bill->vendor_name ?: '-' }}
@if($lastPostedPayment)
Payment Date:
{{ optional($lastPostedPayment->payment_date)->format('d - m - Y h:i A') }}
({{ strtoupper($lastPostedPayment->paid_from_method_key ?? 'Cash') }})
@endif
@if($bill->remark)
Remark:
{{ $bill->remark }}
@endif
Print Voucher
@can('expense_bill.update')
@if($bill->status === 'draft')
Edit Bill
@endif
@endcan
@can('expense_bill.approve')
@if($bill->status === 'draft')
@endif
@endcan
@can('expense_bill.update')
@if($bill->status === 'draft')
@endif
@endcan
{{-- Documents --}}
Supporting Documents
@if($bill->documents->count() > 0)
{{ $bill->documents->count() }}
@endif
@if($bill->documents->count() > 0)
| # |
Document / File |
Uploaded By |
Uploaded At |
Action |
@foreach($bill->documents as $doc)
@php
$ext = strtolower(pathinfo($doc->file_path, PATHINFO_EXTENSION));
$iconClass = match($ext) {
'pdf' => 'fa-file-pdf text-danger',
'jpg', 'jpeg', 'png', 'webp' => 'fa-file-image text-primary',
'doc', 'docx' => 'fa-file-word text-info',
default => 'fa-file text-secondary'
};
$filename = basename($doc->file_path);
@endphp
| {{ $loop->iteration }} |
{{ $filename }}
|
{{ $doc->uploader?->name ?? 'System' }} |
{{ optional($doc->created_at)->format('d - m - Y h:i A') ?? '-' }} |
@if($bill->status !== 'void')
@can('deleteDocument', $bill)
@endcan
@endif
|
@endforeach
@else
No documents attached.
@endif
{{-- Upload Additional Document Option (Allowed for draft, approved, partial, paid) --}}
@if($bill->status !== 'void')
@can('uploadDocument', $bill)
@endcan
@endif
{{-- Installments --}}
Installments
@if($bill->installments->count() > 0)
@if($bill->status === 'approved')
{{-- Approved: only installments update allowed --}}
@else
| # |
Due Date |
Paid Date |
Amount Due |
Paid |
Remaining |
Status |
Invoice |
@foreach($bill->installments as $inst)
| {{ $inst->installment_no }} |
{{ optional($inst->due_date)->format('d - m - Y') }} |
@if(isset($installmentPaymentMap[$inst->id]))
{{ optional($installmentPaymentMap[$inst->id]->payment_date)->format('d - m - Y h:i A') }}
@else
-
@endif
|
{{ number_format((float)$inst->amount_due, 2) }} |
{{ number_format((float)$inst->amount_paid, 2) }} |
{{ number_format((float)$inst->remaining_amount, 2) }} |
{{ strtoupper($inst->status) }} |
@if(isset($installmentPaymentMap[$inst->id]))
@else
-
@endif
|
@endforeach
@if(in_array($bill->status, ['partial','paid']))
Payment started/paid, installment cannot be edited.
@endif
@endif
@else
No installment plan.
@endif
{{-- Payment Form --}}
Make Payment
@if(in_array($bill->status, ['approved','partial']))
@else
Bill must be Approved to accept payment.
@endif
{{-- Payment history --}}
Payment History
@if($bill->payments->count() > 0)
| # |
Payment No |
Date |
Method |
Amount |
Status |
Action |
@foreach($bill->payments as $p)
| {{ $loop->iteration }} |
{{ $p->payment_no }} |
{{ optional($p->payment_date)->format('d - m - Y h:i A') }} |
{{ $methodNameMap[$p->paid_from_method_key] ?? strtoupper($p->paid_from_method_key) }} |
{{ number_format((float)$p->amount, 2) }} |
{{ strtoupper($p->status) }}
|
@if($p->status !== 'void')
@endif
@can('expense_payment.void')
@if($p->status !== 'void')
@if(str_starts_with((string)$bill->bill_no, 'SALARY-') || str_contains((string)$bill->remark, 'Salary Batch Payment'))
Payroll Linked
@else
@endif
@endif
@endcan
|
@endforeach
@else
No payments yet.
@endif