feat: use 'Stock conditionné' for Shopify stock on carrelage tabs

Priorité à Stock conditionné (boîtes) sur Stock (en pièce) si renseigné.
Colonne exclue des métachamps spécifiques.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-24 15:42:55 +02:00
parent 114e20c9fb
commit 6d8be0645d
+3 -2
View File
@@ -5,7 +5,7 @@ const COMMON_HEADERS = new Set([
'Description courte', 'Description longue', 'Description courte', 'Description longue',
'Date de début de promo', 'Date de fin de promo', 'Date de début de promo', 'Date de fin de promo',
'État de la TVA', 'Classe de TVA', 'En stock ?', 'État de la TVA', 'Classe de TVA', 'En stock ?',
'Stock (en pièce)', 'Vendre individuellement ?', 'Stock (en pièce)', 'Stock conditionné', 'Vendre individuellement ?',
'Prix marché', 'Prix remisé', 'Code ecopart', 'Ecopart montant', 'Prix marché', 'Prix remisé', 'Code ecopart', 'Ecopart montant',
'Famille', 'Sous famille', 'Famille', 'Sous famille',
"Classe d'expédition (en retrait, livraison)", "Classe d'expédition (en retrait, livraison)",
@@ -39,6 +39,7 @@ export function parseTabRows(tab: string, headers: string[], rows: string[][], d
nom: findColIndex(headers, 'Nom'), nom: findColIndex(headers, 'Nom'),
publie: findColIndex(headers, 'Publié'), publie: findColIndex(headers, 'Publié'),
stock: findColIndex(headers, 'Stock (en pièce)'), stock: findColIndex(headers, 'Stock (en pièce)'),
stockConditionne: findColIndex(headers, 'Stock conditionné'),
prixMarche: findColIndex(headers, 'Prix marché'), prixMarche: findColIndex(headers, 'Prix marché'),
prixRemise: findColIndex(headers, 'Prix remisé'), prixRemise: findColIndex(headers, 'Prix remisé'),
poids: findColIndex(headers, 'Poids (kg) fonction unité'), poids: findColIndex(headers, 'Poids (kg) fonction unité'),
@@ -65,7 +66,7 @@ export function parseTabRows(tab: string, headers: string[], rows: string[][], d
title: get(row, idx.nom), title: get(row, idx.nom),
priceMarket: get(row, idx.prixMarche).replace(',', '.'), priceMarket: get(row, idx.prixMarche).replace(',', '.'),
priceActual: get(row, idx.prixRemise).replace(',', '.'), priceActual: get(row, idx.prixRemise).replace(',', '.'),
stock: parseInt(get(row, idx.stock) || '0', 10) || 0, stock: parseInt(get(row, idx.stockConditionne) || get(row, idx.stock) || '0', 10) || 0,
weightKg: parseFloat(get(row, idx.poids).replace(',', '.') || '0') || 0, weightKg: parseFloat(get(row, idx.poids).replace(',', '.') || '0') || 0,
vendor: get(row, idx.marque), vendor: get(row, idx.marque),
famille: get(row, idx.famille), famille: get(row, idx.famille),