From be762d8240ddf2c894d6b5e462168d2ac84d0911 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Tue, 4 Nov 2025 12:36:40 +0000 Subject: [PATCH] Update CSV export to use semicolons as separators for better Excel compatibility Modify the CSV generation logic in server/routes.ts to use semicolons (;) instead of tabs (\t) as delimiters. This change addresses issues with CSV files not being properly tab-delimited in certain spreadsheet applications, particularly in French locales, ensuring each row is correctly parsed. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 1e4433b5-47ab-464c-b663-fea2e53367dd Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 833028cc-a84a-4658-a40c-0a89da3920e8 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/1e4433b5-47ab-464c-b663-fea2e53367dd/WZFf6za --- server/routes.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/routes.ts b/server/routes.ts index 814a8ff..78cf794 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -589,8 +589,8 @@ export async function registerRoutes(app: Express): Promise { .filter((schedule: any) => validatedPaymentMethods.includes(schedule.paymentMethod)) .sort((a: any, b: any) => a.dueDate.getTime() - b.dueDate.getTime()); - // Générer le fichier CSV avec tabulations - console.log('📄 [EXPORT] Génération du fichier CSV avec tabulations...'); + // Générer le fichier CSV avec point-virgule (séparateur Excel France) + console.log('📄 [EXPORT] Génération du fichier CSV avec point-virgule...'); // Préparer les en-têtes const headers = ['Date d\'échéance', 'Fournisseur', 'Facture', 'Mode de paiement']; @@ -601,7 +601,7 @@ export async function registerRoutes(app: Express): Promise { const csvLines: string[] = []; // Ajouter la ligne d'en-tête - csvLines.push(headers.join('\t')); + csvLines.push(headers.join(';')); // Ajouter les données schedules.forEach((schedule: any) => { @@ -613,7 +613,7 @@ export async function registerRoutes(app: Express): Promise { ]; if (includeHT) row.push(schedule.amountHT.toFixed(2)); if (includeTTC) row.push(schedule.amountTTC.toFixed(2)); - csvLines.push(row.join('\t')); + csvLines.push(row.join(';')); }); // Calculer les totaux @@ -624,7 +624,7 @@ export async function registerRoutes(app: Express): Promise { const totalRow: string[] = ['', '', '', 'TOTAL']; if (includeHT) totalRow.push(totalHT.toFixed(2)); if (includeTTC) totalRow.push(totalTTC.toFixed(2)); - csvLines.push(totalRow.join('\t')); + csvLines.push(totalRow.join(';')); // Générer le contenu CSV avec BOM UTF-8 pour Excel const BOM = '\uFEFF';