@extends('layouts.app') @section('title', 'Detail Tagihan - ' . $invoice->invoice_number) @section('content')

Detail Tagihan

@if(in_array($invoice->status, ['unpaid', 'overdue'])) Catat Pembayaran @if(\App\Models\Setting::get('wa_enabled','0') === '1' && $invoice->customer?->phone)
@csrf
@endif @endif Edit Kembali
@csrf @method('DELETE')
@if(session('success')) @endif
{{-- Nota Tagihan --}}
{{-- Header Nota --}}

{{ $invoice->invoice_number }}

@php $statusMap = [ 'unpaid' => ['bg-warning text-dark', 'Belum Dibayar'], 'paid' => ['bg-success', 'Lunas'], 'overdue' => ['bg-danger', 'Jatuh Tempo'], 'cancelled' => ['bg-secondary', 'Dibatalkan'], ]; [$badgeClass, $badgeLabel] = $statusMap[$invoice->status] ?? ['bg-secondary', ucfirst($invoice->status)]; @endphp {{ $badgeLabel }}
Tanggal Terbit
{{ $invoice->issue_date ? \Carbon\Carbon::parse($invoice->issue_date)->format('d F Y') : '-' }}
{{-- Info Pelanggan & Tagihan --}}
Info Pelanggan
{{ $invoice->subscription->customer->name ?? '-' }}
Kode: {{ $invoice->subscription->customer->customer_code ?? '-' }}
@if($invoice->subscription->customer->address ?? false)
{{ $invoice->subscription->customer->address }}
@endif @if($invoice->subscription->customer->phone ?? false)
{{ $invoice->subscription->customer->phone }}
@endif
Info Tagihan
Tanggal Jatuh Tempo {{ $invoice->due_date ? \Carbon\Carbon::parse($invoice->due_date)->format('d F Y') : '-' }}
Periode Tagihan @if($invoice->billing_month && $invoice->billing_year) {{ \Carbon\Carbon::create($invoice->billing_year, $invoice->billing_month)->translatedFormat('F Y') }} @else - @endif
{{-- Detail Paket --}}
Detail Layanan
Paket Download / Upload Harga
{{ $invoice->subscription->package->name ?? '-' }} {{ $invoice->subscription->package->download_speed ?? '-' }} / {{ $invoice->subscription->package->upload_speed ?? '-' }} Rp {{ number_format($invoice->amount, 0, ',', '.') }}
{{-- Ringkasan Biaya --}}
@if($invoice->discount && $invoice->discount > 0) @endif
Jumlah Tagihan Rp {{ number_format($invoice->amount, 0, ',', '.') }}
Diskon - Rp {{ number_format($invoice->discount, 0, ',', '.') }}
Total Rp {{ number_format($invoice->total_amount, 0, ',', '.') }}
{{-- Info Catatan --}} @if($invoice->notes)
Catatan

{{ $invoice->notes }}

@endif
{{-- Panel Samping --}}
{{-- Info Pembayaran --}} @if($invoice->payment)
Pembayaran Diterima
@if($invoice->payment->payment_ref) @endif
Kode {{ $invoice->payment->payment_code }}
Tanggal {{ \Carbon\Carbon::parse($invoice->payment->payment_date)->format('d F Y') }}
Jumlah Rp {{ number_format($invoice->payment->amount, 0, ',', '.') }}
Metode {{ $invoice->payment->payment_method_label }}
No. Referensi {{ $invoice->payment->payment_ref }}
@else

Belum ada pembayaran untuk tagihan ini.

@if(in_array($invoice->status, ['unpaid', 'overdue'])) Catat Pembayaran @endif
@endif {{-- Info Langganan --}}
Info Langganan
@if($invoice->subscription)
Paket {{ $invoice->subscription->package->name ?? '-' }}
Download {{ $invoice->subscription->package->download_speed ?? '-' }}
Upload {{ $invoice->subscription->package->upload_speed ?? '-' }}
Status @php $subStatusMap = [ 'active' => ['bg-success', 'Aktif'], 'inactive' => ['bg-secondary', 'Nonaktif'], 'expired' => ['bg-danger', 'Kadaluarsa'], 'suspended' => ['bg-warning text-dark', 'Ditangguhkan'], ]; [$sBadge, $sLabel] = $subStatusMap[$invoice->subscription->status] ?? ['bg-secondary', ucfirst($invoice->subscription->status)]; @endphp {{ $sLabel }}
@else

Tidak ada data langganan.

@endif
@endsection