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> <Text>{item.reference || '-'}</Text>
</View> </View>
<View style={[pdfStyles.tableCell, { flex: 1.2 }]}> <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>
<View style={[pdfStyles.tableCellRight, { flex: 0.8 }]}> <View style={[pdfStyles.tableCellRight, { flex: 0.8 }]}>
<Text>{formatNumber(item.qty)}</Text> <Text>{formatNumber(item.qty)}</Text>
@@ -409,7 +413,11 @@ const createPDFDocument = (params: CustomerPaymentExportPDFParams) => {
)} )}
</View> </View>
<View style={[pdfStyles.tableCell, { flex: 1 }]}> <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>
<View style={[pdfStyles.tableCell, { flex: 1.5 }]}> <View style={[pdfStyles.tableCell, { flex: 1.5 }]}>
<Text>{item.sales_person || '-'}</Text> <Text>{item.sales_person || '-'}</Text>
@@ -356,7 +356,7 @@ const CustomerPaymentTab = () => {
enableSorting: false, enableSorting: false,
cell: (props) => { cell: (props) => {
const value = props.row.original.vehicle_numbers; const value = props.row.original.vehicle_numbers;
return value || '-'; return Array.isArray(value) ? value.join(', ') : value || '-';
}, },
}, },
{ {
@@ -520,7 +520,7 @@ const CustomerPaymentTab = () => {
enableSorting: false, enableSorting: false,
cell: (props) => { cell: (props) => {
const value = props.row.original.pickup_info; const value = props.row.original.pickup_info;
return value || '-'; return Array.isArray(value) ? value.join(', ') : value || '-';
}, },
}, },
{ {