Changeset - 90a58ef11258
[Not reviewed]
0 2 0
Brett Smith - 4 years ago 2020-04-01 15:10:14
brettcsmith@brettcsmith.org
meta_project: Not required on Equity accounts.
2 files changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/plugin/meta_project.py
Show inline comments
...
 
@@ -76,13 +76,13 @@ class MetaProject(core._NormalizePostingMetadataHook):
 
        raise errormod.ConfigurationError(
 
            "cannot load project data: " + msg,
 
            source=source,
 
        )
 

	
 
    def _run_on_post(self, txn: Transaction, post: data.Posting) -> bool:
 
        return post.account.is_under('Assets', 'Liabilities') is None
 
        return post.account.is_under('Assets', 'Equity', 'Liabilities') is None
 

	
 
    def _default_value(self, txn: Transaction, post: data.Posting) -> MetaValueEnum:
 
        if post.account.is_under(
 
                'Accrued:VacationPayable',
 
                'Expenses:Payroll',
 
        ):
tests/test_meta_project.py
Show inline comments
...
 
@@ -85,12 +85,13 @@ def test_invalid_values_on_transactions(hook, src_value):
 
    assert errors
 
    testutil.check_post_meta(txn, None, None)
 

	
 
@pytest.mark.parametrize('account,required', [
 
    ('Accrued:AccountsReceivable', True),
 
    ('Assets:Cash', False),
 
    ('Equity:Opening-Balances', False),
 
    ('Expenses:General', True),
 
    ('Income:Donations', True),
 
    ('Liabilities:CreditCard', False),
 
    ('UnearnedIncome:Donations', True),
 
])
 
def test_which_accounts_required_on(hook, account, required):
0 comments (0 inline, 0 general)