@extends('layouts.app') @section('title',$invoice->invoice_number) @section('heading','Invoice details') @section('content')

{{ $invoice->invoice_number }}

{{ $invoice->status->label() }}@if($invoice->is_overdue)Overdue@endif

{{ $invoice->customer->company_name }} · {{ $invoice->description }}

@can('update',$invoice)Edit@endcan @can('addFollowup',$invoice)@endcan @can('recordPayment',$invoice)@endcan
Total amount{{ $invoice->currency }} {{ number_format($invoice->total_amount,2) }}Subtotal {{ number_format($invoice->subtotal,2) }} + tax {{ number_format($invoice->tax_amount,2) }}
Paid amount{{ $invoice->currency }} {{ number_format($invoice->paid_amount,2) }}{{ $invoice->total_amount > 0 ? number_format(($invoice->paid_amount/$invoice->total_amount)*100,1) : 0 }}% collected
Outstanding{{ $invoice->currency }} {{ number_format($invoice->outstanding_amount,2) }}{{ $invoice->is_overdue ? 'Payment is overdue':'Remaining balance' }}
Invoice age{{ (int)$invoice->invoice_date->diffInDays(today()) }} days{{ $invoice->ageing_bucket }} ageing bucket

Collection timeline

Follow-ups and customer responses, newest first

@forelse($invoice->followups as $followup)
{{ $followup->contact_method->name }}by {{ $followup->creator->name }}
@if($followup->customer_response)
Customer response

{{ $followup->customer_response }}

@endif @if($followup->internal_notes)

{{ $followup->internal_notes }}

@endif
@if($followup->next_followup_date)Next: {{ $followup->next_followup_date->format('d M Y') }}@endif @if($followup->promised_payment_date)Promised: {{ $followup->promised_payment_date->format('d M Y') }}@endif
@empty

No follow-ups recorded

Add the first customer interaction to begin the timeline.

@endforelse

Payment history

Payments recorded against this invoice

@forelse($invoice->payments->sortByDesc('payment_date') as $payment)@empty@endforelse
DateAmountMethodReferenceRecorded by
{{ $payment->payment_date->format('d M Y') }}{{ $invoice->currency }} {{ number_format($payment->amount,2) }}{{ $payment->payment_method }}{{ $payment->payment_reference ?: '—' }}{{ $payment->recorder->name }}
No payments recorded yet.
@can('addFollowup',$invoice)@endcan @can('recordPayment',$invoice)@endcan @if(!auth()->user()->hasRole('management'))@endif @endsection