Sha256: 2e855e2952cac57fabf705357fc7119e3f78d350d55864dd2ebebbce22d1df8c
Contents?: true
Size: 1.52 KB
Versions: 32
Compression:
Stored size: 1.52 KB
Contents
module Ecom module Core class Company < ApplicationRecord # The settings attribute is a json string containing setting key value # pairs. The valid settings are: # payroll_periods => a list of payroll period values. Each # payroll period has the following entries: # order: A numeric value indicating the order of the period. # date: A numeric value indicating the date of each month which # upto which timesheet data is used for payroll calculation # for the specific period. # comparison: One of [:exact, :days_before_month_end]. :exact will # force calculations to be made upto the exact mentioned date # value, whereas :days_before_month_end is often used for last # period payroll calculation and we want to specify on which date # before the end of the month we have to limit timesheet data to # calculate payroll. E.g. 3 days before month end would be 27th # for september and 28th for october. # # period_count - the total number of periods per month for payroll. # this value should align with the defined payroll periods. # has_many :projects validates :code, :name, :address, :telephone, presence: true validates :code, :name, uniqueness: true def valid_settings? settings['payroll_periods'].count == settings['period_count'] end end end end
Version data entries
32 entries across 32 versions & 1 rubygems