diff --git a/tests/data/templates.ini b/tests/data/templates.ini index 13b3c47..26e7f94 100644 --- a/tests/data/templates.ini +++ b/tests/data/templates.ini @@ -32,3 +32,11 @@ template = template = {custom_date} {payee} - Custom Accrued:Accounts Receivable {amount} Income:Donations -{amount} + +[Multisplit] +template = + Assets:Cash {amount} + Income:Sales -{amount} + {item_sales} + ; :NonItem: + Income:Sales -{item_sales} + ; :Item: diff --git a/tests/test_templates.py b/tests/test_templates.py index 38fcfad..3a3bf64 100644 --- a/tests/test_templates.py +++ b/tests/test_templates.py @@ -126,6 +126,19 @@ def test_zeroed_account_skipped(): " Income:Donations -99.00 USD", ] +def test_zeroed_account_last(): + render_vars = template_vars('JJ', '90.00', other_vars={ + 'item_sales': decimal.Decimal(0), + }) + lines = render_lines(render_vars, 'Multisplit') + assert lines == [ + "", + "2015/03/14 JJ", + " Assets:Cash 90.00 USD", + " Income:Sales -90.00 USD", + " ; :NonItem:", + ] + def test_custom_payee_line(): render_vars = template_vars('ZZ', '10.00', other_vars={ 'custom_date': datetime.date(2014, 2, 13),