fix(invoices): validate line totals with global discounts (H37) #51

Merged
morrning merged 1 commit from Seyyed/Seyyed_arc:codex/team-base-11-line-total-validation into master 2026-11-12 16:54:40 +03:30
Contributor

Summary

  • Validate incoming line totals during CREATE and UPDATE rebuild even when a header discount exists.
  • Accept the pre-allocation amount or the amount calculated by the server allocator. Reject inconsistent amounts before document or GL changes.
  • Preserve the existing rounding tolerance and the payment-only path.

Verification

48 targeted tests passed, including H23, H37, payment-only updates and a posted SQLite sale. A rejected rewrite preserved the 99 receivable and 9 VAT entries. PHP, WordPress, HTTP and PostgreSQL were not run.

H36 follow-up

A numeric serialization fixture for quantity 7 and total 999999999.99 produces a 1E-7 difference with 7E-8 tolerance. Adjacent unit-price floats also fail. The canonical amount and exact decimal representation need to be defined, including the Mapper's end-of-order rounding adjustment.

## Summary - Validate incoming line totals during CREATE and UPDATE rebuild even when a header discount exists. - Accept the pre-allocation amount or the amount calculated by the server allocator. Reject inconsistent amounts before document or GL changes. - Preserve the existing rounding tolerance and the payment-only path. ## Verification 48 targeted tests passed, including H23, H37, payment-only updates and a posted SQLite sale. A rejected rewrite preserved the 99 receivable and 9 VAT entries. PHP, WordPress, HTTP and PostgreSQL were not run. ## H36 follow-up A numeric serialization fixture for quantity 7 and total 999999999.99 produces a 1E-7 difference with 7E-8 tolerance. Adjacent unit-price floats also fail. The canonical amount and exact decimal representation need to be defined, including the Mapper's end-of-order rounding adjustment.
morrning merged commit 940d0264c6 into master 2026-11-12 16:54:40 +03:30
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
hesabix/arc!51
No description provided.