@extends('layouts.app') @php $rupiah = fn ($nilai): string => 'Rp ' . number_format((float) $nilai, 0, ',', '.'); $bulanId = [1 => 'Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember']; $tanggal = function (?string $tgl) use ($bulanId): string { if (! $tgl) { return '-'; } $ts = strtotime($tgl); return date('j', $ts) . ' ' . $bulanId[(int) date('n', $ts)] . ' ' . date('Y', $ts); }; @endphp @section('title', 'Tagihan Langganan') @section('content')

Admin KabupatenTagihan Langganan

Tagihan Langganan

Setiap lembaga ditagih Pokok (diinput manual oleh admin) dan Maintenance (setahun sekali, terhitung sejak mulai langganan).

@if (session('status'))
{{ session('status')['message'] }}
@endif @if ($errors->any()) @endif

Daftar Tagihan Lembaga

Input Tagihan Pokok manual, lalu klik label Belum Lunas/Lunas untuk mengganti status pokok.

{{ $rows->count() }} Lembaga
@forelse ($rows as $row) @php $sudahTagihan = (bool) $row->id_pembayaran; $maintenance = $sudahTagihan ? $row->biaya_maintenance : $row->maintenance_tahunan; $jatuhTempo = $sudahTagihan && $row->jatuh_tempo ? $row->jatuh_tempo : $row->jatuh_tempo_maintenance; $statusPokok = $row->status_pokok ?? 'belum lunas'; $statusMaint = $row->status_maintenance ?? 'belum lunas'; $total = $sudahTagihan ? (float) $row->total_tagihan : 0.0; $terbayarLabel = $sudahTagihan ? (($statusPokok === 'lunas' ? (float) $row->biaya_langganan : 0) + ($statusMaint === 'lunas' ? (float) $row->biaya_maintenance : 0)) : 0.0; $terbayar = max((float) ($row->terbayar ?? 0), $terbayarLabel); $sisa = max(0, $total - $terbayar); @endphp @empty @endforelse
No Lembaga Fitur Aktif Tagihan Pokok Maintenance Status Total / Sisa Aksi
{{ $loop->iteration }} {{ $row->nama_pkbm }} Mulai Langganan {{ $tanggal($row->created_at) }}
{{ $row->jumlah_fitur }} fitur @if ($row->jumlah_fitur > 0)@endif
    @forelse ($row->rincian as $grup => $item)
  • {{ $grup }} {{ $item['count'] }} fitur
  • @empty
  • Belum ada fitur aktif.
  • @endforelse
@if ($sudahTagihan)
{{ $rupiah($row->biaya_langganan) }}
@csrf
@else
@csrf
@endif
{{ $rupiah($maintenance) }} JJT {{ $tanggal($jatuhTempo) }} @if ($sudahTagihan)
@csrf
@endif
@if ($sudahTagihan) $row->status === 'lunas', 'bg-amber-50 text-amber-700' => $row->status !== 'lunas', ])>{{ strtoupper($row->status) }} @else Siap Ditagih @endif @if ($sudahTagihan) Total: {{ $rupiah($total) }} Sisa: {{ $rupiah($sisa) }} @else - @endif @if (! $sudahTagihan) — @elseif ($row->status !== 'lunas') @else Selesai @endif
Belum ada data PKBM.
@csrf

Input Pembayaran

@endsection @push('scripts') @endpush