From 427c8aec341048f4ce95f12896d81ea303cc9002 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Wed, 14 Jan 2026 22:28:45 +0700 Subject: [PATCH] feat(FE): Join array fields into comma-separated strings --- .../finance/export/CustomerPaymentExportPDF.tsx | 12 ++++++++++-- .../pages/report/finance/tab/CustomerPaymentTab.tsx | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/pages/report/finance/export/CustomerPaymentExportPDF.tsx b/src/components/pages/report/finance/export/CustomerPaymentExportPDF.tsx index 71969e8a..9b1fd640 100644 --- a/src/components/pages/report/finance/export/CustomerPaymentExportPDF.tsx +++ b/src/components/pages/report/finance/export/CustomerPaymentExportPDF.tsx @@ -362,7 +362,11 @@ const createPDFDocument = (params: CustomerPaymentExportPDFParams) => { {item.reference || '-'} - {item.vehicle_numbers || '-'} + + {Array.isArray(item.vehicle_numbers) + ? item.vehicle_numbers.join(', ') + : item.vehicle_numbers || '-'} + {formatNumber(item.qty)} @@ -409,7 +413,11 @@ const createPDFDocument = (params: CustomerPaymentExportPDFParams) => { )} - {item.pickup_info || '-'} + + {Array.isArray(item.pickup_info) + ? item.pickup_info.join(', ') + : item.pickup_info || '-'} + {item.sales_person || '-'} diff --git a/src/components/pages/report/finance/tab/CustomerPaymentTab.tsx b/src/components/pages/report/finance/tab/CustomerPaymentTab.tsx index 18a8674a..78d84800 100644 --- a/src/components/pages/report/finance/tab/CustomerPaymentTab.tsx +++ b/src/components/pages/report/finance/tab/CustomerPaymentTab.tsx @@ -356,7 +356,7 @@ const CustomerPaymentTab = () => { enableSorting: false, cell: (props) => { const value = props.row.original.vehicle_numbers; - return value || '-'; + return Array.isArray(value) ? value.join(', ') : value || '-'; }, }, { @@ -520,7 +520,7 @@ const CustomerPaymentTab = () => { enableSorting: false, cell: (props) => { const value = props.row.original.pickup_info; - return value || '-'; + return Array.isArray(value) ? value.join(', ') : value || '-'; }, }, {