@extends('layouts.app') @section('title', 'Tagihan') @section('content')

Tagihan

Buat Tagihan
@if(session('success')) @endif @if(session('error')) @endif {{-- Card Statistik --}}
Total Tagihan
{{ $stats['total'] ?? 0 }}
Belum Dibayar
{{ $stats['unpaid'] ?? 0 }}
Jatuh Tempo
{{ $stats['overdue'] ?? 0 }}
Terbayar Bulan Ini
{{ $stats['paid_this_month'] ?? 0 }}
{{-- Filter --}}
@forelse($invoices as $index => $invoice) @empty @endforelse
No No. Invoice Pelanggan Paket Periode Total Jatuh Tempo Status Aksi
{{ $invoices->firstItem() + $index }} {{ $invoice->invoice_number }}
{{ $invoice->customer->name ?? '-' }}
{{ $invoice->customer->customer_code ?? '-' }}
{{ $invoice->subscription->package->name ?? '-' }} @if($invoice->billing_month && $invoice->billing_year) {{ \Carbon\Carbon::create($invoice->billing_year, $invoice->billing_month)->translatedFormat('F Y') }} @else - @endif Rp {{ number_format($invoice->total_amount, 0, ',', '.') }} @if($invoice->due_date) {{ \Carbon\Carbon::parse($invoice->due_date)->format('d/m/Y') }} @else - @endif @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 }}
@if(in_array($invoice->status, ['unpaid', 'overdue'])) @endif
@csrf @method('DELETE')
Belum ada data tagihan.
@if($invoices->hasPages()) @endif
{{-- Modal Generate Otomatis --}} {{-- Modal Generate Massal --}} @endsection