Changeset - 5784068904e8
[Not reviewed]
0 1 0
Bradley Kuhn (bkuhn) - 8 months ago 2023-12-23 18:40:07
bkuhn@ebb.org
payroll-type — US:403b:Employee:Roth — needed separate since taxable

Since Roth contributions are taxable, there are some reports that
need to include these amounts in total salary (i.e., when running a
report that seeks to show total taxable income for an employee). As
such, we need a `payroll-type` specifically for Roth 403(b)
contributions.
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/plugin/meta_payroll_type.py
Show inline comments
 
"""meta_payroll_type - Validate payroll-type metadata"""
 
# Copyright © 2020  Bradley M. Kuhn, Brett Smith
 
# License: AGPLv3-or-later WITH Beancount-Plugin-Additional-Permission-1.0
 
#
 
# Full copyright and licensing details can be found at toplevel file
 
# LICENSE.txt in the repository.
 

	
 
import datetime
 

	
 
from . import core
 
from .. import ranges
 
from .. import data
 

	
 
from ..beancount_types import (
 
    Transaction,
 
)
 

	
 
METADATA_KEY = 'payroll-type'
 

	
 

	
 
class _PayrollTypeHook(core._NormalizePostingMetadataHook):
 
    ACCOUNT: str
 
    VALUES_ENUM = core.MetadataEnum(METADATA_KEY, [])
 
    TXN_DATE_RANGE = ranges.DateRange(
 
        datetime.date(2020, 3, 1),
 
        core.DEFAULT_STOP_DATE,
 
    )
 

	
 
    def _run_on_post(self, txn: Transaction, post: data.Posting) -> bool:
 
        return post.account.is_under(self.ACCOUNT) is not None
 

	
 

	
 
class HealthInsuranceHook(_PayrollTypeHook):
 
    ACCOUNT = 'Expenses:Payroll:Benefits:HealthInsurance'
 
    VALUES_ENUM = core.MetadataEnum(METADATA_KEY, [
 
        'US:HRA:Fees',
 
        'US:HRA:Usage',
 
        'US:Premium:DentalVision',
 
        'US:Premium:Main',
 
    ])
 

	
 

	
 
class OtherBenefitsHook(_PayrollTypeHook):
 
    ACCOUNT = 'Expenses:Payroll:Benefits:Other'
 
    VALUES_ENUM = core.MetadataEnum(METADATA_KEY, [
 
        'US:403b:Fees',
 
        'US:403b:Other',
 
        'US:Education',
 
        'US:ProfessionalMembership',
 
    ])
 

	
 

	
 
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:OH:Tax:Income',
 
        'US:OH:Tax:COLUMB',
 
        'US:OH:Tax:PNTSD',
 
        '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:Earned',
 
        'CA:PTO:Taken',
 
        'US:403b:Employee',
 
        'US:403b:Employee:Roth',
 
        'US:403b:Match',
 
        'US:General',
 
        'US:MA:Disability:PFL',
 
        'US:OR:Disability:PFL',
 
        'US:MA:Disability:PML',
 
        'US:NY:Disability',
 
        'US:NY:Disability:PFL',
 
        'US:PTO:Earned',
 
        'US:PTO:Taken',
 
        *_tax_values,
 
    ], {
 
        value.replace(':Tax:', ':Taxes:', 1): value
 
        for value in _tax_values
 
    })
 
    del _tax_values
 

	
 

	
 
class TaxHook(_PayrollTypeHook):
 
    ACCOUNT = 'Expenses:Payroll:Taxes'
 
    VALUES_ENUM = core.MetadataEnum(METADATA_KEY, [
 
        'CA:EI',
 
        'CA:PP',
 
        'CA:WCB',
 
        'US:IL:Unemployment',
 
        'US:TN:Unemployment',
 
        'US:MA:Health',
 
        'US:MA:Unemployment',
 
        'US:MA:WorkTrain',
 
        'US:Medicare',
 
        'US:OR:Unemployment',
 
        'US:SocialSecurity',
 
    ])
0 comments (0 inline, 0 general)