xMatix
Sign in Request demo
xMatix
PRODUCTS
SalesField Sales & SFACRMRewardsClaimsInventoryProcurementWarehouse ManagementField ServiceServiceSupportTelephony & MessagingFinance & AccountingPayrollExpense ManagementCommercePortalsAnalytics & ReportingData StudioMobile AppSee all products →
PLATFORM
Platform overviewApp BuilderAutomationIntegrationsSecurity & GovernanceChange ManagementDevelopers
SENSE AI
Sense AI overviewSense AssistSense ControlSense VisionAI StudioTrust & governanceIn Claude & ChatGPTUse cases
SOLUTIONS
Auto DMSConsumer Goods DMSSales Force Automation (SFA) FMCG & DistributionManufacturing & Dealer NetworksAutomotive & DealershipsPharma & HealthcareConsumer DurablesAgri-InputsBuilding MaterialsService NetworksWarehousing & 3PLFinancial AccountingERP SoftwareIndia GST ComplianceUAE VAT & e-InvoicingSaudi ZATCA & VATAll solutions →
RESOURCES
Knowledge CenterDeveloper & CLIBlogGuidesWhat is xMatix?Company facts
COMPANY
AboutCareersPartnersEventsContactAuthorsLegal
Sign in Request demo
Home/Docs/Inventory/Inventory ledger settings (posting rules)
REFERENCE · Last reviewed

Inventory ledger settings (posting rules)

Inventory ledger settings are the posting rules that turn a document line into inventory ledger entries: each rule says which line it watches, which movement type it writes, which quantity it posts and which stock balance buckets go up or down. Documents such as goods receipts, invoices, delivery orders, adjustments and transfers create the lines; the rules decide what posting those lines does to stock. You read them when a stock figure surprises you and you need to know why a document posted — or did not post — a movement.

Overview

xMatix ships 56 rules. Every rule belongs to one kind of document line (the Entity) and writes one Ledger Type. One line type usually has several rules, each with a Condition that picks out one situation. For example, a goods receipt line posted against a purchase order matches a different rule from one received against a shipment. When a line is posted, every active rule for its line type whose condition the line meets writes its own ledger entry.

The rules are platform configuration. Setup → Feature Hub → Inventory → Inventory Ledger Settings lists them and opens each one in a read-only dialog, and the page header says so: Inventory ledger settings are managed in code and are read-only. You can view them here but not create, edit or delete them. The server refuses changes from every user, administrators included.

When to use it

  • A bucket moved and you don't know why. Find the rule that adds to or takes from that bucket for the line type involved.
  • A line posted nothing. Check whether any active rule's condition fits the line. If none does, posting skips it and the line gets no Inventory Ledger reference.
  • *A ledger entry has Inventory Stock Posted unchecked.* Look at the rule that wrote it. A rule that only takes from a bucket leaves that box unchecked even though the bucket moved.
  • You are planning a process change, such as invoicing before delivery or receiving against shipments. The rules show which buckets each route will move.

How xMatix handles it

What happens when a line is posted

  1. xMatix loads the active rules for the line's type, ordered by Sequence and then by Label.
  2. A line with no item is skipped, and so is a line whose item has Track Inventory turned off. If the item has Track Lots on and the line has no lot, posting stops with Product Lot was not selected for the transaction. This is required for Inventory posting.
  3. For each rule, xMatix checks the save event (see below) and then the Condition. A rule with an empty condition always matches.
  4. A matching rule reads the company and branch from the Parent Entity (the header document) and the quantity from the Quantity Field. If the line has a Cancelled Quantity, that is subtracted first.
  5. The rule writes one ledger entry of its Ledger Type. It adds the quantity to the Increment Field buckets and subtracts it from the Decrement Field buckets, on the stock record and on the line's item lot. If the stock record doesn't exist yet, xMatix creates it.
  6. If a bucket would go below zero, posting stops with Insufficient stock: <bucket> cannot go negative (result: <value>). and nothing from that save is posted.

The first entry written for a line is stamped on the line as its Inventory Ledger reference. That reference is how xMatix knows the line has been posted.

Save events: why most documents post through an action

