mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 13:25:23 +02:00
feat: add Week filter and Grid Growth % columns
This commit is contained in:
@@ -531,7 +531,12 @@ export const filterData = (data: SalesRecord[], filters: FilterState): SalesReco
|
||||
const skuMatch = filters.sku.length === 0 || filters.sku.includes(item.sku);
|
||||
const titleMatch = filters.title.length === 0 || filters.title.includes(item.title);
|
||||
|
||||
return customerMatch && yearMatch && monthMatch && lineMatch && asinMatch && skuMatch && titleMatch;
|
||||
// Week Logic: Match "W1", "W2" etc.
|
||||
// item.week is a number (e.g. 1), filter uses strings "W1"
|
||||
const weekStr = item.week ? `W${item.week}` : '';
|
||||
const weekMatch = filters.week.length === 0 || (weekStr !== '' && filters.week.includes(weekStr));
|
||||
|
||||
return customerMatch && yearMatch && monthMatch && lineMatch && asinMatch && skuMatch && titleMatch && weekMatch;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user