Labor rules define the day/night bands, maximum workdays, surcharges and tolerances FileXpress uses to classify attendance. See Labor rules in the manual.
List company rules
hr.labor_rules
Returns all of the company’s effective periods (most recent first), which one applies today and the effective rules.
List country templates
hr.labor_rules
Returns a list of objects with the same format as
rule_sets (with business_id: null and is_template: true). Colombia has several templates with successive effective periods.
Query the rules in effect on a date
hr.labor_rules
source indicates where the parameters come from: business (the company’s own rules), template (the country template) or default (system defaults; rule_set is null).
Copy from template
hr.labor_rules.write
Behavior
- Creates a company effective period with the template’s parameters and an indefinite duration.
- If the company has an open active period (no end date) that starts earlier, it is closed the day before
effective_from. - Queues the recalculation of the affected attendance.
201: the created rule set, with recalculation_queued.
Create rules
hr.labor_rules.write
Parameters
All minutes are integers; surcharges are an additional fraction over the ordinary daytime hour (0.25 = +25%).
Response
201: the created rule set (same format as rule_sets) plus recalculation_queued (true if the recalculation of the affected attendance was queued).
Edit rules
hr.labor_rules.write
Send only the fields that change. If you send params, it must be complete (it replaces the previous ones). Only company periods can be edited, not templates.
- If attendance has already been calculated in the period, it is recalculated (the last 90 days at most). Days included in processed or paid payrolls do not change.
200: the updated rule set, with recalculation_queued.