fix(billing): edit invoice line items in the edit modal #243
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/MAPPS-234-invoice-edit-line-items"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
linesin the PUT, which the server already replaces transactionally and uses to recompute the subtotal. Each line's storedline_typeis preserved so re-saving does not flatten a time/product line toservice; new rows default toservice. 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