Skip to content

Commit

Permalink
Merge pull request resilient-tech#2113 from vorasmit/fix-tests
Browse files Browse the repository at this point in the history
fix: floating point error for tax rounding
  • Loading branch information
vorasmit authored May 12, 2024
2 parents 6ba2195 + a16c1ea commit a1a8d53
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions india_compliance/gst_india/overrides/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,9 @@ def set_item_wise_tax_details(self):
item_taxes[tax_rate_field] = tax_rate
item_taxes[tax_amount_field] += tax_amount

# Floating point errors
tax_difference = flt(tax_difference, 5)

# Handle rounding errors
if tax_difference:
item_taxes[tax_amount_field] += tax_difference
Expand Down

0 comments on commit a1a8d53

Please sign in to comment.