From e06b400998a9518c79ece33dc126557c22a1571b 2020-12-23 23:31:32 From: Brett Smith Date: 2020-12-23 23:31:32 Subject: [PATCH] meta_payroll_type: Prefer :Tax: over :Taxes: in metadata values. This is something we're doing generally, e.g., in our chart of accounts. Do it here too for consistency. Accept the :Taxes: versions as synonyms. --- diff --git a/conservancy_beancount/plugin/meta_payroll_type.py b/conservancy_beancount/plugin/meta_payroll_type.py index 5a6ec228e3d006156cc96bf132908c7544f3f461..aba51e5a820d7ffdc8c9e0051819580cc126f920 100644 --- a/conservancy_beancount/plugin/meta_payroll_type.py +++ b/conservancy_beancount/plugin/meta_payroll_type.py @@ -58,30 +58,37 @@ class OtherBenefitsHook(_PayrollTypeHook): class SalaryHook(_PayrollTypeHook): ACCOUNT = 'Expenses:Payroll:Salary' + _tax_values = [ + 'CA:Tax:EI', + 'CA:Tax:Income', + 'CA:Tax:PP', + 'US:IL:Tax:Income', + 'US:MA:Tax:Income', + 'US:NY:Tax:Income', + 'US:NY:Tax:NYC', + 'US:OR:Tax:Income', + 'US:OR:Tax:STT', + 'US:Tax:Income', + 'US:Tax:Medicare', + 'US:Tax:SocialSecurity', + ] VALUES_ENUM = core.MetadataEnum(METADATA_KEY, [ 'CA:General', 'CA:PTO', - 'CA:Taxes:EI', - 'CA:Taxes:Income', - 'CA:Taxes:PP', 'US:403b:Employee', 'US:403b:Match', 'US:General', - 'US:IL:Taxes:Income', 'US:MA:Disability:PFL', 'US:MA:Disability:PML', - 'US:MA:Taxes:Income', 'US:NY:Disability', 'US:NY:Disability:PFL', - 'US:NY:Taxes:Income', - 'US:NY:Taxes:NYC', - 'US:OR:Taxes:Income', - 'US:OR:Taxes:STT', 'US:PTO', - 'US:Taxes:Income', - 'US:Taxes:Medicare', - 'US:Taxes:SocialSecurity', - ]) + *_tax_values, + ], { + value.replace(':Tax:', ':Taxes:', 1): value + for value in _tax_values + }) + del _tax_values class TaxHook(_PayrollTypeHook): diff --git a/setup.py b/setup.py index 609fe0f209d5f6d8b53efa51d589499a08bdcdd0..0ca26c3305e8236533add54c0648018e8b1110f4 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from setuptools import setup setup( name='conservancy_beancount', description="Plugin, library, and reports for reading Conservancy's books", - version='1.14.0', + version='1.14.1', author='Software Freedom Conservancy', author_email='info@sfconservancy.org', license='GNU AGPLv3+',