feat: add units/revenue toggle to Weekly Sales and improve traffic data parsing

This commit is contained in:
Christian Vidal Wolf
2026-02-19 16:03:16 +01:00
parent 31ad7fda21
commit 079e4130f7
82 changed files with 7961 additions and 30 deletions
+2 -2
View File
@@ -525,8 +525,8 @@ export const processTrafficExcel = async (fileOrBuffer: File | ArrayBuffer): Pro
let yearIdx = headers.findIndex((h: string) => h === 'year' || h === 'año');
let weekIdx = headers.findIndex((h: string) => h === 'week' || h === 'semana');
let asinIdx = headers.findIndex((h: string) => h === 'asin');
let countryIdx = headers.findIndex((h: string) => h === 'country' || h === 'país' || h === 'pais' || h === 'marketplace');
let gvIdx = headers.findIndex((h: string) => h.includes('glance') || h === 'gv' || h.includes('page view'));
let countryIdx = headers.findIndex((h: string) => h === 'country' || h === 'país' || h === 'pais' || h === 'marketplace' || h === 'store code');
let gvIdx = headers.findIndex((h: string) => h.includes('glance') || h === 'gv' || h.includes('page view') || h === 'featured offer page views');
// Fallback to positional mapping if headers not found
if (asinIdx === -1 || countryIdx === -1 || gvIdx === -1) {