@php $supplierName = $invoice->supplier->supplier_name ?? 'Supplier'; $supplierAddress = $invoice->supplier->address ?? ''; $supplierContact = $invoice->supplier->contact_person ?? $invoice->contact_person ?? ''; $supplierEmail = $invoice->supplier->email ?? ''; $gross = (float) ($invoice->price ?? 0) * (float) ($invoice->quantity ?? 0); $discountPct = (float) ($invoice->discount ?? 0); $discountAmount = $gross * ($discountPct / 100); $net = max($gross - $discountAmount, 0); $taxRate = (float) ($invoice->tax_rate ?? ($invoice->tax->tax_rate ?? 0)); $taxAmount = (float) ($invoice->tax_amount ?? ($net * $taxRate / 100)); $operationCost = (float) ($invoice->operation_cost ?? 0); $total = (float) ($invoice->total ?? ($net + $taxAmount + $operationCost)); @endphp @include('partials.firm-logo-data')

SUPPLIER INVOICE

{{ $company->company_name ?? config('app.name', 'Law Firm') }}

@if(!empty($firmLogoData)) Firm Logo @endif
Supplier Invoice
{{ $invoice->invoice_number ?? 'SI-0000' }}
Issued: {{ optional($invoice->invoice_date)->format('d F Y') }}
Reference: {{ $invoice->reference ?? $invoice->reference_number ?? 'N/A' }}
GL: {{ $invoice->gl_account ?? 'N/A' }}
{{ strtoupper((string) ($invoice->status ?? 'Open')) }}
@include('partials.foil-divider')
From
{{ $company->company_name ?? 'Law Firm' }}
{!! nl2br(e($company->address ?? '')) !!}
{{ $company->contact_email ?? '' }}
{{ $company->contact_phone ?? '' }}
Supplier
{{ $supplierName }}
{!! nl2br(e($supplierAddress)) !!}
{{ $supplierContact }}
{{ $supplierEmail }}
@include('partials.foil-divider-thin')
Service Qty Unit Amount
{{ $invoice->description ?? 'Supplier Service' }}
{{ $invoice->notes ?? '' }}
{{ number_format((float) ($invoice->quantity ?? 1), 2) }} {{ number_format((float) ($invoice->price ?? 0), 2) }} {{ number_format($net, 2) }}
Gross {{ number_format($gross, 2) }}
Discount - {{ number_format($discountAmount, 2) }}
Tax {{ number_format($taxAmount, 2) }}
Operation Cost {{ number_format($operationCost, 2) }}
Total {{ number_format($total, 2) }}
@include('partials.foil-divider')

Bank: {{ $company->bank_name ?? 'N/A' }} | Account: {{ $company->bank_acc_number ?? 'N/A' }} | Type: {{ !empty($company?->bank_account_type) ? strtoupper($company->bank_account_type) : 'N/A' }} | Branch: {{ $company->bank_branch_address ?? 'N/A' }} | ZIMRA TIN: {{ $company->tax_id ?? 'N/A' }}