@extends('layouts.apex') @php // Helper function to format currency with rounding (no decimals) function formatCurrencyRound($number) { if ($number === null || $number === '' || !is_numeric($number)) { return 'Rp 0'; } // Round to nearest integer, then format $rounded = round($number); return 'Rp ' . number_format($rounded, 0, ',', '.'); } // Helper function to format large numbers in short format (Rb, Jt, M, T) function formatLargeNumberRp($number) { if ($number === null || $number === '' || !is_numeric($number)) { return 'Rp 0'; } // Round to nearest integer first $num = round(abs($number)); $sign = $number < 0 ? '-' : ''; $formatted = ''; if ($num >= 1000000000000) { // Triliun $formatted = $sign . 'Rp ' . number_format($num / 1000000000000, 2, ',', '.') . ' T'; } elseif ($num >= 1000000000) { // Miliar $formatted = $sign . 'Rp ' . number_format($num / 1000000000, 2, ',', '.') . ' M'; } elseif ($num >= 1000000) { // Juta $formatted = $sign . 'Rp ' . number_format($num / 1000000, 2, ',', '.') . ' Jt'; } elseif ($num >= 1000) { // Ribu $formatted = $sign . 'Rp ' . number_format($num / 1000, 2, ',', '.') . ' Rb'; } else { $formatted = 'Rp ' . number_format($num, 0, ',', '.'); } return $formatted; } @endphp @section('title', 'Piutang') @section('content')
Sisa Piutang
{{ formatCurrencyRound($summary->total_sisa ?? 0) }}
Riwayat Piutang
No. Bukti Tanggal Customer Keterangan Total Tagihan Total Bayar Sisa Aksi
@push('scripts') @endpush @endsection