Inventory, Multi-Warehouse Matrix, FIFO/FEFO Batches & Governance Studio
A complete guide to managing physical stock, non-stock services, composite Bill of Materials (BOM) bundles, multi-warehouse bin locations, FIFO/FEFO expiry lots, cycle counts, and inventory valuation accounting in Keystone X.
In This Article
1Plain-English Inventory Accounting: Asset Valuation, COGS, FIFO, FEFO & WAVCO
If you have never studied accounting, inventory is often the most misunderstood part of running a business. Many beginners think that buying R10,000 worth of stock from a supplier is an immediate R10,000 business expense. In double-entry accounting, it is not!
The Golden Rule of Inventory Accounting
When you buy stock, you have simply swapped one asset (Cash in your Bank) for another asset of equal value (Inventory on your Shelves). Your company is no poorer! The cost only becomes an Expense (called Cost of Goods Sold — COGS) at the exact moment a customer buys the item and takes it off your shelf.
How Keystone X Automates Your Double-Entry Stock Ledger
| Business Event | What Happens Physically | Automated Double-Entry Journal Behind the Scenes | Financial Impact |
|---|---|---|---|
| 1. Receive Supplier PO / Batch | 10 Inverters arrive at WH-MAIN @ R5,000 each (Ex VAT). |
DEBIT Inventory Asset (1300) +R50,000 CREDIT Accounts Payable / Bank -R50,000 |
Increases Balance Sheet Asset value. Zero effect on Profit & Loss yet. |
| 2. Inter-Warehouse Transfer | 2 Inverters moved from WH-MAIN to WH-VAN1 (Tech Van). |
Sub-ledger transfer from WH-MAIN to WH-VAN1.No General Ledger impact (still owned by company). |
Total company stock remains 10 units (R50,000). Custody is now tracked per van. |
| 3. Customer Tax Invoice / Sale | 1 Inverter sold to client for R8,000 Ex VAT (Cost was R5,000). | Entry A (Revenue): DR Accounts Receivable / CR Sales Revenue (R8,000) Entry B (COGS): DR Cost of Goods Sold (5000) R5,000 / CR Inventory Asset (1300) R5,000 |
Recognizes R8,000 Revenue, R5,000 Cost of Sale, and R3,000 Gross Profit (37.5% Margin). |
| 4. Expiry / Damaged Write-Off | 1 unit damaged or expired in warehouse (Cost R5,000). | DEBIT Stock Write-Off / Shrinkage Expense +R5,000 CREDIT Inventory Asset (1300) -R5,000 |
Reduces Inventory Asset value and records a R5,000 loss on the Income Statement. |
Understanding Costing Methods: FIFO vs. FEFO vs. WAVCO
Suppose you bought 5 units in January at R100 each, and another 5 units in February at R120 each (because supplier prices rose). When you sell 1 unit in March, did that unit cost you R100 or R120? Keystone X lets you choose the costing engine per item or company-wide:
Oldest Stock Sold First
Assumes the earliest batch received (January @ R100) is the first batch sold (`#1 NEXT OUT`). Once the January batch is depleted to 0, Keystone X automatically switches to deducting from the February batch (@ R120). Ideal for hardware, electronics, and general retail.
Nearest Expiry Sold First
Queues batches by their Expiry Date rather than intake date. The batch expiring soonest is flagged as #1 NEXT OUT so warehouse pickers dispatch short-dated stock before it spoils. Ideal for batteries, chemicals, food, medical consumables, and adhesives.
Blended Moving Average
Blends all units together: (5 × R100 + 5 × R120) ÷ 10 = R110.00 per unit. Every unit sold uses the blended R110.00 cost. Ideal for bulk cables, fuel, fasteners, and commodities where individual lots are mixed together.
2The Inventory & Warehouse Command Center (/inventory/index)
Navigate to Inventory → Catalog & Stock in the left sidebar (or go to /inventory/index). This unified command center replaces scattered spreadsheets with live multi-warehouse balances, FIFO batch queues, and serial provenance.
📸 [SCREENSHOT PLACEHOLDER: inv-01-command-center-overview.png]
How to capture this screenshot:
- Log in and navigate to
/inventory/index(Default mode: Master Catalog & Stock). - Ensure the top header bar (with the 6 action pills), the 6 KPI Telemetry Cards, the 7-Stage Health Pipeline strip, and the first few rows of the Master Catalog table are visible.
- Capture a full-width screenshot (1920×1080 recommended) and save it as
inv-01-command-center-overview.png.
Top Command Bar Action Pills
The top-right command bar provides six instant operational actions:
| Button / Pill | Target Route / Modal | Exact Function & When to Use It |
|---|---|---|
| Serial Tracker | /inventory/trackSerial |
Opens the dedicated 360° Serial, Warranty & RMA Command Center (covered in Article #06) to scan barcodes, print warranty certificates, or log RMA claims. |
| Transfer Stock | #transferStockModal |
Opens the Inter-Warehouse Stock Transfer modal to move units between your main hub, showroom, technician service vans, or quarantine bay. |
| Adjust / Count | #adjustStockModal |
Opens the Warehouse Stock Adjustment & Cycle Count modal to record physical stocktake counts, add/deduct delta quantities, or write off damaged stock. |
| Receive Batch | #addBatchModal |
Opens the Receive FIFO / FEFO Batch Lot modal to log a new lot number, manufacturing date, expiry date, unit cost, and intake quantity. |
| Customize | /inventory/settings |
Opens the Inventory & Warehouse Customization Studio to configure warehouses, category target margins, FIFO/FEFO rules, and SKU auto-numbering. |
| New Item | /inventory/addItem |
Opens the item creation form to register a new Physical Product, Service/Labour rate, or Composite Kit/Bundle. (Requires create_inventory permission). |
The 6 Executive KPI Telemetry Cards
| KPI Card Title | Primary Metric | Sub-Metrics & Plain-English Meaning |
|---|---|---|
| 1. Master Catalog | Total Enabled Items | Displays the breakdown of Prod (Physical Products), Svc (Non-stock Services/Labour), and Bdl (Composite Bundles). |
| 2. Stock Value (Cost) | Total Inventory Asset Value | The total capital tied up in physical stock on your Balance Sheet (On-Hand Qty × Cost Price) across all active warehouses. |
| 3. Retail Value (Ex VAT) | Total Selling Potential | What your current on-hand stock will sell for (Ex VAT), plus your Est. Margin (Retail Value - Cost Value) in currency. |
| 4. Reorder & Stockouts | Total Alerts Count | Splits into Out of Stock (Qty ≤ 0) and Below Min Level (0 < Qty ≤ Reorder Level). |
| 5. FIFO Batches & Expiry | Active Batch Lots | Shows how many FIFO/FEFO lots are currently active, how many are Expiring Soon (within warning days), and how many are Expired. |
| 6. Serials & Warranties | In-Stock Serials | Shows serialized units currently sitting in your warehouses ready for sale, plus the count of Active Customer Warranties out in the field. |
3The 7-Stage Inventory Health & Governance Pipeline
Directly below the KPI cards sits the interactive Inventory Health & Governance Pipeline. Clicking any stage pill immediately filters the catalog (or switches to the Reorder Queue) so you can act on exceptions in one click:
| Pipeline Stage Pill | URL Query Parameter | Filter Logic & Operational Purpose |
|---|---|---|
| All Catalog | ?mode=catalog&health=all |
Displays every item in the master catalog regardless of stock status. |
| Healthy Stock | ?mode=catalog&health=healthy |
Shows physical stock items where stock_quantity > reorder_level, plus ready-to-bill Service items. |
| Low Stock (Reorder) | ?mode=catalog&health=low |
Filters to items where 0 < stock_quantity ≤ reorder_level so buyers can replenish before running out. |
| Out of Stock | ?mode=catalog&health=out |
Filters to stock-managed items with stock_quantity ≤ 0 requiring urgent procurement. |
| FIFO / Expiry Tracked | ?mode=catalog&health=fifo_expiry |
Filters to items that have active FIFO/FEFO batch lots or have track_expiry = 1 enabled. |
| Serial / Warranty | ?mode=catalog&health=serialized |
Filters to hardware items where track_serials = 1 is enabled. |
| Kits & Services | ?mode=catalog&health=bundles |
Filters to Composite Bundles (item_type = bundle) and Service/Labour items (item_type = service). |
Quick Link: On the right side of the pipeline header, clicking Open Reorder Queue → jumps directly to ?mode=reorder.
4The 6 Operational Mode Tabs (?mode=)
Below the pipeline strip, six pill tabs switch the workspace between specialized operational views while keeping your search bar and filter bar intact.
Mode 1: Master Catalog & Stock (?mode=catalog) & Mode 6: Reorder Queue (?mode=reorder)
Multi-Criterion Filter Bar: At the top of the table, you can filter simultaneously by:
- Search Box (
search): Matches SKU, Item Name, Brand, Barcode, Supplier Ref, or Bin Location. - Category Dropdown (
category_id): Filters by product category (e.g., Solar & Power, CCTV, Networking). - Warehouse Dropdown (
warehouse_id): Filters to items held in a specific warehouse hub or service van. - Item Type Dropdown (
item_type): Filters byPhysical Product,Service / Labour, orComposite Bundle. - Filter Button & Reset Icon (): Applies or clears all active filters.
Every Column & Badge in the Master Catalog Table
| Column Header | Contents, Governance Badges & Interactive Links |
|---|---|
| 1. SKU & Governance | Clickable monospace SKU (opens 360° Item Cockpit) plus governance micro-badges: • FIFO / FEFO / WAVCO (Costing engine) • SN (X) (Serial-tracked item with count of in-stock serials) • Lot (X) (Expiry/batch-tracked item with count of active lots) • 12m (Customer warranty duration in months) |
| 2. Item & Brand | Clickable Item Name, followed by the highlighted Brand name and truncated product description. |
| 3. Category & Type | Color-coded Category badge with custom icon, plus item type label (Physical Product (Each), Service / Labour (Hour), or Composite Bundle). |
| 4. Warehouse Distribution | Shows live stock badges per warehouse (e.g., WH-MAIN: 14 (A-01-02), WH-VAN1: 2 (VAN-B1)). Hovering any badge reveals the full warehouse name and bin location. Non-stock services display ∞ Non-Stock / Virtual. |
| 5. Cost / Sell (Ex VAT) | Top line: Selling Price Ex VAT in bold. Bottom line: Unit Cost Price. |
| 6. Margin | Color-coded Gross Margin percentage badge: ≥ 30% Green, 15–29.9% Blue, 0.1–14.9% Amber, ≤ 0% Red. |
| 7. On-Hand Stock | Total quantity across all warehouses, minimum reorder level (Min: X), and total asset valuation (Val: R X). |
| 8. Health & Expiry | Status badge (Healthy, Low Stock, Out of Stock, Service Ready, or Disabled) plus nearest FEFO expiry countdown badge (Exp in Xd or Exp: YYYY-MM-DD). |
| 9. Actions (Circular Icons) | • Open 360° Item Cockpit (/inventory/viewItem/{id})• Adjust Stock / Cycle Count (Pre-fills item, default warehouse & bin in #adjustStockModal)• Transfer Between Warehouses (Pre-fills item & source warehouse in #transferStockModal)• Edit Item ( /inventory/editItem/{id})• Delete Item (Requires confirmation; soft-protected if historical transactions exist) |
?mode=reorder): When viewing the Reorder Queue tab, an amber alert banner appears at the top with a Create Restock Purchase Order button that takes you straight to /PurchaseOrder/create to replenish all low/out-of-stock SKUs.Mode 2: Multi-Warehouse Matrix (?mode=warehouses)
📸 [SCREENSHOT PLACEHOLDER: inv-02-multi-warehouse-matrix.png]
How to capture: Click the Multi-Warehouse Matrix tab (/inventory/index?mode=warehouses). Capture the top row of Warehouse Facility Cards (WH-MAIN, WH-SHOW, WH-VAN1, WH-RMA) and the cross-tabulated Stock Distribution Matrix table below it.
- Warehouse Facility Summary Cards (Top Row): Displays a card for each warehouse showing its monospace code (e.g.,
WH-MAIN), governance badges (Default HuborQuarantine / Holdif dispatch is disabled), Facility Name, Warehouse Type, Physical Address, Manager Name, Default Bin Prefix, Total Stock Valuation (Cost), Active SKUs count, and Total Units. Clicking the gear icon () opens Warehouse Settings. - Multi-Warehouse Stock Distribution Matrix (Bottom Table): Rows represent stock-managed SKUs and columns represent each warehouse facility. Each cell displays the exact quantity and bin location (e.g.,
Bin: A-01-02) in that warehouse, followed by Total Stock and quick Transfer () / Cycle Count () buttons.
Mode 3: FIFO / FEFO Batches & Expiry Radar (?mode=batches)
📸 [SCREENSHOT PLACEHOLDER: inv-03-fifo-batches-expiry-radar.png]
How to capture: Click the FIFO Batches & Expiry tab (/inventory/index?mode=batches). Capture the radar filter pills (All Batches, Active Queue, Expiring Soon, Expired Alert, Depleted History) and the batch queue table showing #1 NEXT OUT badges and progress bars.
This view governs lot traceability, unit cost layers, and shelf-life expiry dates:
- 5 Radar Sub-Filter Pills: Filter between
All Batches,Active Queue(remaining quantity > 0),Expiring Soon(within warning window),Expired Alert(past expiry date), andDepleted History(consumed batches kept for audit history). - FIFO Queue Column: Displays #1 NEXT OUT on the specific batch that Keystone X will automatically deduct from on the next Customer Invoice or Job Card, followed by
#2 in Queue,#3 in Queue, orClosed. - Batch / Lot No. & Warehouse/PO: Displays the lot code (e.g.,
LOT-20261016-01), warehouse code, and a clickable link to the originating Supplier Purchase Order. - Expiry Date & Countdown: Color-coded radar badges: Xd Shelf Life, Expiring in Xd, Critical: Xd left, Expired (Xd ago), or Non-Perishable (FIFO).
- Remaining / Initial Progress Bar: Shows remaining units vs. initial intake units with a visual depletion bar.
- Governance Actions Column:
- Place Batch in Quarantine Hold: Marks the batch status as
Quarantinedso it is skipped during automatic FIFO/FEFO sales deduction while QA investigates. - Write Off Batch & Deduct Stock: Marks the batch as
Expired, sets remaining lot quantity to zero, deducts the written-off quantity from the warehouse & master stock balance, and logs an immutableExpiry Write-Offmovement in the audit ledger.
- Place Batch in Quarantine Hold: Marks the batch status as
Mode 4: Serial & Warranty Vault (?mode=serials)
Provides an inline registry of all serialized units right inside the Inventory hub:
- 6 Quick Status Pills:
All Serials,In Stock,Sold,Active Warranty,Expired Warranty, andRMA / Defective. - Columns: Clickable QR/Serial link (opens full 360° Passport in
/inventory/trackSerial), Product & SKU, Warehouse & Batch Lot, Procurement PO, Customer & Invoice Dispatch link, Warranty Countdown badge, Current Status, and quick Edit Serial () modal trigger.
Mode 5: Stock Movement Ledger (?mode=movements)
An immutable, append-only audit trail of every physical unit that enters, moves within, or leaves your business:
- Columns: Monospace Movement Ref (e.g.,
MOV-202610-0042), Date & Time, Item & SKU, Movement Type badge (Initial Stock,FIFO Batch Intake,Warehouse Transfer,Cycle Count,Invoice Dispatch,Expiry Write-Off), Warehouse Route (WH-MAIN → WH-VAN1), Batch/Lot, signed Qty Change (+10.00green /-2.00red), Balance After, and Audit Notes.
5Quick Action Modals: Transfer Stock, Cycle Count & Receive FIFO Batch
Whether triggered from the top command bar or from any item row's action buttons, these modals let warehouse staff execute stock operations without leaving the screen:
- Select Inventory Item (
item_id)*: Dropdown of all stock-managed items showing current total stock. - Source Warehouse (
from_warehouse_id)*: The facility or van from which units are being removed. - Destination Warehouse (
to_warehouse_id)*: The facility or van receiving the units. - Transfer Quantity (
quantity)*: Number of units to move (minimum0.01). - Target Bin / Rack Location (
to_bin_location): Optional bin label in the destination warehouse (e.g.,VAN-A-02orSR-01). - Transfer Reference / Reason (
notes): Audit note (e.g., "Replenish technician van stock for Tuesday dispatches"). - Submit Button: Execute Stock Transfer — atomically deducts from the source warehouse, increments the destination warehouse, and logs a
Warehouse Transferaudit record.
- Inventory Item (
item_id)* & Warehouse (warehouse_id)*: Target SKU and specific warehouse location. - Adjustment Mode (
adjustment_mode):Add / Deduct Delta (+ / -): Adds or subtracts the entered quantity from the current warehouse balance (use negative numbers like-2to deduct).Set Exact Physical Count: Overwrites the warehouse balance to match your exact clipboard count during a stocktake, and automatically calculates the positive or negative variance delta for the audit log!
- Quantity (
quantity)*: The delta amount or exact physical count. - Reason Classification (
movement_type): ChoosePhysical Cycle Count,Manual Stock Adjustment,Field Service Job Card Issue,Customer RMA Restock, orDamaged / Expired Write-Off. - Bin Location (
bin_location) & Batch Expiry (expiry_date): Updates the warehouse bin code and creates a FIFO/FEFO batch layer if adding stock. - Audit Notes (
notes): Mandatory explanation for auditors.
- Inventory Item (
item_id)* & Receiving Warehouse (warehouse_id): Selects the product and intake hub. - Batch / Lot Number (
batch_number): Auto-suggested asLOT-YYYYMMDD-01(editable to match manufacturer lot stickers). - Batch Quantity (
quantity)* & Batch Unit Cost (unit_cost): Logs the exact quantity and supplier unit cost for this specific FIFO cost layer. - Manufactured Date (
manufactured_date) & Expiry Date (expiry_date): Used by the FEFO engine to rank shelf life. - Switch — Automatically increase warehouse & master on-hand stock balance (
increase_stock): Checked by default. Uncheck only if you are retroactively documenting batch numbers for stock that is already counted on your shelves.
6Creating & Editing Items (/inventory/addItem & /inventory/editItem/{id})
Clicking + New Item opens the Item Master Builder. The screen is divided into a Left Column (Classification, Pricing, and BOM Builder) and a Right Column (Multi-Warehouse Governance, Batch Expiry, and Serial/Warranty rules).
📸 [SCREENSHOT PLACEHOLDER: inv-04-add-item-and-bom-builder.png]
How to capture this screenshot:
- Navigate to
/inventory/addItem. - Select Composite Kit / Bundle in the Item Classification Type dropdown so that the dynamic Composite Bundle / Kit Components (Bill of Materials) card expands on the left.
- Also turn on the Track FIFO/FEFO Batch Expiry Dates and Track Individual Serial Numbers switches on the right so their sub-panels expand.
- Capture the full form and save as
inv-04-add-item-and-bom-builder.png.
Complete Field Reference: Item Master Form
| Card & Field Label | Input Name | Field Behavior, Accounting Impact & Validation Rules |
|---|---|---|
| Left Card 1: Core Identification & Classification | ||
| Item Classification Type * | item_type |
• Physical Stock Product (product): Standard tangible item tracked in warehouses.• Service / Labour / SLA ( service): Automatically switches Manage Physical Stock OFF and sets UOM to Hour.• Composite Kit / Bundle ( bundle): Reveals the dynamic Bill of Materials (BOM) builder card below. |
| SKU / Item Number * | item_number |
Pre-populated with the next sequential SKU from your studio settings (e.g., SKU-00018). Must be unique. |
| Category | category_id |
Assigns the item to an Inventory Category (e.g., Solar & Power). Selecting a category displays its target margin % for reference. |
| Item Name / Title * | item_name |
Primary title printed on Quotes, Sales Orders, Tax Invoices, Purchase Orders, and Job Cards. |
| Brand / Manufacturer | brand |
Manufacturer name (e.g., Victron, Hikvision, Ubiquiti, Mikrotik) used for catalog filtering. |
| Barcode / EAN / UPC | barcode |
1D/2D barcode string for handheld USB/Bluetooth scanner lookup. |
| Supplier Part / OEM Code | supplier_sku |
Vendor's catalog part number printed on Purchase Orders so your supplier ships the exact part. |
| Unit of Measure (UOM) | unit_of_measure |
Dropdown populated from Studio UOM list: Each, Hour, Meter, Box, Pack, Kg, Litre, Roll, Kit, Set, License. |
| Costing & Batch Engine | costing_method |
Selects FIFO (First-In, First-Out), FEFO (First-Expired, First-Out), or WAVCO (Weighted Average Cost). |
| Technical Description & Invoice Line Notes | description |
Multi-line specification text that automatically populates the line-item description when this SKU is selected on a Quote or Tax Invoice. |
| Left Card 2: Pricing, Costing & Live Gross Margin Calculator | ||
| Unit | ||