From 1a09c98ef5cc0f61c447a0a8332b612c65ba3863 Mon Sep 17 00:00:00 2001 From: Manus Date: Tue, 16 Jun 2026 12:18:40 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20exportStatus=20mis=20=C3=A0=20jour=20?= =?UTF-8?q?=C3=A0=20'exported'=20apr=C3=A8s=20validation=20BAP=20(unitaire?= =?UTF-8?q?=20et=20en=20masse)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/routers.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/routers.ts b/server/routers.ts index 4d17d89..f0744e5 100644 --- a/server/routers.ts +++ b/server/routers.ts @@ -616,9 +616,11 @@ export const appRouter = router({ // ── Mise à jour de la facture ───────────────────────────────────── const validatedAt = new Date(); + const newExportStatus = (exportPath || pdfUrl) ? 'exported' : 'not_exported'; await updateInvoice(input.id, { bapValidated: 1, bapValidatedAt: validatedAt, + exportStatus: newExportStatus as any, }); // ── Enregistrement dans l'historique BAP ───────────────────────── @@ -816,7 +818,8 @@ export const appRouter = router({ console.warn(`[BAP Bulk] Erreur PDF facture ${invoice.id}:`, pdfError.message); } // Mise à jour de la facture - await updateInvoice(invoice.id, { bapValidated: 1, bapValidatedAt: validatedAt }); + const bulkExportStatus = (exportPath || pdfUrl) ? 'exported' : 'not_exported'; + await updateInvoice(invoice.id, { bapValidated: 1, bapValidatedAt: validatedAt, exportStatus: bulkExportStatus as any }); // Historique await createBapHistoryEntry({ userId: ctx.user.id,