Create Payrun
Create a DRAFT pay run and its payroll status.
A MAIN run is the period’s regular run and pays on the pay calendar’s pay date; a pay
calendar and pay group have one MAIN run unless it is cancelled. A SUPPLEMENTARY run is
an extra run in the same period, created once the MAIN run exists, and pays on
payment_date: not before today (UK time), Monday to Friday, in the tax month (tax
week for a weekly pay group) of the calendar’s pay date and, for a pay group whose
pension pay reference period is the pay period (pension_prp_method METHOD_A), in
the pay period containing that date, not on the date of another run
of the calendar and pay group nor on the calendar’s deposit date (the day the main
run’s money reaches the bank), and not before the payment date of a run of the pay
group already approved, in any of its calendars: runs are approved in payment order.
A date outside these bounds is refused with 422 VALUE_OUT_OF_RANGE on payment_date,
whose params.reason is IN_PAST, NOT_BANKING_DAY, OUTSIDE_TAX_PERIOD,
OUTSIDE_PAY_PERIOD or BEFORE_APPROVED_RUN, with the allowed bound in
params.min and params.max where there is one. When the period has no date left at
all (every allowed weekday has passed, is before an approved run of the pay group, or
is taken by the calendar’s runs), any date is refused with params.reason
NO_DATE_LEFT, the window in params.min and params.max: pay the
amount in the next period’s runs. A second MAIN run, or a date another run of the
calendar and pay group pays on (the calendar’s pay date or deposit date for the MAIN
run), is refused with 409 DUPLICATE_DEFINING_ATTRIBUTES.
Employees paid by a supplementary run keep their salary and statutory pay in the MAIN run unless they are moved, with one exception: once the MAIN run is approved, the first supplementary run that calculates an employee whose salary and statutory pay the MAIN run did not calculate (it holds none of their standing or calculated pay items, for instance a new starter, or an employee it paid only pay items while another run held their salary) pays their salary and statutory pay for the period. For a weekly pay group whose MAIN run pays on the last working day of its tax week, no supplementary run can follow the approved MAIN run in that week (an earlier date pays before it, a later one is in the next tax week). The next period’s MAIN run pays only its own period, so an employee the approved MAIN run did not pay needs a back-pay item there for the missed week. Likewise, for a Method A pay group whose MAIN run pays on the last working day of its pay period, no date is left once it is approved: a later amount is paid in the next period’s runs.
Body
SUPPLEMENTARY only, and required for it: the date the run pays. Not before today, Monday to Friday, in the tax period (tax month, or tax week for a weekly pay group) of the pay calendar's pay date and, for a pay group whose pension pay reference period is the pay period (METHOD_A), in the pay period containing that date, not the date of another run of the pay calendar and pay group nor the calendar's deposit date (the day the main run's money reaches the bank), and not before the payment date of a run of the pay group already approved, in any of its calendars. A MAIN run pays on the calendar's pay date.
Response
Successful Response