@extends('layouts.invoices') @section('content')
Back to List

Invoice Details

Invoice #{{ $invoice->invoice_number }}

Export PDF Edit
@csrf
Payment Status
{{ number_format($invoice->getPaymentProgress(), 1) }}%

Total Amount:

${{ number_format($invoice->total_amount, 2) }}

Paid Amount:

${{ number_format($invoice->paid_amount, 2) }}

Invoice Details

Status: {{ ucfirst($invoice->status) }}

Issue Date: {{ $invoice->invoice_date ? $invoice->invoice_date->format('d M Y') : 'N/A' }}

Due Date: {{ $invoice->due_date ? $invoice->due_date->format('d M Y') : 'N/A' }}

@if($invoice->payment_date)

Last Payment: {{ $invoice->payment_date->format('d M Y') }}

@endif
Billing Information

{{ $invoice->client_name }}
{{ $invoice->client_city }}, {{ $invoice->client_country }}
{{ $invoice->client_email }}
{{ $invoice->client_phone }}

Workers
@php $totalStampingFee = 0; $totalArrivalFee = 0; @endphp @foreach($workers as $index => $worker) @php $stampingFee = $worker['stamping_fee'] ?? 0; $arrivalFee = $worker['arrival_fee'] ?? 0; $workerTotal = $stampingFee + $arrivalFee; $totalStampingFee += $stampingFee; $totalArrivalFee += $arrivalFee; @endphp @endforeach
# Name Passport Stamping Fee Arrival Fee Total
{{ $index + 1 }} {{ $worker['worker_name'] }} {{ $worker['passport_number'] }} {{ number_format($stampingFee, 2) }} {{ number_format($arrivalFee, 2) }} {{ number_format($workerTotal, 2) }}
Subtotals: {{ number_format($totalStampingFee, 2) }} {{ number_format($totalArrivalFee, 2) }} {{ number_format($totalStampingFee + $totalArrivalFee, 2) }}
Grand Total: {{ number_format($totalStampingFee + $totalArrivalFee, 2) }}
@if($invoice->paid_amount > 0)
Payment History
@foreach($invoice->payments as $payment) @endforeach
Date Amount Method Notes
{{ $payment->payment_date->format('d M Y') }} ${{ number_format($payment->amount, 2) }} {{ ucfirst(str_replace('_', ' ', $payment->payment_method)) }} {{ $payment->payment_notes }}
@endif @if($invoice->status !== 'paid')
Record Payment
@csrf
$
@endif
@push('scripts') @endpush @endsection