Move Employees
Move employees, with all their pay items, from from_payrun_id to this pay run.
from_payrun_id must name another run than this one (otherwise 422 INVALID_FIELD_DEPENDENCY
on from_payrun_id). Both runs must be of the same pay calendar and pay group (otherwise 422
INVALID_REFERENCE on from_payrun_id, params.reason OTHER_PARENT), and both must be
DRAFT: a run that is not, one being calculated included, is refused with 409
INVALID_TRANSITION, naming the source when it is not DRAFT, else the target. Either may be the
MAIN run. Each named employee must hold pay items in from_payrun_id. Every pay item the
employee holds there moves: the items added to that run and, from the run that pays their salary
and statutory pay for the period, the standing and calculated pay items it wrote when it
calculated them. Those make this run pay the employee’s salary and statutory pay for the period
instead. Moving an employee out of a run that holds only items added to it, such as back to the
MAIN run, moves those items alone. Their payslips in both runs are deleted, so calculate both
runs again before approving them.
Refused whole, moving nobody (409), for an employee when all of these hold:
from_payrun_id is the MAIN run and pays their salary and statutory pay for the
period, it holds none of their standing or calculated pay items, and it holds no
payslip for them: it has not calculated them yet. Calculate it first, so those items
exist and move with the employee. Moving out of a supplementary run is never refused
for this reason. Also refused whole (409) when two pay items of an employee
would share a wage type code and external_ref in this run, or for an employee
calculated with prior-period NI-able earnings supplied through submit, and (409
GB_MAIN_PAY_ITEMS_HOLD_NMW_HOURS) for an employee moved out of a positive pay MAIN
run whose minimum wage hours an approved supplementary run of the period left to the
MAIN run (a draft one has its payslip for them deleted, to calculate again), and (409
RESULT_NOT_CALCULATED, params.reason OTHER_RUN_CALCULATING) while a run of the
period is being calculated for such an employee.