Function: closeAndLockBatch()
closeAndLockBatch(
batchId):Promise<PayrollActionState>
Defined in: src/server/actions/payroll.ts:229
Owner-only: Close & lock a DRAFT pay run. Reads the priced snapshot Prepare stored on the batch
(assignment ids, entry count, hours), then via close_and_lock_payroll_batch verifies the
period's CURRENT entries still match that snapshot (so any drift since Prepare is refused), locks
the period's paid entries, refreshes the batch total (base + adjustments), and advances it to
prepared (ready to download the Wise file and fund). The Wise file is downloadable afterward.
Parameters
batchId
string
Returns
Promise<PayrollActionState>