ABN-443/fix: show surcharge net in invoice/order/creditmemo totals#203
Merged
Conversation
The totals display blocks (on-screen and PDF) rendered the surcharge GROSS (net + VAT). That matched the OLD inflated grand total, but since the collector fix (ABN-443 / #201) the grand total is net-based, so the gross row no longer reconciles — and it double-presents the VAT (once in the Tax line, once inside the surcharge row). Show the surcharge NET in both blocks; its VAT stays in the Tax line, exactly as on checkout. Net rows (items + shipping + tax + net surcharge) now sum to the grand total. Adds unit coverage for both blocks. Refs ABN-443 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
The surcharge contributes to the tax base, so showing net surcharge then tax reads more naturally (and matches checkout ordering). Insert the totals row before `tax` instead of before `grand_total`. Refs ABN-443 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #201 / #202.
After the collector fix (#201) the grand total is net-based, but the totals
display blocks still rendered the surcharge gross (net + VAT). Result
on the View Invoice / order / credit-memo totals (and PDF): net items +
shipping + tax + gross surcharge, which double-presents the VAT and
doesn't sum to the grand total.
This shows the surcharge net in both display blocks
(
Block/Sales/Total/Surcharge,Model/Pdf/Total/Surcharge); the VAT stays inthe Tax line — matching checkout. Rows now reconcile to the grand total.
Display-only: grand totals / collectors are unchanged.
Tests: new unit coverage for both blocks (RED on gross, GREEN on net). 144 pass.
Refs ABN-443