category order
This commit is contained in:
@@ -420,7 +420,13 @@ const DailyPOSReport = () => {
|
||||
|
||||
<div className='space-y-12'>
|
||||
{Object.keys(groupedProducts)
|
||||
.sort()
|
||||
.sort((a, b) => {
|
||||
const productsA = groupedProducts[a]
|
||||
const productsB = groupedProducts[b]
|
||||
const orderA = productsA[0]?.category_order ?? 999
|
||||
const orderB = productsB[0]?.category_order ?? 999
|
||||
return orderA - orderB
|
||||
})
|
||||
.map(categoryName => {
|
||||
const categoryProducts = groupedProducts[categoryName]
|
||||
const categoryTotalQty = categoryProducts.reduce((sum, item) => sum + (item.quantity_sold || 0), 0)
|
||||
|
||||
Reference in New Issue
Block a user