meta_tax_implication: Don't enforce on Assets:PrepaidExpenses.

This commit is contained in:
Brett Smith 2020-03-18 09:00:47 -04:00
parent 28238643a3
commit 3f9e67de3a
2 changed files with 11 additions and 1 deletions

View file

@ -47,7 +47,7 @@ class MetaTaxImplication(core._NormalizePostingMetadataHook):
def _run_on_post(self, txn: Transaction, post: data.Posting) -> bool:
return bool(
post.account.startswith('Assets:')
post.account.is_real_asset()
and post.units.number
and post.units.number < DEFAULT_STOP_AMOUNT
)

View file

@ -109,6 +109,16 @@ def test_non_asset_accounts_skipped(account):
assert not errors
testutil.check_post_meta(txn, None, meta)
def test_prepaid_expenses_skipped():
txn = testutil.Transaction(postings=[
('Expenses:General', 25),
('Assets:PrepaidExpenses', -25),
])
checker = meta_tax_implication.MetaTaxImplication()
errors = list(checker.run(txn))
assert not errors
testutil.check_post_meta(txn, None, None)
def test_asset_credits_skipped():
txn = testutil.Transaction(postings=[
('Income:Donations', -25),