Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion beangulp/similar.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from beancount.core.number import D
from beancount.core.number import ZERO
from beancount.core.number import ONE
from beancount.core.number import MISSING
from beancount.core import data
from beancount.core import amount
from beancount.core import interpolate
Expand Down Expand Up @@ -145,7 +146,7 @@ def amounts_map(entry):
if posting.meta and interpolate.AUTOMATIC_META in posting.meta:
continue
currency = isinstance(posting.units, amount.Amount) and posting.units.currency
if isinstance(currency, str):
if isinstance(currency, str) and posting.units.number != MISSING:
key = (posting.account, currency)
amounts[key] += posting.units.number
return amounts
1 change: 1 addition & 0 deletions beangulp/similar_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def test_amounts_map(self, entries, _, __):
2016-01-03 *
Expenses:Tips 1.01 USD
Expenses:Tips 1.02 USD
Expenses:Tips USD @ 1.1 CHF
Assets:Other
"""
txns = list(data.filter_txns(entries))
Expand Down