austax: Gracefully handle assets without acquisition cost when processing multiple CGT adjustment

This commit is contained in:
RunasSudo 2023-09-10 19:37:26 +10:00
parent 3d09e4f34f
commit d37d88e173
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
1 changed files with 3 additions and 1 deletions

View File

@ -110,7 +110,9 @@ def cgt_adjustment_multinew():
assets = []
for posting in cgt_postings:
if posting.commodity[:posting.commodity.index('{')].strip() != request.form['commodity']:
if '{' not in posting.commodity and posting.commodity != request.form['commodity']:
continue
if '{' in posting.commodity and posting.commodity[:posting.commodity.index('{')].strip() != request.form['commodity']:
continue
if posting.quantity >= 0: