update report
This commit is contained in:
parent
aae1d49721
commit
ead773982a
@ -302,7 +302,7 @@ const DailyPOSReport = () => {
|
||||
|
||||
pdf.setFontSize(PDF_FONT_SIZES.heading)
|
||||
pdf.text('Ringkasan Item Per Kategori', 14, currentY)
|
||||
currentY += 15
|
||||
currentY += 10
|
||||
|
||||
// Loop through each category
|
||||
Object.keys(groupedProducts)
|
||||
@ -314,7 +314,12 @@ const DailyPOSReport = () => {
|
||||
return orderA - orderB
|
||||
})
|
||||
.forEach(categoryName => {
|
||||
const categoryProducts = groupedProducts[categoryName]
|
||||
const categoryProducts = groupedProducts[categoryName].sort((a, b) => {
|
||||
// Sort by product_sku ASC
|
||||
const skuA = a.product_sku || ''
|
||||
const skuB = b.product_sku || ''
|
||||
return skuA.localeCompare(skuB)
|
||||
})
|
||||
const categoryTotalQty = categoryProducts.reduce((sum, item) => sum + (item.quantity_sold || 0), 0)
|
||||
const categoryTotalRevenue = categoryProducts.reduce((sum, item) => sum + (item.revenue || 0), 0)
|
||||
|
||||
@ -646,7 +651,12 @@ const DailyPOSReport = () => {
|
||||
return orderA - orderB
|
||||
})
|
||||
.map((categoryName, catIndex) => {
|
||||
const categoryProducts = groupedProducts[categoryName]
|
||||
const categoryProducts = groupedProducts[categoryName].sort((a, b) => {
|
||||
// Sort by product_sku ASC
|
||||
const skuA = a.product_sku || ''
|
||||
const skuB = b.product_sku || ''
|
||||
return skuA.localeCompare(skuB)
|
||||
})
|
||||
const categoryTotalQty = categoryProducts.reduce((sum, item) => sum + (item.quantity_sold || 0), 0)
|
||||
const categoryTotalRevenue = categoryProducts.reduce((sum, item) => sum + (item.revenue || 0), 0)
|
||||
|
||||
|
||||
@ -6,8 +6,8 @@ const getToken = () => {
|
||||
}
|
||||
|
||||
export const api = axios.create({
|
||||
baseURL: 'https://api-pos.apskel.id/api/v1',
|
||||
// baseURL: 'http://127.0.0.1:4000/api/v1',
|
||||
// baseURL: 'https://api-pos.apskel.id/api/v1',
|
||||
baseURL: 'http://127.0.0.1:4000/api/v1',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
|
||||
@ -31,6 +31,7 @@ export interface SalesReport {
|
||||
export interface ProductData {
|
||||
product_id: string
|
||||
product_name: string
|
||||
product_sku: string
|
||||
category_id: string
|
||||
category_name: string
|
||||
category_order: number
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user