Skip to content

Commit

Permalink
Merge 7302ad8 into bd39126
Browse files Browse the repository at this point in the history
  • Loading branch information
stin7 committed Apr 11, 2020
2 parents bd39126 + 7302ad8 commit 5282497
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion beancount_import/source/ofx.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,13 @@ def get_subaccount_cash(inv401ksource: Optional[str] = None) -> str:
units = normalize_fraction(raw.units)
if quantity_round_digits is not None:
units = round(units, quantity_round_digits)
unitprice = normalize_fraction(raw.unitprice)

if raw.unitprice==ZERO or raw.unitprice is None:
# Assume Zero or missing unitprice is a bug, recalculate.
unitprice = abs(raw.total/raw.units)
else:
unitprice = raw.unitprice
unitprice = normalize_fraction(unitprice)

cost_spec = None
price = None
Expand Down

0 comments on commit 5282497

Please sign in to comment.