fix: exportStatus mis à jour à 'exported' après validation BAP (unitaire et en masse)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user