Each rule subscribes to save events with On Create, On Update and On Delete:

  • On Create — the rule posts as soon as the line is first saved. Only the allocation, picking and inspection line rules use it, so those lines move stock the moment they are saved.
  • On Update — the rule posts when the line is passed to posting after it was created. That happens when someone runs the document's stock action (Post Inventory, Receive, Release Outward and so on), and when a later edit to a line makes the document re-post it. Every other seeded rule is update and delete only. That is why creating a goods receipt, invoice or adjustment moves no stock until its action runs.
  • On Delete — deleting a posted line reverses what it posted. Deleting a line that was never posted does nothing to stock.

Changes post reversals, not edits

When a posted line is posted again (because its quantity, cost, item, branch or location changed), each matching rule compares what the line posted before with what it would post now. If nothing changed, nothing is written. Otherwise the rule writes a negated entry for each earlier entry of its ledger type, which moves the buckets back, and then a fresh entry for the new values. A line whose quantity is now zero, for example because it was fully cancelled, gets only the reversal. The ledger page explains how to read these pairs.

Two kinds of counter reference

A rule can name its buckets in two ways: as a linked stock field, or as a stored list of bucket names. The linked field wins when both are set. The view dialog shows only the linked field. So a rule can move a bucket that the dialog's Increment Field or Decrement Field leaves blank. Three seeded rules work this way: the invoice line rules Sold (from Picked), Sold (from Allocation) and Sold (direct). They add to Sold Quantity and Pending Deliveries, but the dialog shows an empty Increment Field. The tables below list the full effect of each rule.

Prerequisites

  • Access to Setup. Reading the rules needs no further setup capability.
  • To trace a posting, access to the documents and to Inventory → Inventory Ledger.

Procedure

Step 1 — Open the rules

Go to Setup → Feature Hub → Inventory → Inventory Ledger Settings. The page header shows the read-only notice and chips for the rules you opened recently. The table lists every rule with Name, Label, Entity, Parent Entity, Ledger Type, Active, Created, Created By, Modified and Modified By. It is sorted by Label.

Step 2 — Find the rules for one kind of line

  • Search matches Name, Label and Ledger Type. Searching for Sold lists the five invoice line rules; searching for (goods receipt) lists the goods receipt receiving-difference rules.
  • Sort by Entity to group all the rules for one line type together. Entity can be sorted but not filtered.
  • Filter the Active column to Inactive to see the two rules that ship switched off.

Use the Label to tell rules apart. Several rules share a Name: all five invoice line rules are named Sold. Each label says what makes its rule different, such as Sold (from delivery order).

Step 3 — Open a rule

Select the rule's name, its View action (the eye icon), or one of its recent chips. The dialog View Inventory Ledger Setting: <label> opens with every field disabled:

  • Label, Name, Sequence
  • Ledger Type, Entity, Parent Entity
  • Quantity Field, Increment Field, Decrement Field
  • Active
  • Event Type: On Create, On Update, On Delete
  • Condition

The page address gains ?openId=<id>. Copy the address to share a link that opens the same rule.

Step 4 — Read the condition

The condition is a formula over the line's fields. It can also read fields of records the line links to, such as InventoryFulfilmentPickingLine.Quantity > 0. Read != null as "is filled in" and == null as "is empty". AND and && both mean "and". A rule posts only if its condition is true when the line is posted.

Step 5 — Trace a ledger entry back to its rule

  1. Open the entry in Inventory → Inventory Ledger and note its Ledger Type, its source document and Inventory Stock Posted.
  2. On Inventory Ledger Settings, search for that ledger type and find the rules whose Entity is the source line type.
  3. Compare the source line with each rule's condition. The rule whose condition the line meets wrote the entry. Its Increment Field and Decrement Field (plus any text list described above) are the buckets the entry moved.

Step 6 — Ask for a different posting behaviour

There is no front-end path to change a rule. If your process needs a line to post differently, raise it through your implementation or support channel. Often the answer is a different document route. For example, to bring a return back into stock, post an adjustment instead of relying on the credit note.

Fields

