diff --git a/src/pages/Customer/components/CustomerSummaryTable.vue b/src/pages/Customer/components/CustomerSummaryTable.vue index f6013dea9..e9bb36be7 100644 --- a/src/pages/Customer/components/CustomerSummaryTable.vue +++ b/src/pages/Customer/components/CustomerSummaryTable.vue @@ -101,7 +101,7 @@ const columns = computed(() => [ align: 'left', name: 'itemPackingTypeFk', label: t('ticketSale.packaging'), - format: (row) => getItemPackagingType(row), + format: (row) => getItemPackagingType(row.ticketSales), }, { align: 'right', @@ -151,13 +151,21 @@ const setShippedColor = (date) => { if (difference < 0) return 'success'; }; -const getItemPackagingType = (row) => { - const packagingType = row?.ticketSales - .map((sale) => sale.item?.itemPackingTypeFk || '-') - .filter((value) => value !== '-') - .join(', '); +const getItemPackagingType = (ticketSales) => { + if (!ticketSales?.length) return '-'; - return dashIfEmpty(packagingType); + const packagingTypes = ticketSales.reduce((types, sale) => { + const { itemPackingTypeFk } = sale.item; + if ( + !types.includes(itemPackingTypeFk) && + (itemPackingTypeFk === 'H' || itemPackingTypeFk === 'V') + ) { + types.push(itemPackingTypeFk); + } + return types; + }, []); + + return dashIfEmpty(packagingTypes.join(', ') || '-'); };