From f1ed22ff2267253be652cbf6923b7b72186e7d4c Mon Sep 17 00:00:00 2001 From: rstubryan Date: Fri, 9 Jan 2026 15:16:54 +0700 Subject: [PATCH] refactor(FE): Format numbers and currencies in payment XLSX --- .../export/CustomerPaymentExportXLSX.tsx | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/src/components/pages/report/finance/export/CustomerPaymentExportXLSX.tsx b/src/components/pages/report/finance/export/CustomerPaymentExportXLSX.tsx index dc999f3c..3cc4d67a 100644 --- a/src/components/pages/report/finance/export/CustomerPaymentExportXLSX.tsx +++ b/src/components/pages/report/finance/export/CustomerPaymentExportXLSX.tsx @@ -30,19 +30,19 @@ export const generateCustomerPaymentExcel = ( 'Tanggal Realisasi': item.realization_date ? formatDate(item.realization_date, 'DD MMM YYYY') : '', - Aging: item.aging || 0, + Aging: formatNumber(item.aging || 0), Referensi: item.reference || '', 'Nomor Polisi': item.vehicle_plate || '', - 'Ekor/Qty': item.qty || 0, - 'Berat (Kg)': item.weight || 0, - AVG: item.average_weight || 0, - 'Harga Awal': item.price || 0, - CN: item.credit_note || 0, - 'Harga Akhir': item.final_price || 0, - 'PPN (%)': item.ppn || 0, - Total: item.total || 0, - Pembayaran: item.payment || 0, - 'Saldo Piutang': item.accounts_receivable || 0, + 'Ekor/Qty': formatNumber(item.qty || 0), + 'Berat (Kg)': formatNumber(item.weight || 0), + AVG: formatNumber(item.average_weight || 0), + 'Harga Awal': formatCurrency(item.price || 0), + CN: formatCurrency(item.credit_note || 0), + 'Harga Akhir': formatCurrency(item.final_price || 0), + 'PPN (%)': formatNumber(item.ppn || 0), + Total: formatCurrency(item.total || 0), + Pembayaran: formatCurrency(item.payment || 0), + 'Saldo Piutang': formatCurrency(item.accounts_receivable || 0), Keterangan: item.notes || '', Pengambilan: item.pickup_info || '', 'Sales/Marketing': item.sales_marketing || '', @@ -57,16 +57,22 @@ export const generateCustomerPaymentExcel = ( Aging: '', Referensi: '', 'Nomor Polisi': '', - 'Ekor/Qty': customerReport.summary.total_qty || 0, - 'Berat (Kg)': customerReport.summary.total_weight || 0, + 'Ekor/Qty': formatNumber(customerReport.summary.total_qty || 0), + 'Berat (Kg)': formatNumber(customerReport.summary.total_weight || 0), AVG: '', - 'Harga Awal': customerReport.summary.total_initial_amount || 0, - CN: customerReport.summary.total_credit_note || 0, - 'Harga Akhir': customerReport.summary.total_final_amount || 0, + 'Harga Awal': formatCurrency( + customerReport.summary.total_initial_amount || 0 + ), + CN: formatCurrency(customerReport.summary.total_credit_note || 0), + 'Harga Akhir': formatCurrency( + customerReport.summary.total_final_amount || 0 + ), 'PPN (%)': '', - Total: customerReport.summary.total_grand_amount || 0, - Pembayaran: customerReport.summary.total_payment || 0, - 'Saldo Piutang': customerReport.summary.total_accounts_receivable || 0, + Total: formatCurrency(customerReport.summary.total_grand_amount || 0), + Pembayaran: formatCurrency(customerReport.summary.total_payment || 0), + 'Saldo Piutang': formatCurrency( + customerReport.summary.total_accounts_receivable || 0 + ), Keterangan: '', Pengambilan: '', 'Sales/Marketing': '',