diff --git a/src/pages/Customer/components/CustomerSummaryTable.vue b/src/pages/Customer/components/CustomerSummaryTable.vue index ff1474fb9..e9bb36be7 100644 --- a/src/pages/Customer/components/CustomerSummaryTable.vue +++ b/src/pages/Customer/components/CustomerSummaryTable.vue @@ -152,17 +152,20 @@ const setShippedColor = (date) => { }; const getItemPackagingType = (ticketSales) => { - if (!ticketSales || ticketSales.length === 0) return '-'; + if (!ticketSales?.length) return '-'; - const packagingTypes = ticketSales - .map((sale) => sale.item?.itemPackingTypeFk) - .filter((type) => type !== undefined && type !== null); + const packagingTypes = ticketSales.reduce((types, sale) => { + const { itemPackingTypeFk } = sale.item; + if ( + !types.includes(itemPackingTypeFk) && + (itemPackingTypeFk === 'H' || itemPackingTypeFk === 'V') + ) { + types.push(itemPackingTypeFk); + } + return types; + }, []); - const uniquePackagingTypes = [...new Set(packagingTypes)]; - - return dashIfEmpty( - uniquePackagingTypes.length > 0 ? uniquePackagingTypes.join(', ') : '-' - ); + return dashIfEmpty(packagingTypes.join(', ') || '-'); };