The sum of the product's unit value with applied discount (sellingPrice property) may differ from the product's total value minus the total discount value.
This is because unit discount calculation is a distribution of the total discount between all items and their quantities, which can cause rounding problems. By summing values that have been rounded, the difference from the original total can be noticed.
Therefore, sellingPrice should be used as a reference, keeping the totalizers as the real value.
The occurrence is more frequent in stores that use less than 2 decimal places, when rounding is most used.
Example of occurrence:
In this scenario:
However, the sum of the items' sale price, with the discount applied, is $ 284.
There is currently no workaround available for this scenario.