lib/train/tax/calculator.rb in train-tax-calculator-2.0.1 vs lib/train/tax/calculator.rb in train-tax-calculator-2.0.2
- old
+ new
@@ -13,11 +13,11 @@
hash[:sss] = for_sss_es(basic_salary)
hash[:philhealth] = for_philhealth(basic_salary)
hash[:pagibig] = for_pagibig(basic_salary)
hash[:total_deductions] = hash[:sss] + hash[:philhealth] + hash[:pagibig]
hash[:withholding_tax] = withholding_tax(basic_salary)
- hash[:net_income] = net_income(basic_salary)
+ hash[:net_income] = basic_salary - hash[:withholding_tax]
hash
end
private
@@ -35,13 +35,9 @@
taxable_income = basic_salary - deductions
compute_withholding_for(taxable_income).round(2)
end
- def net_income(basic_salary)
- basic_salary - withholding_tax(basic_salary)
- end
-
def compute_withholding_for(income)
if income >= HIGHEST_BRACKET
200_833.33 + ((income - HIGHEST_BRACKET) * 0.35)