diff --git a/src/components/ProductDescriptions.tsx b/src/components/ProductDescriptions.tsx index 04a157a..7afe6c2 100644 --- a/src/components/ProductDescriptions.tsx +++ b/src/components/ProductDescriptions.tsx @@ -76,11 +76,11 @@ export function ProductDescriptions({ data, onEdit }: ProductDescriptionsProps) }; const getRowColor = (row: ExcelRow) => { - // EOL Rule: OOC Classification and 0 stock (Item Available) - const classification = String(row[COLUMNS.CLASSIFICATION] || '').toUpperCase(); + // EOL Rule: OOC Classification and 0 or negative stock (Item Available) + const classification = String(row[COLUMNS.CLASSIFICATION] || '').toUpperCase().trim(); const stock = Number(row[COLUMNS.ITEM_AVAILABLE] || 0); - if (classification === 'OOC' && stock === 0) { + if (classification === 'OOC' && stock <= 0) { return 'bg-yellow-500/10 hover:bg-yellow-500/20'; // EOL Highlight } @@ -94,11 +94,11 @@ export function ProductDescriptions({ data, onEdit }: ProductDescriptionsProps) const Badge = ({ content, row }: { content: any, row: ExcelRow }) => { if (content) return ; - // EOL Exception - const classification = String(row[COLUMNS.CLASSIFICATION] || '').toUpperCase(); + // EOL Exception: OOC and stock <= 0 + const classification = String(row[COLUMNS.CLASSIFICATION] || '').toUpperCase().trim(); const stock = Number(row[COLUMNS.ITEM_AVAILABLE] || 0); - if (classification === 'OOC' && stock === 0) { + if (classification === 'OOC' && stock <= 0) { return EOL not neccessary; }