Order Lifecycle
The order lifecycle is the sequence of stages each order passes through — from creation to completion.
At each stage the system automatically performs actions: reserves resources, writes off raw materials, creates documents, and calculates cost price.
The order lifecycle ties together all modules: Orders, Calculations, Inventory, and the Telegram Bot.
Overview
New → In Progress → Ready → Delivery → Completed
Every transition between statuses triggers business logic.
Why This Matters
The order lifecycle allows you to:
- automate accounting without manual actions
- avoid errors when working with inventory
- control order execution at every stage
- generate documents automatically
- calculate cost price accurately
Stage 1: New — Order Created
The order has just been created.
What Happens
- client information is saved
- products or services are added
- no documents are created yet
What You Can Do
- edit the order freely
- add or remove line items
- change date and time
Stage 2: In Progress — Ingredients Reserved
The order has been accepted for production or execution.
This is when calculations are analyzed and inventory is reserved.
What the System Does
- analyzes the calculation (recipe) for each product
- calculates raw material requirements
- identifies shortages
- reserves raw materials and semi-finished goods in inventory
What This Gives You
- prevents write-off conflicts across concurrent orders
- shows what needs to be purchased
- supports production planning
Additional Options
- you can change the calculation
- you can substitute ingredients
- you can choose inventory mode (strict or allow negative stock)
Stage 3: Ready — Ingredients Written Off
The product or service has been completed.
This is when inventory write-offs happen.
What the System Does
Documents are created automatically:
- production output document
- raw material write-off document
How It Works
- the calculation is used to determine write-off amounts
- semi-finished good nesting is fully resolved
- write-offs follow actual production norms
Result
- inventory balances are updated
- cost price is recorded
Stage 4: Delivery — Sales Document Created
The order has been handed over or shipped to the client.
What the System Does
- a sales document is created
Recorded
- sale amount
- preliminary cost price
Stage 5: Completed — Order Closed
The order is closed.
What Happens
- the sale is finalized
- final metrics are recorded
Result
- the order is closed
- data is available in reports
Automatic Documents Summary
The system creates documents without any user action:
| Stage | System Action |
|---|---|
| In Progress | Resource reservation in inventory |
| Ready | Production output, Raw material write-off |
| Delivery | Sales document creation |
| Completed | Sale finalization |
Module Relationships
The order lifecycle connects all system modules:
- Orders — the object being managed
- Calculations — determine composition and consumption
- Inventory — tracks and records resource movement
- Telegram Bot — the interface for status transitions
Rollback
You can move an order back to a previous status.
What the System Does
- deletes related documents
- recalculates balances in inventory
- preserves data integrity
Examples
- "Ready" → "In Progress" → production documents are deleted
- "Delivery" → "Ready" → the sales document is deleted
Inventory Modes
Strict Mode
- inventory balances are enforced
- accurate cost price
Allow Negative Stock
- inventory does not block operations
- orders can proceed even with insufficient stock
⚠️ May result in inaccurate cost price. See Inventory for details.
Typical Scenarios
Multiple Concurrent Orders
- the system reserves resources per order
- prevents double write-offs
Raw Material Shortage
- the system shows the deficit
- you can:
- replenish inventory
- change the calculation
- switch to "allow negative stock" mode
Changing an Order
- only possible in "New" status
Key Idea
You never need to manually:
- write off raw materials
- create accounting documents
- calculate cost price
The system performs all of this automatically on each status transition.
Related Sections
- Orders — order creation and management
- Calculations — recipes, norms, and cost calculation
- Inventory — stock balances, write-offs, and documents
- Telegram Bot — managing statuses via chat
FAQ
When are raw materials written off? At the "Ready" stage.
When is the sales document created? At the "Delivery" stage.
Can I edit an order after moving it to "In Progress"? No, editing is only allowed in "New" status.
What happens when I roll back to a previous stage? The system deletes related documents and recalculates inventory balances.