Sha256: 1d0ff70c4f1b1581311e9b1eeb04b9a8512603e3d25cdcc3756880a03c641b30

Contents?: true

Size: 808 Bytes

Versions: 2

Compression:

Stored size: 808 Bytes

Contents

require "train/tax/calculator/version"
require "train/tax/calculator/philhealth"
require "train/tax/calculator/pagibig"
require "train/tax/calculator/sss"
require "train/tax/calculator/deductions"
require "train/tax/calculator/withholding_tax"

module Train
  module Tax
    module Calculator

      def self.call(basic_salary)
        hash = Hash.new

        hash[:sss]              = Sss.compute_employee_share(basic_salary)
        hash[:pagibig]          = Pagibig.compute(basic_salary)
        hash[:philhealth]       = Philhealth.compute(basic_salary)
        hash[:total_deductions] = Deductions.get(basic_salary)
        hash[:withholding_tax]  = WithholdingTax.compute(basic_salary)
        hash[:net_income]       = basic_salary - hash[:withholding_tax]

        hash
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
train-tax-calculator-2.2.4 lib/train/tax/calculator.rb
train-tax-calculator-2.2.2 lib/train/tax/calculator.rb