diff --git a/conservancy_beancount/plugin/meta_receipt.py b/conservancy_beancount/plugin/meta_receipt.py index 937be0f..423cfe9 100644 --- a/conservancy_beancount/plugin/meta_receipt.py +++ b/conservancy_beancount/plugin/meta_receipt.py @@ -38,6 +38,7 @@ class MetaReceipt(core._RequireLinksPostingMetadataHook): def _run_on_post(self, txn: Transaction, post: data.Posting) -> bool: return ( (post.account.is_cash_equivalent() or post.account.is_credit_card()) + and not post.account.is_under('Assets:PayPal') and post.units.number is not None and abs(post.units.number) >= self.payment_threshold ) @@ -71,6 +72,4 @@ class MetaReceipt(core._RequireLinksPostingMetadataHook): keys.append('check') elif post.account.is_credit_card() and not post.is_credit(): keys.append('invoice') - elif post.account.is_under('Assets:PayPal') and not post.is_debit(): - keys.append('paypal-id') return self._check_metadata(txn, post, keys) diff --git a/tests/test_meta_receipt.py b/tests/test_meta_receipt.py index b8cb2ca..b251dda 100644 --- a/tests/test_meta_receipt.py +++ b/tests/test_meta_receipt.py @@ -63,8 +63,6 @@ ACCOUNTS = [AccountForTesting._make(t) for t in [ ('Assets:Cash', PostType.BOTH, None), ('Assets:Checking', PostType.CREDIT, 'check'), ('Assets:Checking', PostType.DEBIT, 'check-id'), - ('Assets:PayPal', PostType.CREDIT, 'paypal-id'), - ('Assets:PayPal', PostType.DEBIT, None), ('Assets:Savings', PostType.BOTH, None), ('Liabilities:CreditCard', PostType.CREDIT, None), ('Liabilities:CreditCard', PostType.DEBIT, 'invoice'), @@ -84,6 +82,8 @@ KNOWN_FALLBACKS = {acct.fallback_meta for acct in ACCOUNTS if acct.fallback_meta # doesn't require the decorated test to go over every value, which in turn # trims unnecessary test time. NOT_REQUIRED_ACCOUNTS = itertools.cycle([ + # Only paypal-id is required for PayPal transactions + 'Assets:PayPal', 'Assets:Prepaid:Expenses', 'Assets:Receivable:Accounts', 'Equity:OpeningBalance',