Checkpoint: Les exportations PDF manuelles résolvent désormais une destination facture par facture via les règles actives d’Automatismes d’export, y compris pour les factures d’abonnement. Les paramètres globaux demeurent le repli ; les destinations Teams et SharePoint utilisent l’envoi Microsoft existant. Suite complète : 56 tests, TypeScript et build validés.
All checks were successful
Validation applicative / TypeScript, tests et build (push) Successful in 3m6s
All checks were successful
Validation applicative / TypeScript, tests et build (push) Successful in 3m6s
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { findMatchingExportRule } from "../shared/exportAutomation";
|
||||
|
||||
const rules = [
|
||||
@@ -23,4 +25,15 @@ describe("règles de destination d’export", () => {
|
||||
it("ne retourne aucune règle si la facture ne correspond à aucun critère", () => {
|
||||
expect(findMatchingExportRule(rules, { recipientName: "Service achats", ventilationComptable: "606000" })).toBeUndefined();
|
||||
});
|
||||
|
||||
it("applique aussi le résolveur de destination aux exports PDF de factures sélectionnées", () => {
|
||||
const routerSource = readFileSync(join(process.cwd(), "server", "routers.ts"), "utf8");
|
||||
const exportPdfSection = routerSource.slice(
|
||||
routerSource.indexOf("exportToPdf: protectedProcedure"),
|
||||
routerSource.indexOf("exportInvoices: protectedProcedure"),
|
||||
);
|
||||
|
||||
expect(exportPdfSection).toContain("resolveBapExportDestination(ctx.user.id, invoice, settings)");
|
||||
expect(exportPdfSection).toContain("isMicrosoftDestination");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user