Fixes
ChartMogul
Changed the following formulae:
-
amount
= ∑debitsIncTax -
discountAmount
= ∑creditsIncTax -
taxAmount
= ∑debitsTaxOnly
After:
-
amount
= ∑debitsIncTax − ∑creditsIncTax -
discountAmount
= ∑creditsIncTax -
taxAmount
= Math.max(0, ∑debitsTaxOnly − ∑creditsTaxOnly)
In all, the following fixes are included:
- We now report the correct
amount
(i.e. we report the net, not the gross) - We now report the correct
taxAmount
(i.e. we report the net, not the gross) - We now prefer to report $0 instead of negative tax (closest supported representation)
- We now round up "x minutes" plans to "1 day" (closest supported representation)
We switched over to this new algorithm in Production at 2017-10-01 01:23:18Z
.