Skip to content
Snippets Groups Projects
Commit b23f998d authored by Daniele Nicolodi's avatar Daniele Nicolodi
Browse files

balance: Handle null balances correctly

parent 0b04f149
Branches
No related tags found
No related merge requests found
......@@ -10,12 +10,15 @@ from os import path
from orders import list_designated_accounts
from beancount import loader
from beancount.core import data, inventory
from beancount.core import amount, data, inventory
def units(values):
assert len(values) == 1
return values[0].get_only_position().units
position = values[0].get_only_position()
if position is None:
return amount.from_string('0.00 EUR')
return position.units
def cumulative_balances_by_year(entries, accounts, unpack=False):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment