Invoices — Test Cases
Manual acceptance test cases for the invoice flows. See Invoices concept and the invoice guides for context.
TC-INV-001 — Feature flag toggles invoice surface area
Verifies: Invoices concept
Preconditions:
- Logged in as Admin.
- Tenant setting
feature_flag_invoices_enabledis initially on.
Steps:
- Confirm the Invoices menu item is visible in the top navigation bar.
- Navigate to Settings and turn
feature_flag_invoices_enabledoff. - Reload.
Expected:
- The Invoices menu disappears from the top navigation bar.
- Direct navigation to
/admin/invoicesreturns a 404. - The Invoice card on a completed work order does not show a Create Invoice button.
- Reset the setting to on at the end of the test.
TC-INV-002 — Create an invoice from a single completed work order
Verifies: Create an Invoice
Preconditions:
- Logged in as Office (with
invoices.create). - Invoices feature flag is on.
- A completed work order exists with line items totaling
$500(use TC-WO-007).
Steps:
- Navigate to Work Orders and open the completed work order.
- In the Invoice card on the right, select Create Invoice.
- Leave Include unit price on. Confirm the Tax Rate (%) is the tenant default.
- Confirm the Grand Total matches the items subtotal plus the device-model unit cost plus tax.
- Select Create Invoice.
Expected:
- Invoice is created with status
sentand aninvoice_idusing the configured prefix (defaultTFT). - The Invoice card on the work order updates to show the invoice number, breakdown, and a Cancel Invoice button.
- The work order's status is unchanged by invoicing — to mark it
billed, a supervisor uses the separate Mark as Billed action. - Editing the original work order's line items afterward does not change the invoice totals (
unit_subtotalanditem_subtotalare snapshotted at create time).
TC-INV-003 — Tax-exempt customer: zero tax produces matching subtotals
Verifies: Create an Invoice, Invoices concept
Preconditions:
- Logged in as Office (with
invoices.create). - A completed work order exists for a tax-exempt customer with line items totaling
$500.
Steps:
- Open the completed work order.
- In the Invoice card, select Create Invoice.
- Toggle Include unit price off.
- Set Tax Rate (%) to
0. - Confirm the breakdown shows Unit Subtotal
$0.00, Items Subtotal$500.00, both VAT lines$0.00, Grand Total$500.00. - Select Create Invoice.
Expected:
- Invoice is created with status
sent,unit_subtotal0,item_subtotal500,tax_rate0. - The Invoice card now shows the invoice number and a Cancel Invoice button.
- A second attempt to create an invoice on this work order fails with "An invoice already exists for this work order." (active-invoice protection).
TC-INV-004 — Cancel an unpaid invoice unblocks re-invoicing
Verifies: Cancel an Invoice, Invoices concept
Preconditions:
- A
sent(unpaid) invoice exists from TC-INV-002. - Logged in as Office (with
invoices.edit). - The connected billing system (CaribeEats) is reachable.
Steps:
- Open the work order that has the invoice.
- In the Invoice card, select the red Cancel Invoice button.
- Confirm when prompted.
Expected:
- Invoice status moves to
cancelled, andcancelled_atis recorded. - The cancellation is mirrored to the connected billing system (verify a corresponding cancellation log entry).
- The work order's status is unchanged (still
completedorbilled— invoicing does not flip it back). - The cancelled invoice remains visible in the Invoices list with a
Cancelledbadge for audit purposes. - A new invoice can now be created on the same work order — the Create Invoice button reappears in the Invoice card.
TC-INV-005 — Paid invoice cannot be cancelled
Verifies: Invoices concept
Preconditions:
- A
paidinvoice exists. - Logged in as Office (with
invoices.edit).
Steps:
- Open the work order that has the paid invoice.
- In the Invoice card, look for the Cancel Invoice button.
- If the button still appears (guard is server-side), force a POST to
/admin/invoices/<id>/cancel.
Expected:
- The forced POST is rejected with a danger flash "A paid invoice cannot be cancelled."
- The invoice status remains
paid. - No call is made to the billing system.