Appearance
Inventory Posting and Account Resolution
This page records the source-confirmed posting rules shared across Inventory and source modules.
Posting prerequisites shared by stock movements
- The document exists and is in Draft status.
- The user has Post permission and server-side authorization passes.
- Every item, variant, UOM, and warehouse referenced by a line is active and valid at posting time.
- The UOM has a non-zero base calculation/conversion; posting converts entered quantity to base quantity.
- The Accounting module is accessible because Inventory posting creates journals.
- The transaction date resolves to a valid financial-year period.
- The warehouse has a Warehouse GL account.
- No open Inventory Reconciliation blocks movement in the warehouse.
- A warehouse opening balance has been posted before Stock In where the validator requires it.
- Tracked quantities, serial uniqueness, expiry data, and available balances pass validation.
If any prerequisite fails, posting must stop before committing the document, stock, or journal. Source-document flows use a shared unit of work and SaveToContext=false to allow the calling transaction to commit all effects together.
Account matrix
| Posting source | Debit | Credit | Resolution/fallback |
|---|---|---|---|
| Manual Stock In | Warehouse GL | Operational Tag GL | Both are mandatory; there is no item/category/settings fallback in this manual flow. |
| Manual Stock Out | Operational Tag GL, grouped by cost center | Warehouse GL | Both are mandatory. Each line's cost center is attached 100% to its debit group. |
| Sales Invoice Stock Out | Inventory Settings COGS | Warehouse GL | COGS must exist in Inventory General Settings. |
| Sales Return Stock In | Warehouse GL | Inventory Settings COGS | COGS must exist in Inventory General Settings. |
| Purchase Invoice Stock In | Warehouse GL | Inventory Settings Goods in Transit | Goods in Transit must exist. Landed-cost treatment may add expense-account credits described below. |
| Purchase Return Stock Out | Inventory Settings Goods in Transit plus landed-cost expense debits where applicable | Warehouse GL | Goods in Transit must exist. External landed-cost entries are separated by expense account/cost center. |
| Stock Transfer Stock Out | Inventory Settings Goods in Transit | Issued Warehouse GL | Creates the outbound half of the transfer. |
| Stock Transfer Stock In | Target Warehouse GL | Inventory Settings Goods in Transit | Creates the inbound half; combined transfer is quantity-neutral. |
| Reconciliation shortage | Inventory Settings COGS | Warehouse GL | Current code uses COGS for a negative variance. |
| Reconciliation surplus | Warehouse GL | Inventory Settings Goods in Transit | Current internal Stock In default uses Goods in Transit. |
| Inventory Opening Balance | No journal in the current handler | No journal in the current handler | Stock quantities and costs are created/updated only. This requires product-owner confirmation. |
Item/category/settings fallback chains
Fallbacks are transaction-specific; a generic fallback must not be assumed.
Landed-cost service expense
- Service item's
ItemExpenseAccountId. - Service item's category
ItemExpenseAccountId. - If neither exists, posting fails. Inventory General Settings is not a third fallback in this handler.
The cost center resolves as service item's cost center first, then category cost center.
Landed-cost vendor payable
- Vendor's payable account.
- Vendor category's payable account.
- If neither exists, posting fails.
Landed-cost VAT
The selected tax definition supplies the VAT GL account. Missing tax or tax account prevents a valid journal.
Stock valuation cost
- Weighted Average: use the warehouse/batch weighted-average cost.
- Last Purchase: use the warehouse/batch last-purchase cost.
- Transfer and reconciliation use the Inventory General Settings costing method.
- Tracked items resolve the applicable batch/serial stock; untracked items use the item/warehouse stock header.
- The selected UOM converts the base cost through its configured conversion ratio.
Atomic effects of Post
On successful posting, the system assigns/retains the transaction sequence, creates stock-detail history, updates aggregate and batch available quantities, updates applicable costs, creates and links the journal, records source-document IDs/codes, changes status to Posted, and saves the unit of work. A retry must not create a second effect because only Draft records are accepted.