Class: HrLite::LeaveYearRolloverJob
- Inherits:
-
ActiveJob::Base
- Object
- ActiveJob::Base
- HrLite::LeaveYearRolloverJob
- Defined in:
- app/jobs/hr_lite/leave_year_rollover_job.rb
Overview
Leave-year rollover (host schedules it on the leave year's first day — Jan 1 for calendar years, Jul 1 for July–June years): materialize carry-forward into the new year's balance rows. Idempotent — a balance whose carry has already been written is never touched again (manual adjustments stay safe).
Instance Method Summary collapse
Instance Method Details
#perform(year: nil) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'app/jobs/hr_lite/leave_year_rollover_job.rb', line 10 def perform(year: nil) # Resolve "today" in the HR time zone — cron often fires around the # boundary midnight, and the host process may run in UTC. Time.use_zone(HrLite.config.time_zone) do year ||= LeaveYear.current_key previous_year = year - 1 roll(year, previous_year) end end |