Back to ER Diagram
Inventory Management

Inventory Management Logic

Store management, stock ledger, material issues, returns, inter-site transfers, and stock adjustments with real-time tracking.

PostgreSQL
9 Tables
Schema: inventory
Real-time Stock

Overview

The Inventory module tracks material movement across project stores. Every receipt (GRN), issue to site, return, transfer, and adjustment is recorded as a stock transaction updating the running stock ledger. Stores are organized per project/location. Inter-Site Transfers (IST) enable material movement between projects with proper documentation.


GRN Receipt

Stock Ledger

Material Issue

Return/Transfer

Adjustment
9
Inventory Tables
Real-time
Stock Balance
Multi
Store Locations
FIFO/WAVG
Costing Methods

Status States

StatusDescriptionAllowed ActionsNext States
RequestedMaterial issue requested by site engineerApprove, RejectApproved
ApprovedIssue approved by store managerIssue MaterialIssued
IssuedMaterial physically issued from storeConfirm ReceiptCompleted
CompletedMaterial received at site, stock updated
In TransitIST dispatched, pending receipt at destinationReceive, Report ShortageReceived
RejectedIssue request denied due to stock/budget constraintsRevise Qty, CancelRequested

Database Schema

inventory.store

  • store_id — PK, unique store/warehouse
  • project_id — FK → project.project
  • store_code, store_name — Identifier and display name
  • location_id — FK → organization.location
  • store_type — main | sub | bonded | scrap
  • is_active — Active/inactive flag

inventory.stock_ledger

  • ledger_id — PK, running stock balance record
  • store_id — FK → inventory.store
  • material_id — FK → master_data.material_master
  • current_qty, reserved_qty, available_qty — Balance tracking
  • avg_cost, last_cost — Weighted average and latest unit cost
  • reorder_level, max_level — Min/max stock thresholds

inventory.material_issue

  • issue_id — PK, material issue header
  • store_id — FK → inventory.store
  • project_id, wbs_id — FK → project scope
  • requested_by, approved_by — Workflow tracking
  • issue_date, status — Date and lifecycle state

inventory.inter_site_transfer

  • ist_id — PK, inter-site transfer header
  • from_store_id, to_store_id — FK → inventory.store (source and destination)
  • transfer_number, transfer_date — Document tracking
  • status — Requested → Dispatched → Received
  • received_date, received_by — Receipt confirmation

inventory.stock_adjustment

  • adjustment_id — PK, stock correction record
  • store_id, material_id — FK references
  • adjustment_type — surplus | shortage | damage | expiry
  • qty_adjusted, reason — Quantity change with justification
  • approved_by — FK → admin.user

Inventory Operations

1

GRN Receipt Updates Stock

When GRN is approved in Receiving module, stock transaction auto-creates in stock_ledger. Running balance increases. Average cost recalculated using weighted average method.

2

Material Issue Request

Site engineer raises material issue request specifying material, quantity, WBS element, and purpose. System checks available stock (current_qty - reserved_qty).

3

Issue Approval & Dispatch

Store manager approves request. Stock deducted from ledger. Issue slip generated with material details, quantity, vehicle number, and receiver signature fields.

4

Inter-Site Transfer

Source store creates IST with material list. On dispatch, source stock decreases. On receipt at destination, destination stock increases. Shortages flagged for investigation.

5

Stock Adjustment

Physical verification reveals surplus/shortage. Store manager creates adjustment entry with justification. Approved adjustments update ledger and post journal entries to finance.

Inventory Queries

Stock Balance Report

-- Current stock position across all stores for a project
SELECT s.store_name, mm.material_code, mm.material_name, mm.uom,
       sl.current_qty, sl.reserved_qty, sl.available_qty,
       sl.avg_cost, sl.current_qty * sl.avg_cost AS stock_value
FROM inventory.stock_ledger sl
JOIN inventory.store s ON s.store_id = sl.store_id
JOIN master_data.material_master mm ON mm.material_id = sl.material_id
WHERE s.project_id = :project_id AND sl.available_qty > 0
ORDER BY stock_value DESC;

Validation Rules

Business Rules

  • Stock Availability: Issue qty cannot exceed available_qty (current - reserved)
  • IST Balance: Received qty at destination ≤ dispatched qty from source
  • Adjustment Approval: Adjustments above ₹50,000 require Finance Manager approval
  • Negative Stock: System prevents stock going below zero; blocks issue if insufficient

Integration Points

Connected Modules

  • Receiving: GRN approval triggers stock receipt transaction
  • Procurement: MR quantities checked against stock to avoid over-ordering
  • Finance: Stock adjustments post journal entries; inventory valuation feeds balance sheet
  • Project: Material issues linked to WBS for cost allocation

Best Practices

Recommended

  • Conduct monthly physical stock verification and reconcile
  • Set reorder levels based on lead time and consumption rate
  • Use barcode/QR scanning for material issue/receipt
  • Archive IST documents with vehicle and transporter details