xMatix
Sign in Request demo
xMatix
PRODUCTS
SalesField SalesCRMRewardsClaimsInventoryProcurementWarehouse 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
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/Entity Reference/Inventory Stock — entity reference
REFERENCE · Last reviewed

Inventory Stock — entity reference

The running stock balance for one stock-keeping slot, keyed by partner account + branch + item + SKU + storage location; rows are created on demand by the ledger posting engine and never entered by hand (the entity has no New/Edit/Delete server actions). Every movement bucket stores a positive magnitude and direction is expressed by which bucket a rule increments or decrements, so on-hand answers come from the calculated Available / InHand / QuantityProjected fields rather than from summing buckets yourself. Stock only moves when a document posts through DoLedgerPostingAsync, not when a line is created. Two different availability models exist in the platform and they do not agree: this row's calculated Available and InHand both add Purchased, while the ledger report's running totals treat Purchased and Pipeline as neutral - prefer this entity for current balances and the ledger report for movement history.

Fields

FieldLabelTypeRequiredWhat it does
AdjustedOutNegative AdjustedNumberStock written off by adjustment lines that carry a negative quantity and no adjustment type. The engine applies it as a decrement of a negative number, so the bucket accumulates a positive magnitude of the quantity removed, and it is subtracted by the available, in-hand and projected balances alike.
AdjustmentPositive AdjustedLargeNumberNet signed quantity accumulated from adjustment postings against this bucket; in the availability math adjustments count fully into both available and in-hand.
AllocationAllocation QuantityLargeNumber
AssembleAssembled InNumberQuantity produced by assembly, incremented by adjustment lines whose type is Assemble and added to the available, in-hand and projected balances. It is also incremented by adjustment lines whose type is Disassemble, because the seeded Disassemble rule names this field as its incremental target - a disassembly therefore currently increases assembled quantity.
AvailableAvailableCalculated (calculated)
AverageCostAverage CostCurrencyInventory valuation lives in the Finance cost-lot entities driven by the posting cost hook, not on this row.
BranchIdBranchLookup → BranchThe branch the balance belongs to, part of the stock row key and read from the source document's header rather than the line. Transfer postings resolve it per leg, so an outward and an inward movement of the same transfer touch two different stock rows.
ClosingStockClosing StockNumberClosing figures come from the ledger action's running totals or from the calculated Available and InHand fields on this row.
CostofGoodsCostofGoodsCurrencyCost of goods sold is produced by the Finance inventory costing engine from ledger movements, not accumulated here.
CostPriceCost PriceCurrency
CreatedByIdCreated ByLookup → UserAccountYes
CreatedDateTimeCreated DateDateAndTimeYes
DamagedDamaged QuantityLargeNumberCumulative damaged quantity, fed by damaged quantities on goods receipt lines, transfer lines and credit note returns, and by adjustment lines whose type is Damaged. Subtracted from the available balance; absent from the in-hand formula.
DeAllocationDeAllocationNumberDe-allocation is expressed as a negated reversal row that reduces the Allocation bucket instead.
DisassembleAssembled OutNumberIn practice it stays at zero.
ExcessExcess QuantityLargeNumberCumulative over-received or over-counted quantity, fed by excess quantities on goods receipt, transfer and credit note lines and by adjustment lines whose type is Excess. Adds to both the available and in-hand balances.
ExpiredExpired QuantityLargeNumberCumulative expired quantity, written off by adjustment lines whose type is Expired and by expiry-type credit note returns. Subtracted from the available balance; absent from the in-hand formula.
ExternalQuantity ExternalNumber
ExternalIdExternalLookup
FinancialYearFinancial YearNumberStock rows are perpetual running balances with no period dimension, so do not use this to scope a balance to a year - use the ledger with a date window instead.
FulfilmentFulfilmentLargeNumber
HashCodeHash CodeNumberA numeric column left at its zero default: unlike the lot equivalent, nothing in the platform assigns or reads it on stock rows.
IdIdGuidYes
InHandIn HandCalculated (calculated)
InspectionInspectionLargeNumberQuantity held for incoming inspection, incremented from inspection lines raised against a goods receipt. Subtracted from the available balance but absent from the in-hand formula - inspected goods are physically present but not sellable.
InspectionAdjustmentInspection AdjustmentLargeNumber
InTransitTransitNumber
InventoryTurnoverInventory TurnoverCurrency
InwardUnbilled ReceiptsLargeNumberReceived-but-unbilled quantity: goods receipt lines increment it, and it is drained again when the supplier bill posts Purchased against the same receipt line. Counts positively into both the available and in-hand balances.
IsTransactionLockedIs Transaction LockedBooleanYes
ItemIdItemLookup → Item
ItemLotTypeIdItem Lot TypeLookup → ItemLotTypeInventoryStockService.SetInventoryStock searches with a key that does include it, so that lookup can only ever match rows where both sides are unset.
ModifiedByIdModified ByLookup → UserAccountYes
NameNameText
OnHoldQuantity On HoldLargeNumberQuantity blocked by an adjustment line whose adjustment type is OnHold. Subtracted from the available balance and ignored by the in-hand formula, so putting stock on hold makes it unsellable without pretending it left the building.
OnLoanQuantity On LoanLargeNumberQuantity lent out via an adjustment line whose adjustment type is OnLoan. Subtracted from the available balance and ignored by the in-hand formula.
OpeningStockOpening StockNumberOpening figures come from the ledger action, which computes them from movements dated before the window start.
OutwardUnbilled DispatchesLargeNumberDispatched-but-uninvoiced quantity: delivery order lines increment it and the invoice drains it when it posts Sold against the delivery line. It is subtracted by the available balance but is absent from the in-hand formula, because the goods have left even though the sale is not yet booked.
OwnerIdOwnerLookup → UserAccountYes
PartnerAccountIdPartner AccountLookup → AccountThe owning company for this balance, part of the stock row key. Posting takes it from the source document's header (the rule's parent entity), not from the line, so a line whose header has no partner cannot resolve or create a stock row.
PendingDeliveriesPending DeliveriesNumberCounter for sold-but-undelivered stock; its ledger rows carry a matching pendingDeliveriesQuantity, and sale returns tied to a pending delivery stay out of availability until delivered.
PickedPicked QuantityLargeNumberQuantity sitting on picked fulfilment lines. Neutral in the availability math, because allocation already removed it from available.
PipelineQuantity On PipelineLargeNumberInbound quantity on shipments not yet received; informational - it contributes to neither available nor in-hand until receipt posts an inward movement.
ProfitPriceProfit PriceCurrency
PurchasedPurchased QuantityLargeNumberQuantity on order with suppliers; affects neither available nor in-hand until the goods are received.
PurchaseReturnPurchase Return QuantityLargeNumberCumulative quantity returned to suppliers, posted from credit note lines that are not classified as an excess, damage, shortage or expiry return. Subtracts from both the available and in-hand balances.
QuantityProjectedQuantity ProjectedCalculated (calculated)
RecordTypeIdRecord TypeGuid, hidden
SalePriceSale PriceCurrency
SaleReturnSale Return QuantityLargeNumberCumulative customer-return quantity; adds to available and in-hand, except returns still tied to a pending delivery, which stay neutral until delivered.
ShortageShortageNumberCumulative short-received or short-counted quantity, fed by shortage quantities on goods receipt and transfer lines and by adjustment lines whose type is Shortage. Subtracted from the available balance only.
SKUIdSKULookup → SKU
SoftCommitSoftCommitLargeNumberQuantity committed by order lines ahead of fulfilment. Deliberately neutral in the availability math - it moves neither available nor in-hand.
SoldSold QuantityLargeNumberAccumulated invoiced quantity, incremented when an invoice line posts; the same rules simultaneously drain whichever upstream reservation the sale consumed (Picked, Allocation or Outward). Subtracts from both the available and in-hand balances.
StorageLocationIdStorage LocationLookup → StorageLocationPart of the stock row key, so the same item at two bins keeps two balances. A null value is meaningful rather than missing: the transfer transit balance is deliberately held on a row with no location.
TransferInwardTransfer InwardLargeNumberCumulative quantity transferred into this bucket; counts positively into available and in-hand at the receiving branch.
TransferOutwardTransfer OutwardLargeNumberCumulative quantity transferred out of this bucket; subtracts from available and in-hand at the sending branch.
UIPropsUI PropsText
UpdatedDateTimeModified DateDateAndTimeYes
ValueValueCurrencyStock value is computed on demand by the ledger action as movement quantity times the ledger row's unit cost, and properly by the Finance costing engine.

Actions

ActionLabelTypeWhat it does
CloneCloneServerAction (Clone)Create a copy of this record
GetInventoryStockDataGet Inventory Stock DataServerAction (GetInventoryStockData)The stock handler implements GetInventoryStockStatement instead (an item-by-column available-quantity statement with opening, closing and change per column), and that action has no metadata row of its own. Invoking this action does not return stock data.
GetInventoryStockMatrixInventory Stock (by dimension)ServerAction (GetInventoryStockMatrix)Stock available pivoted into columns by branch / period (Balance Statement comparative).
GetInventoryStockStatementInventory Stock StatementServerAction (GetInventoryStockStatement)Available stock per column (point-in-time or Opening/Change/Closing movement) for the Balance Statement.

Validations

ValidationApplies toError messageNotes
Available Quantity Validation RuleErrorStock Available Quantity cannot be negative!!Available Quantity cannot be negative!!
In Hand Quantity RuleInHand, ErrorStock In Hand Quantity can't be negative.Quantity In Hand can't be negative.
Validate Negative QuantityErrorStock Available Quantity cannot be negative!!Available Quantity cannot be negative!!

Lookup filters

FilterLookup fieldNotes
BranchFilterBranchId
PartnerAccountFilterPartnerAccountId