Delete Pay Items
Batch soft-delete CALLER pay-items of a DRAFT pay run by id and/or caller key: marks them is_deleted (retained for audit, excluded from reads), not a hard delete. Idempotent, with a per-target outcome; a VALUED, STANDING or ADMIN_ENTRY item is refused. The payslips in the run of the employees whose lines were deleted are deleted, so calculate the run again before approving it.
Refused (409 INVALID_TRANSITION) for a pay run that is not DRAFT, one being
calculated included, as on adding pay items. Refused whole (409), deleting
nothing, when the payslip of an employee whose line would be deleted was calculated
with prior-period NI-able earnings supplied through submit: deleting it would drop
them. Submit that employee’s items with the prior-period NI-able earnings instead.
Refused whole (409 GB_MAIN_PAY_ITEMS_HOLD_NMW_HOURS) when it would leave a positive
pay main run no pay items for an employee whose minimum wage hours an approved
supplementary run of the period left to the main run. A draft supplementary that left
them there has its payslip for the employee deleted, so it is calculated again; while
a run of the period is being calculated for the employee, the delete is refused (409
RESULT_NOT_CALCULATED, params.reason OTHER_RUN_CALCULATING): retry once it has
finished.