Skip to content

ABN-443/fix: show surcharge net in invoice/order/creditmemo totals#203

Merged
dgjlindsay merged 2 commits into
stagingfrom
doug/ABN-443-surcharge-net-display
Jun 4, 2026
Merged

ABN-443/fix: show surcharge net in invoice/order/creditmemo totals#203
dgjlindsay merged 2 commits into
stagingfrom
doug/ABN-443-surcharge-net-display

Conversation

@dgjlindsay
Copy link
Copy Markdown
Contributor

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 in
the 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

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>
@gemini-code-assist
Copy link
Copy Markdown

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>
@dgjlindsay dgjlindsay merged commit d57d2c1 into staging Jun 4, 2026
20 checks passed
@dgjlindsay dgjlindsay deleted the doug/ABN-443-surcharge-net-display branch June 4, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant