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,