@extends('layouts.master') @section('title', 'Laporan Rekap Tagihan Wilayah Bulanan') @section('page-title', 'Laporan Rekap Tagihan Kecamatan/Desa per Bulan') @section('content')

Rekap Tagihan Wilayah Bulanan

Periode {{ $periodeLabel }}.
Kembali ke Dashboard
Reset
Total Tagihan
Rp {{ number_format($grand['total_tagihan'] ?? 0, 0, ',', '.') }}
Lunas / Terbayar
Rp {{ number_format($grand['total_terbayar'] ?? 0, 0, ',', '.') }}
Sisa Tagihan
Rp {{ number_format($grand['total_sisa'] ?? 0, 0, ',', '.') }}
Pelanggan Aktif Ditagih
{{ number_format($grand['jumlah_pelanggan'] ?? 0, 0, ',', '.') }}
@forelse ($rows as $kecamatan => $kecData) @php $kecTotal = $kecData['total'] ?? []; $kecRasio = (float) ($kecTotal['total_tagihan'] ?? 0) > 0 ? ((float) ($kecTotal['total_terbayar'] ?? 0) / (float) ($kecTotal['total_tagihan'] ?? 0)) * 100 : 0; $kecJumlahTagihan = (int) ($kecTotal['jumlah_tagihan'] ?? 0); $kecJumlahLunas = (int) ($kecTotal['jumlah_lunas'] ?? 0); $kecJumlahSisa = max(0, $kecJumlahTagihan - $kecJumlahLunas); @endphp @foreach ($kecData['desa'] as $desa => $desaData) @php $desaRasio = (float) ($desaData['total_tagihan'] ?? 0) > 0 ? ((float) ($desaData['total_terbayar'] ?? 0) / (float) ($desaData['total_tagihan'] ?? 0)) * 100 : 0; $detailId = 'desa-detail-' . substr(md5($kecamatan . '|' . $desa), 0, 12); $desaJumlahTagihan = (int) ($desaData['jumlah_tagihan'] ?? 0); $desaJumlahLunas = (int) ($desaData['jumlah_lunas'] ?? 0); $desaJumlahSisa = max(0, $desaJumlahTagihan - $desaJumlahLunas); @endphp @endforeach @empty @endforelse @if (count($rows)) @php $grandRasio = (float) ($grand['total_tagihan'] ?? 0) > 0 ? ((float) ($grand['total_terbayar'] ?? 0) / (float) ($grand['total_tagihan'] ?? 0)) * 100 : 0; $grandJumlahTagihan = (int) ($grand['jumlah_tagihan'] ?? 0); $grandJumlahLunas = (int) ($grand['jumlah_lunas'] ?? 0); $grandJumlahSisa = max(0, $grandJumlahTagihan - $grandJumlahLunas); @endphp @endif
Kecamatan / Desa Pelanggan Jml Tagihan Total Lunas Sisa Rasio Lunas
{{ $kecamatan }} {{ number_format($kecTotal['jumlah_pelanggan'] ?? 0, 0, ',', '.') }} {{ number_format($kecTotal['jumlah_tagihan'] ?? 0, 0, ',', '.') }} {{ number_format($kecTotal['total_tagihan'] ?? 0, 0, ',', '.') }} {{ number_format($kecTotal['total_terbayar'] ?? 0, 0, ',', '.') }} ({{ number_format($kecJumlahLunas, 0, ',', '.') }}) {{ number_format($kecTotal['total_sisa'] ?? 0, 0, ',', '.') }} ({{ number_format($kecJumlahSisa, 0, ',', '.') }}) {{ number_format($kecRasio, 1, ',', '.') }}%
- {{ $desa }} {{ number_format($desaData['jumlah_pelanggan'] ?? 0, 0, ',', '.') }} {{ number_format($desaData['jumlah_tagihan'] ?? 0, 0, ',', '.') }} {{ number_format($desaData['total_tagihan'] ?? 0, 0, ',', '.') }} {{ number_format($desaData['total_terbayar'] ?? 0, 0, ',', '.') }} ({{ number_format($desaJumlahLunas, 0, ',', '.') }}) {{ number_format($desaData['total_sisa'] ?? 0, 0, ',', '.') }} ({{ number_format($desaJumlahSisa, 0, ',', '.') }}) {{ number_format($desaRasio, 1, ',', '.') }}%
Detail pelanggan di {{ $desa }}
@forelse (($desaData['pelanggan'] ?? []) as $pel) @php $pelSisa = (float) ($pel['total_sisa'] ?? 0); $pelLunas = $pelSisa <= 0 && (float) ($pel['total_tagihan'] ?? 0) > 0; @endphp @empty @endforelse
Pelanggan Tagihan Total Lunas Sisa Status
{{ $pel['nama'] ?? '-' }}
{{ $pel['kode'] ?? '-' }}
{{ number_format($pel['jumlah_tagihan'] ?? 0, 0, ',', '.') }} {{ number_format($pel['total_tagihan'] ?? 0, 0, ',', '.') }} {{ number_format($pel['total_terbayar'] ?? 0, 0, ',', '.') }} {{ number_format($pelSisa, 0, ',', '.') }} {{ $pelLunas ? 'Lunas' : 'Belum Lunas' }}
Tidak ada detail pelanggan.
Belum ada data tagihan untuk periode ini.
TOTAL {{ number_format($grand['jumlah_pelanggan'] ?? 0, 0, ',', '.') }} {{ number_format($grand['jumlah_tagihan'] ?? 0, 0, ',', '.') }} {{ number_format($grand['total_tagihan'] ?? 0, 0, ',', '.') }} {{ number_format($grand['total_terbayar'] ?? 0, 0, ',', '.') }} ({{ number_format($grandJumlahLunas, 0, ',', '.') }}) {{ number_format($grand['total_sisa'] ?? 0, 0, ',', '.') }} ({{ number_format($grandJumlahSisa, 0, ',', '.') }}) {{ number_format($grandRasio, 1, ',', '.') }}%
@endsection @section('scripts') @endsection