Estonia plugin · artifi-ee-payroll-calculator
Estonian Payroll Calculator.
A complete Estonian payroll calculation engine that processes gross-to-net for all employees in a payroll run. Applies all Estonian tax formulas: 33% social tax (employer), 22% income tax, 1.6% unemployment insurance (employee), 0.8% unemployment insurance (employer), and funded pension at 2%, 3%, or 6% depending on the employee's tier. Handles the basic tax exemption, pre-tax and post-tax voluntary deductions, and pro-rating for mid-month starts/exits. Generates TSD declaration XML files for direct upload to the EMTA (Estonian Tax and Customs Board) portal.
01 / Commands · 2
Two commands.
Two procedures.
Both run inside Claude against the governed ledger.
/calculate-payroll — Calculate gross-to-net payroll for all employees in a payroll run. Loads the payroll run, fetches employees with compensation/tax settings/deductions, applies all Estonian tax formulas, validates net pay within 0.02 tolerance, and submits calculated results. Shows summary table with per-employee breakdown.
/generate-tsd — Generate the Estonian monthly TSD declaration XML for EMTA filing. Fetches calculated payroll data, builds structured JSON input, and runs the generate_tsd.py script to produce validated XML with correct namespace and per-employee data (personal ID, gross pay, income tax, social tax, unemployment, pension).
HIGHLIGHTS
All Estonian tax formulas (social, income, unemployment, pension). Multiple funded pension tiers (2%, 3%, 6%). Pre-tax and post-tax deduction handling. TSD declaration XML generation for EMTA.
02 / How a run behaves
How a run behaves.
Two procedures, step by step.
PAYROLL CALCULATION
TSD DECLARATION GENERATION
VALIDATION GATE · 6 CHECKS
Payroll run exists and is in "draft" status. All employees in the run have active compensation records. All employees have tax settings (pension tier, basic exemption). Tax rates loaded from payroll tax jurisdiction (country_code = "EE"). For each employee: net pay equals gross minus total taxes minus deductions (within 0.02). Submission succeeds without validation errors.
REFERENCE DATA · 3 FILES
Fork it
Your procedures,
written down.
Swap the reference files for your policies and run it in Claude. Writes still go through the governed gateway.
hello@ar-ti-fi.com