Commit graph

11 commits

Author SHA1 Message Date
Brett Smith
552ef45f47 plugin: Be more selective about when ! skips validation.
It makes sense to let the bookkeeper skip validations in situations
where the metadata requires information that might not be available
when entered. It does not make sense to skip validations that *must*
be available and affect the structure of the books, like project and
entity.

This commit ensures every plugin hook has a test for flagged
transactions, even for hooks that currently have the desired
behavior where no code changes were required for the test to
pass.
2020-05-21 21:58:48 -04:00
Brett Smith
e3e782c028 tests: Style cleanup. 2020-05-21 21:57:29 -04:00
Brett Smith
be35f36d26 meta_tax_implication: Add Chargeback value. 2020-05-01 15:54:40 -04:00
Brett Smith
08a3151bfa meta_tax_implication: Remove unused values. 2020-05-01 15:52:27 -04:00
Brett Smith
c712105bed Revise chart of accounts used throughout.
The main impetus of this change is to rename accounts that were outside
Beancount's accepted five root accounts, to move them into that
structure. This includes:

  Accrued:*Payable: → Liabilities:Payable:*
  Accrued:*Receivable: → Assets:Receivable:*
  UneanedIncome:* → Liabilities:UnearnedIncome:*

Note the last change did inspire in a change to our validation rules. We no
longer require income-type on unearned income, because it's no longer
considered income at all. Once it's earned and converted to an Income
account, that has an income-type of course.

This did inspire another rename that was not required, but
provided more consistency with the other account names above:

  Assets:Prepaid* → Assets:Prepaid:*

Where applicable, I have generally extended tests to make sure one of each
of the five account types is tested. (This mostly meant adding an Equity
account to the tests.) I also added tests for key parts of the hierarchy,
like Assets:Receivable and Liabilities:Payable, where applicable.

As part of this change, Account.is_real_asset() got renamed to
Account.is_cash_equivalent(), to better self-document its purpose.
2020-04-03 10:34:10 -04:00
Brett Smith
0d370c445b plugin: User configuration is passed to hooks on initialization. 2020-03-19 17:23:27 -04:00
Brett Smith
501bd251cb tests: Turn tested hooks into fixtures.
This is in preparation for passing configuration to hooks.
That'll be a big change already, so I wanted this to be a
boring diff first.
2020-03-19 15:04:53 -04:00
Brett Smith
3f9e67de3a meta_tax_implication: Don't enforce on Assets:PrepaidExpenses. 2020-03-18 09:00:47 -04:00
Brett Smith
e7720b8fb8 tests: Add check_post_meta.
This makes it simple to conveniently check all posting metadata in tests.
2020-03-16 10:15:31 -04:00
Brett Smith
a41feb94b3 plugin: Transform posting hooks into transaction hooks.
I feel like posting hooks a case of premature optimization in early
development. This approach reduces the number of special cases in
the code and allows us to more strongly reason about hooks in the
type system.
2020-03-15 15:50:14 -04:00
Brett Smith
c9ff4ab746 plugin: Settle on words-with-dashes metadata keys. 2020-03-15 10:36:49 -04:00
Renamed from tests/test_meta_taxImplication.py (Browse further)