Orphaned Posting Cleanup
Remove accounting postings left in Draft status by an interrupted save
Overview
This task removes accounting postings that are still in Draft status after a configured number of minutes, together with their ledger lines. A posting is saved as a draft first and becomes final when all its lines are written; a draft only remains when that save is interrupted. Draft postings are never returned by the Accounting API, and removing them keeps the posting store free of incomplete vouchers.
Identifier
| Property | Value |
|---|---|
| Implementation Type | OrphanedPostingCleanupScheduledTask |
| Group | Accounting |
| Type | Delta |
When to Use
Enable this task when you need:
- Removal of incomplete postings after an interrupted save
- A clean set of postings for exports and reconciliation
Configuration Properties
This task has no properties of its own. It is controlled by the tenant's accounting settings:
| Setting | Location | Description |
|---|---|---|
postingEnabled | accountingSettings.postingEnabled | Master switch. When off, the task does nothing. |
draftOrphanTimeoutMinutes | accountingSettings.draftOrphanTimeoutMinutes | Minutes (default 10) a posting must have been in Draft before it is removed. |
Behavior
What It Does
- Completes without doing anything unless
postingEnabledis on - Finds postings in
Draftstatus older thandraftOrphanTimeoutMinutes - Checks each one again, and skips it if it has meanwhile moved past
Draft - Deletes each remaining draft posting and its ledger lines
- Logs a draft that cannot be deleted and retries it on the next run
Prerequisites
accountingSettings.postingEnabledmust be on
Side Effects
- Permanently deletes draft postings and their ledger lines
- Does not affect postings in any other status
Example Configuration
Recommended Schedule
Run every hour (0 * * * *). Draft postings are rare, and the task does no work when there are none.
Related Tasks
- Web Fulfillment Posting - Generate the daily web-fulfillment postings