FieldWhat it meansNotes
LabelThe rule's display name, unique among the seeded rules.Says what distinguishes the rule, for example Inward (from Pipeline). Also the second sort key after Sequence.
NameInternal rule name.Not unique: rules for the same movement share it.
SequenceEvaluation order within the line type.Must be unique for the same Entity and Ledger Type.
Ledger TypeThe movement type written on the entry.Values used by the seeded rules: Adjustment, Allocation, Assemble, Damaged, Disassemble, Excess, Expired, Inspection, InTransit, Inward, OnHold, OnLoan, Outward, Picked, Pipeline, Purchased, Shortage, SoftCommit, Sold, TransferInward, TransferOutward.
EntityThe document line the rule watches.One rule covers one line type.
Parent EntityThe header the company and branch come from.Empty on the three transfer line types, which use the line itself.
Quantity FieldThe line field posted as the entry's quantity.Cancelled Quantity, where the line has it, is subtracted first.
Increment FieldThe stock bucket the quantity is added to.Shown as the bucket's label, such as Unbilled Receipts. May be blank when the rule names its buckets as a text list.
Decrement FieldThe stock bucket the quantity is taken from.As above.
ActiveWhether the rule posts.Inactive rules are ignored completely.
On Create, On Update, On DeleteThe save events the rule responds to.See Save events.
ConditionThe formula a line must meet.Empty means always.

The generated entity reference lists the stored fields.

Business rules

The tables list every seeded rule, grouped by line type. Adds to and Takes from use the bucket labels on the stock record. Events is U+D for update and delete, or C+U+D when the rule also posts on create.

Goods receipt and inspection lines

Parent: Goods Receipt. Events: U+D for receipt lines, C+U+D for inspection lines.

LabelLedger TypePosts when the line…QuantityAdds toTakes from
Inward (from Pipeline)Inwardis received against a shipment line that was postedSupplier QuantityUnbilled ReceiptsQuantity On Pipeline
Inward (purchase order)Inwardcomes from a purchase order line and has no pipeline quantityReceived QuantityUnbilled Receipts—
Inward (shipment)Inwardis received against a shipment line that was never postedSupplier QuantityUnbilled Receipts—
Inward (direct)Inwardhas no purchase order line, no shipment line and no pipeline quantitySupplier QuantityUnbilled Receipts—
Damaged (goods receipt)Damagedhas a Damaged QuantityDamaged QuantityDamaged Quantity—
Shortage (goods receipt)Shortagehas a Shortage QuantityShortage QuantityShortage—
Excess (goods receipt)Excesshas an Excess QuantityExcess QuantityExcess Quantity—
Inspection (pending)Inspectionis an inspection line with quantity to inspect and Inspection Done offInspection QuantityInspection—
Inspection (done)Inspectionis an inspection line marked done with nothing left to inspectInspection Quantityreverses the pending hold—

Bill and shipment lines

Events: U+D.

LabelLedger TypePosts when the line…QuantityAdds toTakes from
Purchased (direct)Purchasedis a bill line with no goods receipt lineQuantityPurchased Quantity—
Purchased (from goods receipt)Purchasedis a bill line raised from a goods receipt lineQuantityPurchased QuantityUnbilled Receipts
PipelinePipelineis a shipment lineQuantityQuantity On Pipeline—

Allocation and picking lines

Parent: Inventory Fulfilment, Order or Service Order, depending on where the line was created. Events: C+U+D.

LabelLedger TypePosts when the line…Adds toTakes from
Allocation (fulfilment)Allocationbelongs to a fulfilment (not a service order)Allocation Quantity—
Allocation (order)Allocationbelongs to a sales order line that has not postedAllocation Quantity—
Allocation (Release SoftCommit)Allocationbelongs to a sales order line that already postedAllocation QuantitySoftCommit
Allocation (service order)Allocationbelongs to a service order line that has not postedAllocation Quantity—
Allocation (service order, from SoftCommit)Allocationbelongs to a service order line that already postedAllocation QuantitySoftCommit
Picked (fulfilment), Picked (order), Picked (service order)Pickedis a picking line against an allocation linePicked QuantityAllocation Quantity

Delivery order lines

Parent: Delivery Order. Events: U+D.

LabelLedger TypePosts when the line…QuantityAdds toTakes from
Outward (direct)Outwardcomes from no pick, allocation or invoice lineQuantityUnbilled Dispatches—
Outward (from Picked)Outwardcomes from a picking lineQuantityUnbilled DispatchesPicked Quantity
Outward (invoiced, from PendingDeliveries)Outwardcomes from an invoice line (no pick or allocation)Invoiced Quantity—Pending Deliveries
Outward (from Allocation)Outwardcomes from an allocation line with nothing pickedQuantityUnbilled DispatchesAllocation Quantity

Invoice lines

Parent: Invoice. Events: U+D. All five post Quantity.

LabelLedger TypePosts when the line…Adds toTakes from
Sold (from Picked)Soldcomes from a picked allocation line and nothing is delivered yetSold Quantity, Pending DeliveriesPicked Quantity
Sold (from Allocation)Soldcomes from an allocation line with nothing picked and nothing deliveredSold Quantity, Pending DeliveriesAllocation Quantity
Sold (direct)Soldcomes from no pick, allocation or delivery order lineSold Quantity, Pending Deliveries—
Sold (from delivery order)Soldcomes from a delivery order line and has a delivered quantitySold QuantityUnbilled Dispatches
Sold (delivered on invoice)Soldhas a delivered quantity but no delivery order lineSold QuantityUnbilled Dispatches

An invoice that is not yet delivered therefore raises Pending Deliveries. The delivery order later raised from that invoice takes the quantity back out through Outward (invoiced, from PendingDeliveries).

Order and service order lines

Events: U+D.

LabelLedger TypePosts when the line…Adds toActive
SoftCommit (order)SoftCommitis a sales order lineSoftCommitNo — ships inactive
SoftCommit (service order)SoftCommitis a service order lineSoftCommitYes

Adjustment lines

Parent: Adjustment. Events: U+D.

LabelLedger TypePosts when the line…QuantityAdds toTakes from
Adjustment (stock in)Adjustmenthas no Adjustment Type and a positive quantityQuantityPositive Adjusted—
Adjustment (stock out)Adjustmenthas no Adjustment Type and a negative quantityQuantity—Negative Adjusted (recorded as a positive amount)
Damaged (adjustment)Damagedis type Damaged with a Damaged QuantityDamaged QuantityDamaged Quantity—
Shortage (adjustment)Shortageis type Shortage with a Shortage QuantityShortage QuantityShortage—
Excess (adjustment)Excessis type Excess with an Excess QuantityExcess QuantityExcess Quantity—
ExpiredExpiredis type Expired with an Expired QuantityExpired QuantityExpired Quantity—
OnHoldOnHoldis type OnHoldQuantityQuantity On Hold—
OnLoanOnLoanis type OnLoanQuantityQuantity On Loan—
AssembleAssembleis type AssembleQuantityAssembled In—
DisassembleDisassembleis type DisassembleQuantityAssembled In—

Note that Disassemble also adds to Assembled In; no seeded rule moves Assembled Out. A line of any other type (such as Part to Part from a claim settlement) matches no rule and posts nothing.

Transfer lines

No parent: each transfer line is its own header. Events: U+D, except InTransit.

LineLabelLedger TypePosts when the line…Adds toTakes from
Transfer Outward LineTransferOutward (outward line)TransferOutwardis released, not a Pending Deliveries Transfer (posts Current Released Quantity)Transfer Outward—
Transfer Outward LineTransferOutward (outward line, PendingDeliveries)TransferOutwardis released on a Pending Deliveries Transfer (posts Current Released Quantity)—Pending Deliveries
Transfer Outward LineInTransitInTransitnames a related branch or company (C+U+D)Transit— (ships inactive)
Transfer Inward LineTransferInward (inward line)TransferInwardis received, not a Pending Deliveries TransferTransfer Inward—
Transfer Inward LineTransferInward (inward line, PendingDeliveries)TransferInwardis received on a Pending Deliveries TransferPending Deliveries—
Transfer Inward LineDamaged / Shortage / Excess (transfer inward)Damaged, Shortage, Excesshas that receiving differenceDamaged Quantity, Shortage, Excess Quantity—
Transfer LineTransferOutward (transfer)TransferOutwardis not a Pending Deliveries TransferTransfer Outward—
Transfer LineTransferOutward (transfer, PendingDeliveries)TransferOutwardis a Pending Deliveries Transfer—Pending Deliveries
Transfer LineTransferInward (transfer)TransferInwardis not a Pending Deliveries TransferTransfer Inward—
Transfer LineTransferInward (transfer, PendingDeliveries)TransferInwardis a Pending Deliveries TransferPending Deliveries—
Transfer LineDamaged / Shortage / Excess (transfer)Damaged, Shortage, Excesshas that receiving differenceDamaged Quantity, Shortage, Excess Quantity—

