Skip to content

Implement CRA line 22215 deduction for CPP/QPP enhanced contributions - #281

Merged
xrendan merged 1 commit into
mainfrom
feat/line-22215-cpp-qpp-deduction
Sep 1, 2026
Merged

xrendan merged 1 commit into
mainfrom
feat/line-22215-cpp-qpp-deduction

Conversation

@xrendan

@xrendan xrendan commented Sep 1, 2026

Copy link
Copy Markdown
Member

Summary

Implements the CRA line 22215 deduction for enhanced CPP/QPP contributions. The enhanced portion of first-tier contributions (the rate above the pre-2019 base of 4.95% CPP / 5.40% QPP) plus 100% of CPP2/QPP2 is deducted from income before applying federal and provincial tax brackets — and before the Ontario surtax, which is computed from bracket tax.

Supersedes #274, re-implemented off current main (post #279 surtax fix) and simplified.

Changes

  • Configs: Added baseRate to CPP/QPP configs for all years (2023–2026): 4.95% CPP, 5.40% QPP
  • Calculator: New shared helper calculateEnhancedContributionPortion in calculators/cappedCalculator.ts; calculateWithConfig computes taxable income as income − deduction and applies it to both bracket calculations. The deduction total is exposed as cppQppEnhancedDeduction on DetailedTaxCalculation
  • UI: Both tax cards on the visualizer show a "Total Taxable Income" section with a collapsible breakdown (gross income, CPP/QPP enhanced portion, CPP2/QPP2, taxable income); brackets are applied to taxable income

Differences from #274

  • The duplicated enhanced-portion math (calculator + page) is extracted into one shared helper
  • The negative cpp-qpp-enhanced-deduction TaxLineItem is dropped: nothing consumes it, and it would double-count in TaxBreakdownAccordion if that component were ever revived (the deduction is already baked into federalIncomeTax). The scalar on the calculation result remains
  • The padded "reduces federal income tax" test now actually asserts both federal and provincial tax equal the bracket tax on income − deduction

Testing

  • New calculator.deduction.test.ts validates the deduction amounts against hand-computed 2024 values ($838 at $80k for both CPP and QPP), low-income proportional scaling, and bracket wiring
  • Full suite: 64 tests pass, lint clean
  • Verified in the browser (Ontario and Quebec, 2025): collapsed summary reads "$100,000 gross income less $1,074 CPP/QPP enhanced deduction (line 22215)"; expanding shows the per-item breakdown with province-correct CPP/QPP labels

The enhanced portion of CPP/QPP contributions (rate above the pre-2019
base of 4.95% / 5.40%) plus the entire CPP2/QPP2 contribution is
deductible from taxable income, reducing both federal and provincial
income tax.

- Add baseRate to CPP/QPP configs for all years (2023-2026)
- Add calculateEnhancedContributionPortion helper shared by the
  calculator and the tax-visualizer page
- Apply the deduction to taxable income before bracket calculations
  (and before the Ontario surtax, which is based on bracket tax)
- Show a Total Taxable Income section with a collapsible deduction
  breakdown in both the federal and provincial cards
@xrendan
xrendan merged commit a417b9e into main Sep 1, 2026
2 checks passed
@macoyj macoyj mentioned this pull request Sep 2, 2026
5 of 7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant