@extends('layouts.app') @section('title', 'Invoice Details - Quick OMS') @section('content')

Invoice #{{ $invoice->invoice_number }}

Logo
@if($invoice->company) {{ $invoice->company->name }}
{!! nl2br(e($invoice->company->address)) !!}
P: {{ $invoice->company->phone }}
E: {{ $invoice->company->email }} @else A: 4 Square Glen Eden
P: +64 123 456 789
E: rob.worker1@4sq.co.nz
GST: 987-654-321 @endif
TAX INVOICE
INVOICE
Invoice to:
{{ $invoice->client->name ?? 'Guest' }}
@if($invoice->client) A: {{ $invoice->client->address ?? '-' }}
P: {{ $invoice->client->mobile ?? '-' }}
E: {{ $invoice->client->email ?? '-' }} @endif
{{ strtoupper($invoice->status->name ?? 'N/A') }}

Invoice No. {{ $invoice->invoice_number }}
Issue Date : {{ $invoice->issue_date ? date('M d, Y', strtotime($invoice->issue_date)) : '-' }}
Expiry Date : {{ $invoice->expiry_date ? date('M d, Y', strtotime($invoice->expiry_date)) : '-' }}
@php $subtotal = 0; $totalTax = 0; @endphp @foreach($invoice->items as $item) @php $subtotal += ($item->unit_price * $item->quantity) - $item->discount; $totalTax += $item->tax_amount; @endphp @endforeach
Item Description Quantity Price Disc. Tax Amount
{{ $item->item_name }}
{{ $item->description }}
{{ $item->quantity }} ${{ number_format($item->unit_price, 2) }} ${{ number_format($item->discount, 2) }} {{ $item->tax_rate }}% ${{ number_format($item->total, 2) }}
Subtotal:${{ number_format($subtotal, 2) }}
Tax (GST):${{ number_format($totalTax, 2) }}
Total${{ number_format($invoice->total, 2) }}
@php $totalPaid = $invoice->invoicePayments->sum('payment_amount'); $balance = max(0, $invoice->total - $totalPaid); @endphp
Remaining Balance: ${{ number_format($balance, 2) }}
Note:
{{ $invoice->note ?? 'Thank you for your business.' }}
Update Status
@csrf
Download PDF Edit Invoice
Status History
@foreach($invoice->statusHistories as $history)
{{ $history->invoiceStatus->name ?? 'N/A' }} {{ $history->created_at->format('d-m-Y H:i') }}
{{ $history->note }}
@endforeach
Send Invoice
@csrf
@push('css') @endpush @push('scripts') @endpush @endsection