module SingaporeCharitableDonations::Calculators::MBMF::Year2016Calculator

Mosque Building and Mendaki Fund contribution calculator for June 1st, 2016 onwards

Constants

CUTOFF_DATE

Public Class Methods

applies_to?(date, type) click to toggle source

@param [Date] date to be considered for calculation @param [String] type of charitable contribution @return [TrueClass, FalseClass]

# File lib/singapore_charitable_donations/calculators/mbmf/year_2016_calculator.rb, line 35
def applies_to?(date, type)
  date >= CUTOFF_DATE && type == 'MBMF'
end
calculate(total_wages) click to toggle source

@param [BigDecimal] total_wages @return [BigDecimal] contribution amount

# File lib/singapore_charitable_donations/calculators/mbmf/year_2016_calculator.rb, line 11
def calculate(total_wages)
  case
  when total_wages <= 1_000.00
    BigDecimal "3.00"
  when total_wages <= 2_000.00
    BigDecimal "4.50"
  when total_wages <= 3_000.00
    BigDecimal "6.50"
  when total_wages <= 4_000.00
    BigDecimal "15.00"
  when total_wages <= 6_000.00
    BigDecimal "19.50"
  when total_wages <= 8_000.00
    BigDecimal "22.00"
  when total_wages <= 10_000.00
    BigDecimal "24.00"
  else # total_wages >= 10_000.00
    BigDecimal "26.00"
  end
end