diff --git a/austax/views.py b/austax/views.py index 58b6138..c7bbf20 100644 --- a/austax/views.py +++ b/austax/views.py @@ -189,15 +189,19 @@ def cgt_assets(): assets = [] for posting in cgt_postings: + if posting.commodity == '$': + # FIXME: Detect this better + continue + if posting.quantity >= 0: assets.append(CGTAsset(posting.quantity, posting.commodity, posting.account, posting.transaction.dt)) elif posting.quantity < 0: asset = next((a for a in assets if a.commodity == posting.commodity and a.account == posting.account), None) if asset is None: - raise Exception('Attempted credit {} without preceding debit balance'.quantity(posting.amount())) + raise Exception('Attempted credit {} without preceding debit balance'.format(posting.amount())) if asset.quantity + posting.quantity < 0: - raise Exception('Attempted credit {} with insufficient debit balance {}'.quantity(posting.amount(), asset.amount())) + raise Exception('Attempted credit {} with insufficient debit balance {}'.format(posting.amount(), asset.amount())) if asset.quantity + posting.quantity != 0: raise NotImplementedError('Partial disposal of CGT asset not implemented')