@php function formatNumber($number) { // Check if the number has a decimal part if (floor($number) == $number) { // If it's a whole number, format without decimals return number_format($number, 0); } else { // If it has a decimal part, format with 2 decimal places return number_format($number, 2); } } @endphp
Yulia Mega Hasta                                                                                                     Payable Report
Dari Tanggal : {{ \Carbon\Carbon::parse($dari)->format('d-m-Y') }} Sampai Tanggal : {{ \Carbon\Carbon::parse($sampai)->format('d-m-Y') }}
@foreach($data as $sawal) @foreach($sawal->debts as $detail) @endforeach @endforeach
Supplier Code Supplier Name Document Number Document Date Due Date Total Debt Amount Paid Discount Debt Balance Payment Number
{{ $sawal->supplier_code }} {{ $sawal->supplier_name }} BEGINNING BALANCE {{ formatNumber($sawal->beginning_balance, 2) }}
{{ $sawal->supplier_code }} {{ $sawal->supplier_name }} {{ $detail->document_number }} {{ $detail->document_date }} {{ $detail->due_date }} {{ formatNumber($detail->total_debt, 2) }} {{ formatNumber($detail->{'Amount Paid'}, 2) }} {{ formatNumber($detail->discount, 2) }} {{ formatNumber($detail->debt_balance, 2) }} {{ $detail->payment_number }}
Dicetak oleh : {{ $username }}