@extends('layouts.app') @php $status = $invoice->effectiveStatus(); $balance = $invoice->balance(); $paid = $invoice->status === 'paid' || ($balance <= 0 && $invoice->status !== 'void'); $void = $invoice->status === 'void'; $payable = ! $void && ! $paid && $balance > 0; $cfg = config('infotics.billing'); $g = fn (string $k) => trim((string) setting($k, $cfg[$k] ?? '')); $bank = array_filter(['Bank' => $g('bank_name'), 'Account title' => $g('bank_account_title'), 'Account number' => $g('bank_account_number'), 'IBAN' => $g('bank_iban')]); $wallets = array_filter(['Easypaisa' => $g('easypaisa'), 'JazzCash' => $g('jazzcash')]); $configured = $bank || $wallets; $phone = setting('phone'); $wa = digits(setting('whatsapp')); $payments = $invoice->payments->sortByDesc('id')->values(); $payLabel = ['paid' => 'Received', 'pending' => 'Awaiting verification', 'failed' => 'Not accepted', 'refunded' => 'Refunded']; $methodLabel = ['bank_transfer' => 'Bank transfer', 'easypaisa' => 'Easypaisa', 'jazzcash' => 'JazzCash', 'cash' => 'Cash', 'card' => 'Card', 'payfast' => 'PayFast', 'online' => 'Online', 'other' => 'Other']; $fromQuote = $invoice->quote_id ? $invoice->quote : null; $gateways = \App\Payments\GatewayManager::available(); $nextInst = $invoice->paymentPlan?->nextInstallment(); seo()->noindex()->title('Invoice '.$invoice->number); @endphp @push('head')@endpush @section('content')
Invoice

{{ $invoice->number }}

@if($payable) How to pay@endif Download PDF
@if($void)
This invoice has been voided. Nothing is due. If you believe this is a mistake, please contact us.
@elseif($paid)
Paid in full{{ $invoice->paid_at ? ' on '.$invoice->paid_at->format('d M Y') : '' }}. Thank you. Your receipts are listed below.
@elseif($status === 'overdue') @elseif($invoice->status === 'partial')
Part-paid. {{ money2($invoice->amount_paid) }} received; {{ money2($balance) }} is still due by {{ $invoice->due_date?->format('d M Y') }}.
@else
{{ money2($balance) }} due by {{ $invoice->due_date?->format('d M Y') ?? 'the due date' }}. Pay using any method below, then upload your payment proof so we can confirm it.
@endif @if($pending > 0)
{{ money2($pending) }} is being verified. We have your payment proof and will email your official receipt once it is confirmed.
@endif
@include('docs._head', ['docname' => 'INVOICE', 'docno' => $invoice->number, 'statusKey' => $status])
Billed to {{ $invoice->customer_name }} @if($invoice->company)
{{ $invoice->company }}
@endif
{{ $invoice->customer_email }}@if($invoice->customer_phone)
{{ $invoice->customer_phone }}@endif
Invoice no.
{{ $invoice->number }}
Issue date
{{ $invoice->issue_date?->format('d M Y') }}
Due date
{{ $invoice->due_date?->format('d M Y') }}
@if($fromQuote)
From quotation
{{ $fromQuote->number }}
@endif
@include('docs._items', ['doc' => $invoice, 'paidAmount' => $invoice->amount_paid, 'balance' => $balance])
@if($invoice->notes)
Notes

{!! nl2br(e($invoice->notes)) !!}

@endif
Computer-generated invoice — no signature required. Use {{ $invoice->number }} as your payment reference. Amounts are in {{ $invoice->currency ?: config('infotics.currency', 'PKR') }}.
@if($payments->isNotEmpty())

Payments on this invoice

@foreach($payments as $p) @endforeach
DateMethodReferenceAmountStatus
{{ ($p->paid_at ?? $p->created_at)->format('d M Y') }} {{ $methodLabel[$p->method] ?? ucfirst(str_replace('_', ' ', (string) $p->method)) }} {{ $p->receipt_no ?: ($p->transaction_ref ?: $p->reference) }} {{ money2($p->amount) }} {{ $payLabel[$p->status] ?? ucfirst($p->status) }} @if($p->status === 'paid') Receipt@endif
@endif @if($payable && $gateways)
Instant

Pay online now

Pay securely on the provider’s own page. Your receipt is emailed automatically the moment the payment is confirmed. No upload is needed.

Secure checkout
@csrf
Amount @if($nextInst && $nextInst->outstanding() > 0 && $nextInst->outstanding() < $balance) @endif
@foreach($gateways as $key => $gw) @endforeach
@endif @if($payable)

{{ $gateways ? 'Or pay by transfer: ' : '1. Pay ' }}{{ money2($balance) }}

Use invoice number {{ $invoice->number }} as the payment reference so we can match your payment quickly.

@if($configured) @if($bank)
Bank transfer
@foreach($bank as $label => $val)
{{ $label }}
{{ $val }}
@endforeach
@endif @foreach($wallets as $label => $val)
{{ $label }}
Account
{{ $val }}
@endforeach @else
Pay with our team
@foreach($methods as $m)

{{ $m }}

@endforeach
@endif

Paying from another country or need a different method? Email us@if($wa) or message us on WhatsApp@endif.

2. I’ve paid — upload proof

Send us the transaction ID or a screenshot of the receipt. We verify it, mark the invoice and email your official receipt.

@csrf
Choose a file or drag it here
JPG, PNG, WebP or PDF · up to 5 MB
@error('proof')
{{ $message }}
@enderror
@endif
Questions about this invoice?We are available {{ config('infotics.brand.hours') }}.
@if($phone) {{ $phone }}@endif @if($wa) WhatsApp@endif Email
@endsection @push('scripts')@endpush