Skip to content

322 — should re-render item amounts under each rounding option

Description

Verifies that switching the invoice rounding option (Nearest tenth → one → ten → hundred → thousand) re-formats the item's unit price, price, discount, total, and the invoice subtotal/grand total at the correct decimal precision, including with an invoice-level €50 discount applied on top.

Preconditions

  • Signed-in tenant with Client 01, two billable time records totalling €3,360.00, and the user on the new invoice form past the client step.

Steps

  1. Click Add item, name it, open the Time records picker, click Select all, save. Expected: time-records total reads 3,360.00.
  2. Toggle Has unit on; set units 3.6, unit price 100.7, unit name. Expected: item price 362.52 and final price 362.52.
  3. Switch item discount type to Amount and value 50. Expected: final price 312.52. Save the item. Expected: the grid shows 1 item.
  4. Expected: subtotal €312.52, grand total €312.52. Switch the invoice-level discount type to Amount and value 50. Expected: subtotal stays €312.52, grand total becomes €262.52.
  5. Set rounding to Nearest tenth. Expected: unit price €100.7, price 362.5, discount €50.0, total €312.5, items total discount €50.0, items total €312.5, subtotal €312.5, grand total €262.5.
  6. Set rounding to Nearest one. Expected: unit price €101, price 364, discount €50, total €314, items total €314, subtotal €314, grand total €264.
  7. Set rounding to Nearest ten. Expected: unit price €100, price 360, discount €50, total €310, subtotal €310, grand total €260.
  8. Set rounding to Nearest hundred. Expected: unit price €100, price 400, discount €100, total €300, subtotal €300, grand total €200.
  9. Set rounding to Nearest thousand. Expected: unit price €0, price 0, discount €0, total €0, subtotal €0, grand total €0.
  • Spec: playwright/tests/integration/invoice.spec.ts (line 615)