@extends('layouts.app') @section('title', $formTitle ?? 'Invoice Form') @section('content')

{{ $formTitle }}

Back to Invoices
@include('layouts.partials.flash')
@csrf @if($formMethod == 'PUT') @method('PUT') @endif
@if(!$invoice->id)
@if($shipment)
{{ $shipment->tracking_number ?? $shipment->resi_number ?? 'N/A' }}

{{ __('shipment_page.customer') }}: {{ $shipment->customer->name ?? $shipment->customer->full_name ?? 'N/A' }}

{{ __('common.rate_plan') }} {{ $shipment->ratePlan->name ?? 'N/A' }}

{{ __('common.total_charge') }} Rp. {{ number_format($shipment->total_charge ?? 0, 0, ',', '.') }}
@else @error('shipment_id')
{{ $message }}
@enderror @endif
@else
@endif
@error('invoice_date')
{{ $message }}
@enderror
@error('due_date')
{{ $message }}
@enderror
@if($invoice->id)
@if($invoice->status === 'paid') Paid @elseif($invoice->status === 'overdue') Overdue @else Unpaid @endif
@if($invoice->payments && $invoice->payments->count() > 0)
@php $totalPaid = 0; @endphp @foreach($invoice->payments as $payment) @php $totalPaid += $payment->amount; @endphp @endforeach
Date {{ __('dashboard_page.amount') }} {{ __('invoice_page.method') }} {{ __('invoice_page.reference') }}
{{ $payment->payment_date->format('d-m-Y') }} Rp. {{ number_format($payment->amount, 0, ',', '.') }} {{ $payment->method }} {{ $payment->reference_number ?? '-' }}
{{ __('common.total_paid') }} Rp. {{ number_format($totalPaid, 0, ',', '.') }}
{{ __('common.remaining_balance') }} Rp. {{ number_format($invoice->total_amount - $totalPaid, 0, ',', '.') }}
@else @if($invoice->id)
Note: This invoice supports installment payments. You can record multiple payments until the full amount is paid.
@endif @endif @elseif($shipment)
{{ __('shipment_page.customer') }}: {{ $shipment->customer->name ?? $shipment->customer->full_name }}
{{ __('common.rate_plan') }} {{ $shipment->ratePlan->name ?? 'N/A' }}
{{ __('common.date_received') }} {{ $shipment->date_received ? \Carbon\Carbon::parse($shipment->date_received)->format('d-m-Y') : 'N/A' }}
@endif
Claim for Lost Goods
has_claim ?? false) ? 'checked' : '' }} onchange="toggleClaimFields()">
@error('claim_description')
{{ $message }}
@enderror
@error('claim_amount')
{{ $message }}
@enderror
@error('claim_status')
{{ $message }}
@enderror
@if($invoice->claim_submitted_at ?? false)
@if($invoice->claim_resolved_at)
@endif
@endif
Note: Claims for lost goods will be reviewed by the management team. Processing time may vary depending on the complexity of the case.
Cancel @if($invoice->id && $invoice->status !== 'paid') Record Payment @endif
@endsection @section('footer') @endsection @section('styles') @endsection