feat(FE): Join array fields into comma-separated strings

This commit is contained in:
rstubryan
2026-01-14 22:28:45 +07:00
parent f1dba4012a
commit 427c8aec34
2 changed files with 12 additions and 4 deletions
@@ -362,7 +362,11 @@ const createPDFDocument = (params: CustomerPaymentExportPDFParams) => {
<Text>{item.reference || '-'}</Text>
</View>
<View style={[pdfStyles.tableCell, { flex: 1.2 }]}>
<Text>{item.vehicle_numbers || '-'}</Text>
<Text>
{Array.isArray(item.vehicle_numbers)
? item.vehicle_numbers.join(', ')
: item.vehicle_numbers || '-'}
</Text>
</View>
<View style={[pdfStyles.tableCellRight, { flex: 0.8 }]}>
<Text>{formatNumber(item.qty)}</Text>
@@ -409,7 +413,11 @@ const createPDFDocument = (params: CustomerPaymentExportPDFParams) => {
)}
</View>
<View style={[pdfStyles.tableCell, { flex: 1 }]}>
<Text>{item.pickup_info || '-'}</Text>
<Text>
{Array.isArray(item.pickup_info)
? item.pickup_info.join(', ')
: item.pickup_info || '-'}
</Text>
</View>
<View style={[pdfStyles.tableCell, { flex: 1.5 }]}>
<Text>{item.sales_person || '-'}</Text>
@@ -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 || '-';
},
},
{