POS + General Ledger + Inventory + Payroll — All Included on Every Plan | Free Updates Forever

Understanding the Order Status Workflow

Understanding the Order Status Workflow

When a user changes the order status on an invoice, AccuArk does not simply update a database field. The system runs a multi-step process that validates preconditions, executes inventory actions, updates the invoice, and records a history entry — all within a single atomic database transaction. This article explains each step in detail so you understand exactly what happens behind the scenes during a status change.

How Status Changes Work Step by Step

Every status change is processed by AccuArk's status engine. Here is the sequence of operations that occur when a user selects a new status from the dropdown on the invoice form:

Step 1: User Selects New Status

The invoice form displays a status dropdown containing all configured order statuses. The user selects the desired target status from this dropdown. The system reads the status ID and begins the transition process.

Step 2: System Validates Preconditions

Before any changes are made, the system checks two gates:

  • Deposit Gate — If the invoice has a required deposit that has not been fully collected, the system checks whether the target status involves an inventory action (reserve or subtract). If it does, the transition is blocked and the user receives an error message stating the remaining deposit amount that must be collected first. Statuses with "none" or "release" inventory actions are not blocked by the deposit gate, so you can always cancel an order or move it to a non-inventory status even without a deposit.
  • Customer Approval Gate — If the target status has the Requires Customer Approval flag enabled, the system checks whether the invoice's customer approval status is "approved." If the customer has not approved the invoice, the transition is blocked and the user receives an error message explaining that customer approval must be obtained first.

If either gate blocks the transition, the process stops immediately. No changes are made to the invoice, inventory, or history.

Step 3: System Loads Target Status Configuration

The system loads the complete configuration of the target status from the database. This includes the inventory action type, the Subtract On Enter flag, the Is Edit Lock flag, and all other settings. If the target status cannot be found in the database, the transition fails with an error.

Step 4: Execute Inventory Action

If the target status has an inventory action other than "none," the system loads all invoice line items and executes the configured action:

  • Reserve — Creates reservation records for each physical item. Service items and items with zero or negative quantity are skipped.
  • Subtract — When Subtract On Enter is true, releases existing reservations (marking them as "fulfilled") and subtracts stock from inventory using the the batch processing engine. Each subtraction creates an audit trail record.
  • Release — Releases all active reservations for the invoice, marking them as "released."

See the Status-Driven Inventory Actions article for full details on each action type.

Step 5: Update Invoice Status

The system updates the invoice record in the database with the new status ID. At the same time, it sets the invoice's IsClosed field based on the target status's Is Edit Lock flag. If the status has edit lock enabled, IsClosed is set to 1 (true). If not, IsClosed is set to 0 (false).

Step 6: Record Status History

A new record is inserted into the invoice_status_history table capturing the previous status ID, the new status ID, the user who made the change, the timestamp, and any notes the user provided. This creates a permanent audit trail of every status transition.

Step 7: Commit or Rollback

All of the above operations — inventory action, invoice update, and history record — execute within a single database transaction. If every step succeeds, the transaction is committed and all changes become permanent simultaneously. If any step fails (for example, a database error during inventory subtraction), the entire transaction is rolled back. This means the invoice status remains unchanged, no inventory was modified, and no history entry was created. The atomicity guarantee ensures that the system never ends up in a partially updated state.

The Deposit Gate

The deposit gate exists to prevent stock from being committed before the customer has provided a financial commitment. When an invoice has the DepositRequired flag set and the DepositCollected amount is less than the DepositAmount, the system will not allow transitions to statuses with "reserve" or "subtract" inventory actions.

This design means you can still move the invoice to statuses with no inventory impact (like "Pending Review" or "Awaiting Approval") without collecting a deposit. The gate only activates when the status change would affect inventory.

To advance past the deposit gate, use the Collect Deposit feature on the invoice to record one or more deposit payments until the required amount is met. Once the deposit is fully collected, all status transitions become available.

The Customer Approval Gate

Statuses that have the Requires Customer Approval flag will not accept an invoice unless its Customer Approval Status is "approved." This gate works independently from the deposit gate — both must pass for the transition to proceed.

The customer approval gate ensures that work does not begin, materials are not consumed, and stock is not committed until the customer has explicitly signed off on the invoice. This is particularly important for custom orders, large projects, or any situation where the customer needs to review and agree to the scope and pricing before the business proceeds.

To satisfy this gate, submit the invoice for customer approval using the Customer Approval form. Once the customer approves, the approval status updates to "approved" and the gate opens.

Edit-Lock Behavior

When an invoice enters a status with Is Edit Lock enabled, the invoice's IsClosed flag is set to 1. The invoice form detects this flag and disables editing of line items, pricing, customer information, and other invoice fields. The invoice becomes read-only.

If a user needs to make corrections to an edit-locked invoice, they can use the Unlock button on the invoice toolbar. The Unlock action requires appropriate permissions and is itself logged, so there is an audit trail of who unlocked an invoice and when.

Edit locking is designed to protect invoices in later workflow stages. Once an order has been shipped, for example, changing the line items could create discrepancies between what was shipped and what the invoice records. Edit locking prevents these inconsistencies.

Status Dropdown on the Invoice Form

The status dropdown on the invoice form displays all configured order statuses. The user can select any status from the list. If the transition is blocked by a gate, the user receives a clear error message explaining why and what action is needed to unblock it.

Before executing the transition, the system displays a confirmation dialog that includes a description of the inventory action that will occur (if any). For example, the confirmation might read "Stock will be RESERVED for this invoice (not yet subtracted from inventory)." This gives the user a chance to review and cancel before committing to the change.

Summary of the Status Change Flow

The complete flow in order is:

  1. User selects new status from dropdown.
  2. Deposit gate validates (blocks if deposit insufficient for inventory-impacting statuses).
  3. Customer approval gate validates (blocks if approval required but not obtained).
  4. Target status configuration loaded from database.
  5. Inventory action executed (reserve, subtract, or release).
  6. Invoice status updated in database.
  7. Status change recorded in history table.
  8. All changes committed atomically — if any step fails, everything rolls back.

This transactional design ensures data integrity across invoices, inventory, and audit history at every status transition.

What to Read Next

  • Configuring Order Statuses — Create and configure the statuses that define your workflow.
  • Status-Driven Inventory Actions — Detailed explanation of reserve, subtract, and release operations.
  • Viewing Invoice Status History — Access the complete audit trail of status changes.
Was this article helpful?
Back to Complex Invoicing Contact Support
Please note: This article is intended as a general guide. AccuArk© is continuously improved through regular software updates, so some screens, labels, or features described here may appear slightly different in your version. If something doesn't match or you need further assistance, please don't hesitate to contact our support team.
Still need help?

Our support team is ready to assist you.

Submit a Ticket