Skip to content

Commit

Permalink
Allow balancing errors upto 5 decimal
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbPy committed Feb 11, 2024
1 parent b2df616 commit 155003d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion beancount_import/source/generic_importer_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def balance_amounts(txn:Transaction)-> None:
inventory = SimpleInventory()
for posting in txn.postings:
inventory += get_weight(convert_costspec_to_cost(posting))
unbalanced_currencies = [(currency,v) for currency,v in inventory.items() if v!=0]
unbalanced_currencies = [(currency,v) for currency,v in inventory.items() if round(v, 5)!=0]
# posting with no units. Usually added by smart_importer or user
empty_posting = any([True if p.units is None else False for p in txn.postings])
if unbalanced_currencies and not empty_posting:
Expand Down

0 comments on commit 155003d

Please sign in to comment.