Class: SalaryBookingTemplate

Inherits:
BookingTemplate
  • Object
show all
Defined in:
app/models/salary_booking_template.rb

Constant Summary collapse

OBLIGATION_FLAGS =

Obligation flags

[:for_gross_income, :for_ahv, :for_uvg, :for_uvgz, :for_ktg, :for_deduction_at_source]

Instance Method Summary collapse

Instance Method Details

#obligationObject



12
13
14
15
16
17
18
19
# File 'app/models/salary_booking_template.rb', line 12

def obligation
  result = []
  OBLIGATION_FLAGS.each do |flag|
    result << flag.to_s if self[flag]
  end

  result
end

#obligation=(value) ⇒ Object



6
7
8
9
10
# File 'app/models/salary_booking_template.rb', line 6

def obligation=(value)
  OBLIGATION_FLAGS.each do |flag|
    self[flag] = value.include?(flag.to_s)
  end
end