Class: Formulas::PAYE
- Inherits:
-
WithholdingTax
- Object
- WithholdingTax
- Formulas::PAYE
- Defined in:
- lib/formulas/paye.rb
Overview
Calculate basic salary in frequency paye = Formulas::PAYE.new(gross_pay: 52_000, frequency: Formulas::ANNUAL)
paye.tax(:monthly)
> 718.33
Provide a way to calculate pay as you earn calculator
Constant Summary collapse
- TAX_RATES =
Provide a way to calculate PAYE tax
[ [[0, 14_000], 10.5], [[14_000, 48_000], 17.5], [[48_000, 70_000], 30], [[70_000, 180_000], 33], [[180_000], 39] ]
- MAX_ACC_LEVY_PAYABLE =
130_911
Instance Attribute Summary
Attributes inherited from WithholdingTax
Instance Method Summary collapse
- #acc_payable ⇒ Object
-
#initialize(gross_pay:, frequency: Formulas::MONTHLY) ⇒ PAYE
constructor
A new instance of PAYE.
- #levy ⇒ Object
- #tax(request_frequency: Formulas::WEEKLY) ⇒ Object
Methods inherited from WithholdingTax
Methods included from FrequencyConversions
#convert_annually_to_annually, #convert_annually_to_fortnightly, #convert_annually_to_monthly, #convert_annually_to_weekly, #convert_fortnightly_to_annually, #convert_fortnightly_to_monthly, #convert_fortnightly_to_weekly, #convert_monthly_to_annually, #convert_monthly_to_fortnightly, #convert_monthly_to_weekly, #convert_weekly_to_annually, #convert_weekly_to_fortnightly, #convert_weekly_to_monthly
Constructor Details
Instance Method Details
#acc_payable ⇒ Object
36 37 38 |
# File 'lib/formulas/paye.rb', line 36 def acc_payable annual_gross_pay > MAX_ACC_LEVY_PAYABLE ? MAX_ACC_LEVY_PAYABLE : annual_gross_pay end |
#levy ⇒ Object
32 33 34 |
# File 'lib/formulas/paye.rb', line 32 def levy 0.0139 end |