@php $invoice->load(['lines.tariff', 'disbursementsList', 'taxesList.tax']); $clientName = $invoice->customer->full_name ?? trim(($invoice->customer->first_name ?? '') . ' ' . ($invoice->customer->last_name ?? '')); $subtotal = (float) ($invoice->subtotal ?? $invoice->lines->sum('line_total')); $disbursementsTotal = (float) ($invoice->disbursement_total ?? $invoice->disbursementsList->sum(function ($row) { return (float) ($row->amount ?? 0) + (float) ($row->tax_amount ?? 0); })); $discountAmount = (float) ($invoice->discount_total ?? 0); $netBeforeTax = $subtotal - $disbursementsTotal - $discountAmount; $totalTaxAmount = (float) ($invoice->tax_total ?? $invoice->taxesList->sum('tax_amount')); $netAfterTax = $netBeforeTax + $totalTaxAmount; @endphp
{{ $company->company_name ?? 'Law Firm' }}
Attorneys at Law
{{ $company->address ?? '' }}
t: {{ $company->contact_phone ?? '' }} · {{ $company->contact_email ?? '' }}
ZIMRA TIN: {{ $company->tax_id ?? '' }}
Legal Invoice
{{ $invoice->invoice_number ?? 'INV-0000' }}
Issued: {{ optional($invoice->invoice_date)->format('d F Y') }}
Due: {{ optional($invoice->due_date ?? $invoice->invoice_due_date ?? null)->format('d F Y') }}
Matter: {{ $invoice->case_reference ?? 'N/A' }}
{{ strtoupper((string) ($invoice->status ?? 'Open')) }}
@include('partials.foil-divider')
Counsel
{{ $company->company_name ?? 'Law Firm' }}
{!! nl2br(e($company->address ?? '')) !!}
{{ $company->contact_email ?? '' }}
{{ $company->contact_phone ?? '' }}
Client
{{ $clientName ?: 'Client' }}
{!! nl2br(e($invoice->customer->street_address ?? '')) !!}
{{ $invoice->customer->phone_primary ?? '' }}
{{ $invoice->customer->email ?? '' }}
@include('partials.foil-divider-thin')
@if($invoice->lines && $invoice->lines->count() > 0) @foreach($invoice->lines as $line) @php $chargeType = $line->charge_type ?? $line->billing_method ?? 'FIXED_FEE'; if ($chargeType === 'HOURLY') { $hours = $line->hours_decimal ?? (($line->total_rounded_minutes ?? 0) / 60); $units = number_format((float) $hours, 2); } else { $units = number_format((float) ($line->quantity ?? 1), 2); } $rateDisplay = number_format((float) ($line->rate_snapshot ?? 0), 2); @endphp @endforeach @else @endif
Matter / Service Hrs Rate Amount
{{ $line->service_name ?? $line->tariff->service_name ?? 'Service' }}
{{ $line->description ?? $line->notes ?? '' }}
{{ $units }} {{ $rateDisplay }} {{ number_format((float) $line->line_total, 2) }}
{{ $invoice->description ?? 'Legal Services' }}
{{ $invoice->notes ?? '' }}
1.00 {{ number_format($subtotal, 2) }} {{ number_format($subtotal, 2) }}
Subtotal {{ number_format($subtotal, 2) }}
Disbursements - {{ number_format($disbursementsTotal, 2) }}
Discount - {{ number_format($discountAmount, 2) }}
Tax {{ number_format($totalTaxAmount, 2) }}
Total Due {{ number_format($netAfterTax, 2) }}
{{ $invoice->notes ?? 'Payment is due within the stated period. Disputes must be raised in writing within 14 days of receipt.' }}
@include('partials.notary-seal', ['word' => 'Verified', 'monogram' => $company->firm_initials ?? 'LF'])
V-ID: {{ $invoice->verification_id ?? $invoice->invoice_number ?? 'N/A' }}
@include('partials.foil-divider')