mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 12:15:23 +02:00
Implement Custom Numeric Filtering (>10, 5-10) for Stock/WOC columns in Weekly Sales
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React, { useMemo, useState, useEffect, useCallback, useRef } from 'react';
|
||||
import * as XLSX from 'xlsx';
|
||||
import { CombinedKPIs } from '../types';
|
||||
import { pivotWeeklySalesData, WeeklyPivotRow, PAN_EU_COUNTRIES } from '../services/dataProcessor';
|
||||
import { pivotWeeklySalesData, WeeklyPivotRow, PAN_EU_COUNTRIES, checkNumericConditions } from '../services/dataProcessor';
|
||||
import { StockBadge } from './StockBadge';
|
||||
import { InColumnStockFilter } from './InColumnStockFilter';
|
||||
import { Top50Badge } from './Top50Badge';
|
||||
@@ -307,13 +307,7 @@ const WeeklyGrid: React.FC<WeeklyGridProps & { top50Mode: 'eu' | 'uk' }> = ({
|
||||
woc = 999;
|
||||
}
|
||||
|
||||
return wocFilter.some(f => {
|
||||
if (f === '< 4 Weeks') return woc < 4;
|
||||
if (f === '> 4 Weeks') return woc >= 4;
|
||||
if (f === 'Out of Stock') return woc === 0;
|
||||
if (f === 'Infinite Cover') return woc === 999;
|
||||
return true;
|
||||
});
|
||||
return checkNumericConditions(woc, wocFilter);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user