warehouse

InventoryView

AI-ready inventory analytics view for analyzing real stock, reserved stock, in-transit goods, and available-to-sell quantity across branches and stores.
inventory stock warehouse supply chain availability
Purpose
This view provides a unified inventory snapshot for AI and BI systems. It helps determine real stock levels, reserved quantities, in-distribution goods, and final available-to-sell inventory for decision making in supply chain and sales planning.
Business Rules
  • Mojoodi represents physical stock available in warehouse.
  • SumOrder represents reserved stock for confirmed orders.
  • SumInDist represents items in distribution pipeline not yet deducted physically.
  • Mande represents available-to-sell stock.
  • Inventory availability is dynamically affected by reservations and dispatch process.
Key Formula

Available Stock Calculation:

Mande = Mojoodi - SumOrder - SumInDist
Relationships

This view represents the operational inventory layer of the system. It connects physical stock, reserved orders, distribution pipeline and available-to-sell quantities to support supply chain planning, sales allocation and AI-based demand forecasting.

Related View Join Keys Description
SalesInvoiceView ProductId, BranchID, StoreID Links sold products with inventory consumption to analyze stock depletion and sales impact per branch.
OrderFinancialSummaryView OrderID (via SalesInvoiceView), BranchID Connects financial order lifecycle with inventory availability and stock allocation decisions.
OrderReturnSummaryView ProductId, BranchID, StoreID Restores returned products back into inventory and supports reverse stock flow analysis.
OrderCollectionAnalyticsView OrderID (indirect), BranchID Provides indirect linkage between inventory movement and cashflow realization.
CustomerPotentialAnalyticsView Indirect via SalesInvoiceView Uses inventory-driven sales patterns to improve customer demand prediction and segmentation.
CustAssignToSeller Indirect via sales flow Helps align inventory availability with salesperson territory demand.
CustomerVisitLogsView Indirect via SalesInvoiceView Correlates stock availability with customer visit outcomes and order generation.
SellerVisitPathCustomersView Indirect via demand planning Uses inventory constraints to optimize visit planning and product availability per route.
DeliveryOperationAnalyticsView ProductId (via order flow), BranchID Links distribution pipeline (SumInDist) with delivery execution and logistics performance.
InventoryView (Current) ProductId, BranchID, StoreID Core inventory snapshot including physical stock, reserved stock and available-to-sell quantity.
Primary Inventory Join Strategy
  • ProductId → Core product-level stock tracking across all flows
  • BranchID → Regional stock distribution and branch-level availability
  • StoreID → Warehouse-level inventory management
  • Mojoodi → Physical stock baseline
  • SumOrder → Demand reservation pressure
  • SumInDist → Logistics pipeline stock impact
  • Mande → AI-ready available-to-sell stock metric
Fields
Field Type Description
ProductIdintProduct identifier
BranchIDintBranch identifier
BranchNamestringBranch name
StoreIDintWarehouse/store identifier
StoreNamestringWarehouse name
ProdNamestringProduct name
GrpDescstringProduct group
BrandNamestringBrand name
QtyPackageintUnits per package
MojoodidecimalPhysical stock in warehouse
SumOrderdecimalReserved stock for orders
SumInDistdecimalItems in distribution pipeline
MandedecimalAvailable stock for sale
LangIDintLanguage identifier
StoreGrpDescstringWarehouse group description
Unit Conversion Rule
swap_horiz
Critical Business Rule

All inventory-related values in this view (Mojoodi, SumOrder, SumInDist, and Mande) are stored in base unit (single unit / piece).

For reporting in Carton / Package units, values must be converted using:

ValueInCarton = ValueInUnit / QtyPackage
  • QtyPackage defines number of units per carton/package
  • All calculations must be consistent before aggregation (convert first, then sum)
  • Do NOT mix unit-level and carton-level values in the same report
Usage
  • Stock availability analysis
  • Sales planning and forecasting
  • Warehouse optimization
  • Supply chain visibility
  • AI-based stock shortage prediction
Important Notes
warning
Inventory Logic Note

Available stock (Mande) is a computed business value and should always be used for sales allocation and demand planning instead of raw physical stock.