Commit graph

14 commits

Author SHA1 Message Date
Brett Smith
23e1ed7cee Revert "meta_receipt: Don't check chargebacks. RT#10978."
This reverts commit 6aadb740e6.
This is supposed to be done in meta_approval, not meta_receipt.
2020-05-01 16:20:22 -04:00
Brett Smith
6aadb740e6 meta_receipt: Don't check chargebacks. RT#10978. 2020-05-01 16:18:46 -04:00
Brett Smith
9f0c30738d plugin: Most validations skip opening balance transactions. RT#10642. 2020-04-09 15:12:04 -04:00
Brett Smith
f7bb036366 meta_receipt: Stop checking Assets:PayPal. RT#10637.
We only want to enforce paypal-id on these postings, and that's done with
the introduction of MetaPayPalID.
2020-04-07 14:47:02 -04:00
Brett Smith
fdb62dd1c6 plugin.core: _RequireLinksPostingMetadataHook can check several metadata.
Extend the base class from checking 1 metadata value to checking N.

This is preparation for RT#10643, letting payables be documented with
invoice or contract.

This does unify error reporting, because now we always report all
type/invalid value errors *plus* a missing error if appropriate.
I think this consistency and thoroughness is appropriate, although
it did require some adjustments to the tests.
2020-04-06 22:02:14 -04:00
Brett Smith
600c9d9d6f meta_receipt: Correctly fall back to other metadata on zero-value postings.
RT#10633.
2020-04-05 15:29:04 -04:00
Brett Smith
6658696d06 meta_receipt: Use check-id as fallback metadata for outgoing checks.
When we send checks, we don't have a check document anywhere (for
security reasons), we just note the check number. Update the
validation to match. RT#10507.
2020-04-04 10:54:08 -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
a0a3b04e50 meta_receipt: Accept paypal-id in lieu of receipt for PayPal credits. 2020-03-30 15:48:19 -04:00
Brett Smith
381160f0de meta_receipt: Accept invoice in lieu of receipt for credit card charges. 2020-03-30 15:48:19 -04:00
Brett Smith
7cac21b780 meta_receipt: Applies to both credits and debits. 2020-03-30 15:47:30 -04:00
Brett Smith
258099264e tests: Improve name spread in test_meta_receipt. 2020-03-30 15:16:37 -04:00
Brett Smith
8a2721ec0f tests: Prepare test_meta_receipt to test more credits and fallbacks.
I'm getting to ready to extend this hook to deal with income receipts as
well as expense receipts. These changes let me write the tests in a more
declarative style, so I don't have to duplicate them all again to test
credits as well as debits.

Note that we're only testing debits right now, just like the existing tests,
because the default check_type for check() is PostType.DEBIT. Part of making
the changes will be changing that to PostType.BOTH.
2020-03-30 14:49:46 -04:00
Brett Smith
2909c405e6 meta_receipt: Start hook. 2020-03-28 22:19:49 -04:00