fix: force Column S for BB_FR reason column

This commit is contained in:
Christian Vidal Wolf
2026-02-06 10:50:18 +01:00
parent 86547bdf0d
commit 76193fb9bf
+6 -4
View File
@@ -2260,15 +2260,17 @@ export const processBuyBoxExcel = async (fileOrBuffer: File | ArrayBuffer): Prom
}); });
} }
// Fallback to previous hardcoded indices if header search fails // Fallback to previous hardcoded indices if header search fails or for specific known sheet structures
if (reasonIdx === -1) { if (reasonIdx === -1 || (config.country === 'FR' && reasonIdx !== 18)) {
if (config.country === 'FR') reasonIdx = 18; if (config.country === 'FR') reasonIdx = 18; // Force Column S for FR
else if (config.country === 'UK') reasonIdx = 9; else if (reasonIdx === -1) {
if (config.country === 'UK') reasonIdx = 9;
else if (config.country === 'DE') reasonIdx = 13; else if (config.country === 'DE') reasonIdx = 13;
else if (config.country === 'IT') reasonIdx = 12; else if (config.country === 'IT') reasonIdx = 12;
else if (config.country === 'ES') reasonIdx = 13; else if (config.country === 'ES') reasonIdx = 13;
else reasonIdx = 13; else reasonIdx = 13;
} }
}
console.log(`[BuyBox] Sheet "${sheetName}" (Country: ${config.country}): HeaderRow=${headerRowIdx}, ASIN Col=${finalAsinIdx} ("${headers[finalAsinIdx]}"), Reason Col=${reasonIdx} ("${headers[reasonIdx] || 'N/A'}")`); console.log(`[BuyBox] Sheet "${sheetName}" (Country: ${config.country}): HeaderRow=${headerRowIdx}, ASIN Col=${finalAsinIdx} ("${headers[finalAsinIdx]}"), Reason Col=${reasonIdx} ("${headers[reasonIdx] || 'N/A'}")`);
if (config.country === 'ES') { if (config.country === 'ES') {