microsoft / microsoft/BCApps

[Bug]: VAT Rounding Discrepancy Between Sales Document Totals and Statistics

Open
#11,088 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Team: Integrations
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
  1. Create a new Sales Invoice.
  2. Enable the Prices Including VAT toggle.
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.