WFDASH-WEBAPP/src
Dave cb3f1618c4 feat(invoicing): split delivery-note PDF lines for non-invoiceable rows
Task 7 of the non-invoiceable-order-extras plan.

The status flip + audit stamp + delivery_note header create all
run on EVERY row so the order closes normally — excluded rows are
real operational lines from the supplier's POV. The PDF line
list is built from billable.items only, so the customer never
sees excluded lines.

Added exclude_from_invoice to the getFullList projection (load-
bearing — omit it and the billable filter silently passes
undefined, every extra lands on the customer delivery note).

New 400 guard 'No billable lines for a delivery note' when every
row in the request is excluded. UI guard in Task 6 prevents the
operator from reaching this path, but the route has its own
defence so the picker doesn't get a guaranteed-to-fail submit
silently.

2 tests + 1 mutation-test prove the split:
- excluded rows still get status flip + DN number + PDF upload,
  but the renderer is called with ONLY billable items
- all-excluded returns 400 before any PATCH fires
- mutation (PDF built from items): the mixed test fails because
  the renderer sees 3 lines instead of 2

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-30 17:35:15 +02:00
..
app feat(invoicing): split delivery-note PDF lines for non-invoiceable rows 2026-08-30 17:35:15 +02:00
components feat(orders): add shared quote-line context component 2026-08-30 12:20:39 +02:00
lib feat(orders): bypass margin gate for non-invoiceable extras 2026-08-30 17:21:28 +02:00
styles
middleware.ts feat(tv): add TV dashboard + refine workflows 2026-08-13 20:55:22 +02:00
test-setup.ts