Magidoc

postWipBatch
Mutation

Posts WIP to the ledger, either way round: pass batchId to post a batch already prepared as a draft — it keeps its own document number and claims its source lines — or pass input to prepare and post in one step. Exactly one of the two. Claiming the source lines is what stops a second batch billing the same work, so a line another batch already took makes the whole post refuse. Access: signed-in members of the batch's workspace with the accountingPost permission, in a workspace where finance is enabled. Errors: neither batchId nor input given, or both; WIP batch not found; batch is no longer prepared, which is also what a losing race sees; batch nets to zero; WIP settings incomplete — posting needs both a WIP asset and a revenue account; no approved, unbilled worksheet lines eligible; one or more source lines already posted to WIP or belonging to another project; posting date inside closed books; and a refusal to post at all when the deployment cannot run the write in a transaction, which keeps the journal, the line claim, and the batch together.

Arguments

#

workspaceId

ID !
Non-null

batchId

Response

#

Returns WipPostingBatch !.

Example

#