mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 12:15:23 +02:00
debug: Add Spain-specific sheet fallbacks and expose Buy Box data to window.debugBuyBox
This commit is contained in:
@@ -2168,8 +2168,16 @@ export const processBuyBoxExcel = async (fileOrBuffer: File | ArrayBuffer): Prom
|
||||
const sheetName = workbook.SheetNames.find(name => {
|
||||
const n = name.toUpperCase().replace(/[-_ ]/g, '');
|
||||
const target = config.sheet.toUpperCase().replace(/[-_ ]/g, '');
|
||||
// Also match if the sheet is just the country code or contains 'BB' and the country code
|
||||
return n === target || n === config.country || (n.includes('BB') && n.includes(config.country));
|
||||
const country = config.country.toUpperCase();
|
||||
// Match if:
|
||||
// 1. Exact pattern (BB_ES)
|
||||
// 2. Just the country code (ES)
|
||||
// 3. Contains 'BB' and the country code
|
||||
// 4. Special cases for Spain (SPAIN, ESPAÑA)
|
||||
return n === target ||
|
||||
n === country ||
|
||||
(n.includes('BB') && n.includes(country)) ||
|
||||
(country === 'ES' && (n.includes('SPAIN') || n.includes('ESPAÑA') || n.includes('ESPANA')));
|
||||
});
|
||||
|
||||
if (!sheetName) {
|
||||
|
||||
Reference in New Issue
Block a user