[Bug]: VAT Rounding Discrepancy Between Sales Document Totals and Statistics
Nobody has claimed this yet.
- Dominant language
- AL
- Stars
- 683
- Forks
- 459
- Avg merge
- 3d 26m
- Merged PRs (30d)
- 633
Description
Describe the issue
When the "Prices Including VAT" toggle is enabled on a sales invoice and an item with a VAT-inclusive price is split across multiple lines, the totals displayed on the document page (Total Excl. VAT / Total VAT) differ from the amounts calculated in the statistics. This results in inconsistent VAT figures between the user-facing document and the posting.
Expected behavior
In the Total Excl. VAT on document page (sum of Amount field) will be calculated correct in my example 10,083.33
Steps to reproduce
- Create a new Sales Invoice.
- Enable the Prices Including VAT toggle.
- Add a sales line for an item with a VAT rate of 20%, where the amount including VAT equals 1,100 GBP per unit, with a total quantity of 11, entered as 11 separate lines (one unit per line).
In the Total Excl. VAT on document page will be 10,083.37, but in statistics the Total Excl. VAT will be 10,083.33.
Additional context
No response
I will provide a fix for a bug
- I will provide a fix for a bug
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the sales invoice scenario with Prices Including VAT enabled, 20% VAT, and eleven separate one-unit lines. Compare the document page's Total Excl. VAT and Total VAT with the corresponding statistics values. Done means both views use the same rounded totals, including the expected Total Excl. VAT of 10,083.33.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100