@extends('layouts.staff') @section('title', 'Detail Invoice') @section('content') @php $bulanIndo = [1=>'Januari',2=>'Februari',3=>'Maret',4=>'April',5=>'Mei',6=>'Juni',7=>'Juli',8=>'Agustus',9=>'September',10=>'Oktober',11=>'November',12=>'Desember']; $statusMap = ['unpaid' => 'danger', 'partial' => 'warning', 'paid' => 'success', 'cancelled' => null]; @endphp

{{ $invoice->invoice_number }}

{{ $invoice->student->full_name }} — {{ $bulanIndo[$invoice->period_month] }} {{ $invoice->period_year }}

@if ($statusMap[$invoice->status]) {{ ucfirst($invoice->status) }} @else Dibatalkan @endif
@if (session('status'))
{{ session('status') }}
@endif @if ($errors->any())
{{ $errors->first() }}
@endif

Tahun Ajaran

{{ $invoice->academicYear->year_name }}

Jatuh Tempo

{{ $invoice->due_date?->translatedFormat('d M Y') ?? '—' }}

@if ($invoice->status === 'unpaid') @endif @foreach ($invoice->items as $item) @if ($invoice->status === 'unpaid') @endif @endforeach @if ($invoice->status === 'unpaid') @endif
Item NominalAksi
{{ $item->item_name }} Rp{{ number_format($item->amount, 0, ',', '.') }}
@csrf @method('DELETE')
Total Rp{{ number_format($invoice->total_amount, 0, ',', '.') }}

Riwayat Pembayaran

Sisa Tagihan: Rp{{ number_format($remaining, 0, ',', '.') }}

@forelse ($invoice->payments as $payment)

{{ $payment->paymentChannel->name }} — Rp{{ number_format($payment->amount_paid, 0, ',', '.') }}

{{ $payment->paid_at->translatedFormat('d M Y, H:i') }} @if ($payment->reference_number) · Ref: {{ $payment->reference_number }} @endif @if ($payment->handoverBy) · Diserahkan oleh {{ $payment->handoverBy->email }} @endif

@if (! $payment->payment_gateway_transaction_id)
@csrf @method('DELETE')
@endif
@empty

Belum ada pembayaran.

@endforelse @if ($remaining > 0 && $invoice->status !== 'cancelled')
@csrf

Catat Pembayaran

@error('amount_paid')

{{ $message }}

@enderror
@endif
@if ($invoice->status === 'unpaid')
@csrf

Tambah Item

@csrf @method('DELETE')
@endif
← Kembali ke Daftar Invoice
@endsection