Last active
December 21, 2015 08:08
-
-
Save meskallito/6275598 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module StaticInstructions::Meta | |
| class BasicFederalTax < Base | |
| include PayPeriods | |
| zero_or_positive! | |
| def value | |
| tr.rate * deps.annual_taxable_income - tr.constant - k1 - k2 - k3 - k4 | |
| end | |
| def tr | |
| TaxRates.new(deps.annual_taxable_income) | |
| end | |
| def k4 | |
| [bd(0.15) * deps.annual_taxable_income, bd(0.15) * bd(1_117)].min | |
| end | |
| def k3 | |
| 0 | |
| end | |
| def k2 | |
| bd(0.15) * [pay_periods * deps.canada_pension_plan, bd(2_356.20)].min | |
| + bd(0.15) * [pay_periods * deps.employment_insurance, bd(891.12)].min | |
| end | |
| def k1 | |
| employee.td1_form.total_claim * 0.15 | |
| end | |
| def calculation_dependencies | |
| [ :annual_taxable_income, :canada_pension_plan, :employment_insurance ] | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment