fix(billing): edit invoice line items in the edit modal #243

Merged
David merged 2 commits from fix/MAPPS-234-invoice-edit-line-items into main 2026-06-17 12:43:43 +02:00
Owner

The invoice edit modal rendered only header fields and its PUT body omitted lines, so line items were create-only: once an invoice existed, lines could never be added, removed, or corrected. This contradicted the create form's own promise ("Add more lines by editing the invoice after it is created").

Add an editable line-item table to InvoiceEditModal seeded from the invoice's current lines, with per-row description / quantity / unit-price inputs, a Remove button, and an Add line button. On save the modal validates each line (non-empty description, non-negative numeric quantity and unit price, at least one line) and sends lines in the PUT, which the server already replaces transactionally and uses to recompute the subtotal. Each line's stored line_type is preserved so re-saving does not flatten a time/product line to service; new rows default to service. The tax-rate calculation now derives its subtotal from the edited lines rather than the value the invoice opened with.

#MAPPS-234

The invoice edit modal rendered only header fields and its PUT body omitted `lines`, so line items were create-only: once an invoice existed, lines could never be added, removed, or corrected. This contradicted the create form's own promise ("Add more lines by editing the invoice after it is created"). Add an editable line-item table to InvoiceEditModal seeded from the invoice's current lines, with per-row description / quantity / unit-price inputs, a Remove button, and an Add line button. On save the modal validates each line (non-empty description, non-negative numeric quantity and unit price, at least one line) and sends `lines` in the PUT, which the server already replaces transactionally and uses to recompute the subtotal. Each line's stored `line_type` is preserved so re-saving does not flatten a time/product line to `service`; new rows default to `service`. The tax-rate calculation now derives its subtotal from the edited lines rather than the value the invoice opened with. #MAPPS-234
fix(billing): edit invoice line items in the edit modal
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 1m6s
6e6e3791ab
The invoice edit modal rendered only header fields and its PUT body omitted `lines`, so line items were create-only: once an invoice existed, lines could never be added, removed, or corrected. This contradicted the create form's own promise ("Add more lines by editing the invoice after it is created").

Add an editable line-item table to InvoiceEditModal seeded from the invoice's current lines, with per-row description / quantity / unit-price inputs, a Remove button, and an Add line button. On save the modal validates each line (non-empty description, non-negative numeric quantity and unit price, at least one line) and sends `lines` in the PUT, which the server already replaces transactionally and uses to recompute the subtotal. Each line's stored `line_type` is preserved so re-saving does not flatten a time/product line to `service`; new rows default to `service`. The tax-rate calculation now derives its subtotal from the edited lines rather than the value the invoice opened with.

#MAPPS-234
Merge branch 'main' into fix/MAPPS-234-invoice-edit-line-items
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / clippy + fmt + tests (pull_request) Successful in 2m1s
b851695857
David merged commit 0abf4e373a into main 2026-06-17 12:43:43 +02:00
David deleted branch fix/MAPPS-234-invoice-edit-line-items 2026-06-17 12:43:43 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!243
No description provided.