From adf72f6f96f232d99d2016946a4c8bab1806c45e Mon Sep 17 00:00:00 2001 From: Christian Vidal Wolf Date: Thu, 16 Apr 2026 11:41:58 +0200 Subject: [PATCH] fix: restore sales visibility by normalizing marketplace names in Sales pipeline --- services/dataProcessor.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/dataProcessor.ts b/services/dataProcessor.ts index 237f3a6..ccff8e1 100644 --- a/services/dataProcessor.ts +++ b/services/dataProcessor.ts @@ -344,7 +344,8 @@ export const validateSellOutHeaders = (headers: string[]) => { const mapRowToRecord = (row: any, index: number): SalesRecord => { // Add exact matches to the front of getColumnValue arrays - const customer = getColumnValue(row, ['NEW CUSTOMER', 'COUNTRY', 'Customer', 'Client', 'Account', 'Partner', 'Country', 'Market']) || 'Unknown'; + const rawCustomer = getColumnValue(row, ['NEW CUSTOMER', 'COUNTRY', 'Customer', 'Client', 'Account', 'Partner', 'Country', 'Market']) || 'Unknown'; + const customer = mapCountryToMarketplace(rawCustomer); const yearStr = getColumnValue(row, ['YEAR', 'Year', 'D']); // Sanitize year string before parsing (remove commas/dots e.g. "2,023") let year = parseInt(yearStr.replace(/[,.]/g, '')) || 0; @@ -453,6 +454,7 @@ export const processExcel = async (file: File): Promise => { const mapCountryToMarketplace = (country: string): string => { const c = String(country).toLowerCase().trim(); + if (c === 'pan-eu' || c === 'paneu') return 'Pan-EU'; if (c.includes('germany') || c.includes('deutschland') || c.includes('de')) return 'Amazon DE'; if (c.includes('spain') || c.includes('espana') || c.includes('espaƱa') || c.includes('es')) return 'Amazon ES'; if (c.includes('france') || c.includes('fr')) return 'Amazon FR';