@php function penyebut($nilai) { $nilai = abs($nilai); $huruf = [ '', 'satu', 'dua', 'tiga', 'empat', 'lima', 'enam', 'tujuh', 'delapan', 'sembilan', 'sepuluh', 'sebelas', ]; $temp = ''; if ($nilai < 12) { $temp = ' ' . $huruf[$nilai]; } elseif ($nilai < 20) { $temp = penyebut($nilai - 10) . ' belas'; } elseif ($nilai < 100) { $temp = penyebut($nilai / 10) . ' puluh' . penyebut($nilai % 10); } elseif ($nilai < 200) { $temp = ' seratus' . penyebut($nilai - 100); } elseif ($nilai < 1000) { $temp = penyebut($nilai / 100) . ' ratus' . penyebut($nilai % 100); } elseif ($nilai < 2000) { $temp = ' seribu' . penyebut($nilai - 1000); } elseif ($nilai < 1000000) { $temp = penyebut($nilai / 1000) . ' ribu' . penyebut($nilai % 1000); } elseif ($nilai < 1000000000) { $temp = penyebut($nilai / 1000000) . ' juta' . penyebut($nilai % 1000000); } elseif ($nilai < 1000000000000) { $temp = penyebut($nilai / 1000000000) . ' milyar' . penyebut(fmod($nilai, 1000000000)); } elseif ($nilai < 1000000000000000) { $temp = penyebut($nilai / 1000000000000) . ' trilyun' . penyebut(fmod($nilai, 1000000000000)); } return $temp; } function terbilang($nilai) { if ($nilai < 0) { $hasil = 'minus ' . trim(penyebut($nilai)); } else { $hasil = trim(penyebut($nilai)); } return $hasil; } @endphp
No. | Nama Penginap | Tanggal Masuk | Tanggal Keluar | Retribusi (Rp) | Keterangan |
---|---|---|---|---|---|
{{ $i + 1 }} | {{ $detail->guest_name }} | {{ \Carbon\Carbon::parse($detail->checkin)->format('d M Y') }} | {{ $detail->checkout ? \Carbon\Carbon::parse($detail->checkout)->format('d M Y') : '-' }} | {{ number_format($detail->grand_total, 0, ',', '.') }} | {{ $detail->description }} |
Jumlah | {{ number_format($data->grand_total, 0, ',', '.') }} | ||||
Terbilang | {{ ucwords(terbilang($data->grand_total)) }} Rupiah |
{{ $data->hotel->kota ? $data->hotel->kota->name : '-' }},
{{ \Carbon\Carbon::now()->translatedFormat('d F Y') }} PENGURUS {{ strtoupper($data->hotel->name) }} ___________________________ |