A two-step transfer's in-transit quantity is kept by the transfer itself on the destination branch's stock record, not by the inactive InTransit rule. See Transferring stock between branches.

Lines with no rule

Credit Note Line has no rule, so a credit note never changes stock. Sales order lines have only the inactive SoftCommit (order) rule, so a sales order reserves nothing until it is allocated.

General rules

  • Every matching rule posts. Conditions are not exclusive. If two active rules for the same line type both match, the line writes two entries.
  • Inventory Stock Posted is ticked on an entry only when the rule added to at least one bucket. Entries from rules that only take from a bucket (Adjustment (stock out), Outward (invoiced, from PendingDeliveries), and the PendingDeliveries outward transfer rules) show it unticked, even though the bucket moved.
  • Unique sequence. A rule's Sequence must be unique for its Entity and Ledger Type. A duplicate is refused with Another Inventory Ledger Setting with the same Entity and Ledger Type already uses this Sequence. Sequence numbers must be unique within the same (Entity, Ledger Type) scope. This only matters when rules are delivered by a metadata package.
  • Ledger entries don't copy the rule's label. Renaming a rule's label doesn't change any existing entry.

Example

A distributor invoices 40 cartons of item Glass Jar 500 ml straight from a sales order allocation, before anything is picked, and delivers them the next day.

  1. The allocation line saved on the sales order matched Allocation (order) on create: Allocation Quantity rose by 40.
  2. The invoice line comes from that allocation line, with nothing picked or delivered. When the invoice's stock action runs, it matches Sold (from Allocation). One Sold entry of 40 is written. Sold Quantity and Pending Deliveries rise by 40, and Allocation Quantity falls by 40.
  3. The warehouse raises a delivery order from the invoice. Its line comes from the invoice line, not from a pick or an allocation, so posting it matches Outward (invoiced, from PendingDeliveries). One Outward entry of 40 (the line's Invoiced Quantity) is written, and Pending Deliveries falls by 40. That entry shows Inventory Stock Posted unticked, because the rule only takes from a bucket.

At the end, Sold Quantity is up 40 and Allocation Quantity and Pending Deliveries are back where they started. You can trace each step to one row on the Inventory Ledger Settings screen.

Training

Practice exercise

In a sandbox, post a goods receipt with one line of 10 units against a purchase order, entering 1 unit as Damaged Quantity. Use an item with Track Inventory on and Inspection On Receipt off. Then open Inventory → Inventory Ledger and find the entries for that receipt.

Expected result: two entries, Inward (from Inward (purchase order), quantity equal to the line's Received Quantity) and Damaged (from Damaged (goods receipt), quantity 1). On Inventory Ledger Settings, search for (goods receipt) and Inward, open both rules and match each condition to your line. Then explain which buckets moved: Unbilled Receipts and Damaged Quantity.

Quick reference

  • Path: Setup → Feature Hub → Inventory → Inventory Ledger Settings — view only.
  • One rule = one line type + one ledger type + one situation (the condition).
  • Every active rule whose condition matches writes its own entry.
  • Most rules are update and delete only: lines post when the document's stock action runs, not when they are saved.
  • Allocation, picking and inspection lines post on save.
  • Edits post a reversal plus a fresh entry; deleting a posted line reverses it.
  • The dialog can show a blank Increment Field for rules that still move buckets (the three undelivered invoice rules).
  • Credit note lines have no rule; sales order SoftCommit and InTransit ship inactive.
  • Use Label, not Name, to tell rules apart.

Permissions

  • Viewing the list and opening a rule needs access to Setup. No other setup capability is checked.
  • Creating, editing and deleting rules is refused for every user. The screen offers no New, Edit or Delete, and the server rejects any such request because the rules are managed in code.
  • Posting itself follows the permissions of the document action that triggers it. See the page for each document.

Configuration

There is nothing for a tenant administrator to configure on the rules themselves. What you can control is which rules apply to your documents:

What you controlWhereEffect on posting
Item Track InventoryItem record, Details tabOff: every rule skips the item's lines. See Items.
Item Track LotsItem record, Details tabOn: a line without a lot cannot post. See Item lots.
Adjustment Type on adjustment linesThe line's Adjustment TypeChooses which adjustment rule applies. A type no rule names posts nothing. See Adjusting stock.
Transfer TypeThe transfer headerPending Deliveries Transfer switches transfer lines to the Pending Deliveries rules.
Document routeHow a line is created (from an allocation, pick, delivery order, shipment or purchase order)The link fields on the line decide which rule's condition it meets.

The rules travel with metadata: a metadata export includes them (see Metadata commands), and platform seed updates deliver changes to them.

Common problems

"A line posted nothing and has no Inventory Ledger reference"

Cause: no active rule for the line type matched. Typical cases: the item has Track Inventory off; the line has no item; an adjustment line of a type no rule names, or with zero quantity; a credit note line; a sales order line (its rule is inactive). Fix: compare the line with each rule's condition (Step 4). Correct the line (for example set a valid Adjustment Type) and run the document's stock action again, or use the document route that has a rule.

"Product Lot was not selected for the transaction. This is required for Inventory posting."

Cause: the item has Track Lots on and the line has no Item Lot. Fix: choose the lot on the line, save, and post again.

"Insufficient stock: … cannot go negative"

Cause: a rule tried to take more from a bucket than it holds. For example, a picking line takes from Allocation Quantity, or a delivery order raised from an invoice takes from Pending Deliveries. Nothing from that save was posted. Fix: read the bucket name in the message, find the rule that takes from it, and post the earlier step first (allocate before picking, post the invoice before the delivery order raised from it).

"Inventory Stock Posted is unticked on an entry"

Cause: the rule that wrote it only takes from a bucket, so the box stays unticked even though the bucket moved. Fix: none needed. Check the stock record to confirm the bucket changed.

"The rule dialog shows no Increment Field, but Sold Quantity went up"

Cause: the rule names its buckets as a text list, which the dialog doesn't show. Fix: use the tables on this page, which list the full effect of every rule.

"I can't edit or add a rule"

Cause: the rules are platform-managed and read-only for everyone. Fix: raise the requirement through your implementation or support channel (Step 6).

Common questions

Can I turn a rule off, for example SoftCommit for sales orders?

No. The Active flag is read-only like every other field, and the server refuses changes from every user. The sales order SoftCommit (order) rule ships inactive, so a sales order line reserves nothing in the ledger until an allocation line is saved. If your process needs soft reservation on sales orders, raise it through your implementation or support channel; don't look for a tenant setting, because there isn't one.

Why do several rules have the same name?

The Name identifies the movement, and one movement can arise in several situations. All five invoice line rules are named Sold because they all write Sold entries, but each covers a different route: from a pick, from an allocation, direct, from a delivery order, or delivered on the invoice. The Label is unique and says which situation each rule covers. Search and sort by Label when you need one specific rule.

Does invoicing reduce stock?

Yes, once its stock action runs. Every invoice rule adds to Sold Quantity, which lowers both Available and In Hand. Depending on how the line was created, the rule also takes from Picked Quantity, Allocation Quantity or Unbilled Dispatches, which releases the earlier reservation or dispatch. An invoice for goods not yet delivered also adds to Pending Deliveries, and the delivery order raised from it takes that back out. The balance formulas are in Stock balances.

Why does a credit note not return stock?

No rule covers credit note lines, so posting a credit note writes no inventory ledger entry and moves no bucket. To bring returned goods back into stock, post an adjustment with a positive quantity, or receive them through the document your process uses for returns.