Class: PayrollParameter
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- PayrollParameter
- Includes:
- HasProvince, PayrollParametersProcedures
- Defined in:
- app/models/payroll_parameter.rb
Class Method Summary collapse
-
.health_and_safety_reference_for_role(employee_role_id) ⇒ Object
to be deleted as this has been moved to the company level.
-
.health_and_safety_references ⇒ Object
to be deleted as this has been moved to the company level.
Instance Method Summary collapse
Methods included from PayrollParametersProcedures
Methods inherited from ApplicationRecord
define_decrypted_attribute, define_decrypted_attributes, #errors_in_bullet_points, primary_connection, special_connection
Class Method Details
.health_and_safety_reference_for_role(employee_role_id) ⇒ Object
to be deleted as this has been moved to the company level
33 34 35 36 37 |
# File 'app/models/payroll_parameter.rb', line 33 def health_and_safety_reference_for_role(employee_role_id) employee_role = EmployeeRole.find(employee_role_id) employee_role_reference = employee_role.health_safety_reference_code health_and_safety_references.find_by(reference_code: employee_role_reference) end |
.health_and_safety_references ⇒ Object
to be deleted as this has been moved to the company level
21 22 23 24 25 26 27 28 29 30 |
# File 'app/models/payroll_parameter.rb', line 21 def health_and_safety_references PayrollParameter.where( code: 'cnsst_percentage' ).select( :payroll_parameter_id, :value, :reference_code, :description ) end |
Instance Method Details
#reference_description ⇒ Object
14 15 16 17 |
# File 'app/models/payroll_parameter.rb', line 14 def reference_description percentage = value.to_f "#{percentage}% - #{description}" end |