Skip to content

319 — should render two saved invoice items correctly in the items grid

Description

Verifies that the invoice's items grid correctly renders two saved items at once: one summing a time record + expense, and one priced by unit × units with an amount discount, with all columns and aggregated totals showing the correct values.

Preconditions

  • Signed-in tenant with Client 01, the Private 01 (€480) and Private 04 (€2,880) time records, expense2 (€200), and the user on the new invoice form past the client step.

Steps

  1. Click Add item, set its name, link time record Private 04 and expense expense2. Expected: the item modal final price reads 3080. Save the item.
  2. Click Add item again, set its name, link Private 01, toggle Has unit on, set units 3, unit price 100, unit name from the seeded unit, switch discount type to Amount and value 50. Expected: the item modal final price reads 250. Save the item.
  3. Expected: the items grid shows 2 items.
  4. Expected: item 1 row shows time records 1, additional items 1, unit name -, price/unit -, units -, price 3,080.00, discount -, total price €3,080.00.
  5. Expected: item 2 row shows time records 1, additional items -, the chosen unit name, price/unit €100.00, units 3, price 300.00, discount €50.00, total price €250.00.
  6. Expected: items total discount reads €50.00 and items total price reads €3,330.00.
  • Spec: playwright/tests/integration/invoice.spec.ts (line 511)