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
+10 -8
View File
@@ -2260,14 +2260,16 @@ export const processBuyBoxExcel = async (fileOrBuffer: File | ArrayBuffer): Prom
});
}
// Fallback to previous hardcoded indices if header search fails
if (reasonIdx === -1) {
if (config.country === 'FR') reasonIdx = 18;
else if (config.country === 'UK') reasonIdx = 9;
else if (config.country === 'DE') reasonIdx = 13;
else if (config.country === 'IT') reasonIdx = 12;
else if (config.country === 'ES') reasonIdx = 13;
else reasonIdx = 13;
// Fallback to previous hardcoded indices if header search fails or for specific known sheet structures
if (reasonIdx === -1 || (config.country === 'FR' && reasonIdx !== 18)) {
if (config.country === 'FR') reasonIdx = 18; // Force Column S for FR
else if (reasonIdx === -1) {
if (config.country === 'UK') reasonIdx = 9;
else if (config.country === 'DE') reasonIdx = 13;
else if (config.country === 'IT') reasonIdx = 12;
else if (config.country === 'ES') 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'}")`);