refactor(invoicing): remove intermediate trimmedOverride variable

This commit is contained in:
Dave 2026-08-14 11:25:10 +02:00
parent 999948861e
commit 541676dabb
2 changed files with 3 additions and 1 deletions

View file

@ -211,6 +211,9 @@ describe("InvoicingPage", () => {
stockBookingsListMock.mockReset();
stockBookingsListMock.mockResolvedValue(buildPageResult([], 1, 100));
process.env.NEXT_PUBLIC_QB_INVOICE_WEBHOOK_URL = "https://n8n.test/webhook/invoice";
// Auto-accept the order-number sanity confirm dialog by default.
// Individual tests can override this with their own spy.
vi.spyOn(window, "confirm").mockReturnValue(true);
});
afterEach(() => {

View file

@ -1995,7 +1995,6 @@ export default function InvoicingPage() {
// the order number for convenience, so this trim keeps the
// default-no-fuss UX while letting an explicit number pass
// through when the operator actually wants one.
const trimmedOverride = payload.orderNumberOverride?.trim() ?? "";
const explicitDeliveryNoteNumber =
trimmedOverride && trimmedOverride !== group.orderNumber
? trimmedOverride