Commit graph

7 commits

Author SHA1 Message Date
Brett Smith
d7e2ab34b9 meta_project: Force the default project on Equity accounts.
See rationale in comments.
2020-06-17 04:29:17 -04:00
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
701ccdc192 tests: Test where Transactions are real NamedTuples.
This makes methods like _replace available in real code, and caught the
bug where we can't use @functools.lru_cache with Transaction arguments,
because they're unhashable due to their mutable members.
2020-04-28 15:33:30 -04:00
Brett Smith
9f0c30738d plugin: Most validations skip opening balance transactions. RT#10642. 2020-04-09 15:12:04 -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
90a58ef112 meta_project: Not required on Equity accounts. 2020-04-01 11:10:14 -04:00
Brett Smith
1500d2d9d8 meta_project: Start hook. 2020-03-20 12:08:10 -04:00