Skip to main content

Stock

Introduction

The Stock module provides inventory control across company, branch, supervisor, unit, and employee contexts. Operations teams raise requisitions, convert them to purchase orders, receive goods, issue stock to the field, and process returns—with ledger updates driven by stored procedures.

Purpose

Stock enables:

  • Item, vendor, and stock location masters
  • Requisition-to-PO procurement workflow
  • Goods receipt against purchase orders
  • Multi-path item issue and return (branch, supervisor, unit site, employee)
  • Inventory form reports for audit and reconciliation

When to Use

Use Stock when you:

  • Maintain SKU/item catalogs and vendor relationships
  • Procure uniforms, equipment, or consumables for sites
  • Track issues to employees or units and process returns
  • Run stock ledger or form reports for physical verification

Overview / Architecture

Stock is the ZSTOCK-flagged Area with _StockLayout.cshtml. Controllers encode organizational path variants (company→branch→supervisor→unit) in their names; DAL classes under DAL/Stock/ mirror those flows.

Entry URL: /Stock/StockDashboard/Index
PageID: Stock
Module flag: ZSTOCK

Controllers

Dashboard & masters

ControllerPrimary responsibility
StockDashboardModule home
StockMasterItems, vendors, groups, company/branch stock

Procurement

ControllerPrimary responsibility
RequisitionInternal requisition
GeneratePurchaseOrderPO creation
ClosePurchaseOrderPO closure
ItemReceivedVendor receipt

Issue paths

ControllerPrimary responsibility
ItemIssueGeneric issue
ItemIssueBranchToBranchBranch-to-branch
ItemIssueBranchToSupervisorBranch to supervisor
ItemIssueCompanyUnitSiteCompany to unit site
ItemIssueSupervisorToSupervisorSupervisor transfer
EmpIssueEntry / EmpItemIssueEmployee issue

Return paths

ControllerPrimary responsibility
ItemReturnGeneric return
ItemReturnFromBranchToBranchBranch return
ItemReturnFromBranchSupervisorToCompanyTo company
ItemReturnFromSupervisorToBranchSupervisor to branch
ItemReturnFromUnitSiteToCompanyUnit site to company
ItemReturnfromSuperToSuperSupervisor loop

Reports

ControllerPrimary responsibility
FormReportStock form reports

Views / Layout

AssetRole
_StockLayout.cshtmlModule shell
Stock dashboard CSSUnified sidebar styling
FormReport views + CrystalPrintable stock forms

DAL

Representative classes in DAL/Stock/:

DAL classRole
Requisition_DALRequisition CRUD
ItemReceiveFromVendor_DALGRN / receipt
ItemIssueToUnit_DAL / ItemIssueCompanyToUnitSite_DALIssue transactions
ItemReturnFromSupervisorToBranch_DALReturn paths
CompanyStock_DAL / BranchStock_DALLocation balances
VendorMaster_DAL / ItemMaster_DALMasters
EmpIssueEntry_DAL / frmItemIssueToEmployee_DALEmployee issues

Business Objects

Namespace: BO.Stock

BO typeRole
ItemMaster_BOItem definition
VendorMaster_BOVendor master
CompanyStock_BO / BranchStock_BOLocation stock
ItemIssueCompanyToUnitSite_BOIssue payload
EmpIssueEntry_BOEmployee issue lines
ItemReturnFromSupervisorToBranch_BOReturn payload

Typical Workflow

Procure-to-issue cycle:

Data Flow

  1. Masters define items, UOM, vendors, and stock locations scoped by CompID.
  2. Requisition writes demand → PO links vendor and quantities.
  3. ItemReceived increments stock via receipt SPs.
  4. Issue controllers decrement source location and increment destination (employee/unit).
  5. Return controllers reverse or transfer balances.
  6. FormReport reads ledger snapshots for print/export.

Reports

OutputController
Stock form reportsFormReport (Crystal / Excel)
Dashboard summariesStockDashboard via stock DAL

Management MIS for uniform issue/recovery may also appear in Management Dashboard.

Permissions

GateRequirement
Module flagdtVerifyUser.ZSTOCK == true
SessionValid CompID
Branch contextBranchCode from session on branch-scoped screens
Menu permissionsPer-screen DB permissions

Common Issues

SymptomLikely cause
Negative stockIssue without receipt or wrong return path
PO cannot closeOpen receipts or partial GRN
Wrong issue screenMultiple similarly named ItemIssue controllers
Empty form reportDate/location filter or unpublished .rpt

Important Notes

Many similarly named controllers

Issue and return paths are split by organizational topology. Pick the controller that matches your from → to locations, not the shortest name.

Close POs

Use ClosePurchaseOrder after final receipt to prevent duplicate GRNs.

Common Mistakes

MistakeConsequence
Using ItemIssue when EmpItemIssue is requiredEmployee ledger not updated
Skipping requisition audit trailProcurement compliance gap
Issuing before GRNOn-hand quantity errors

Next Steps

  1. Complete StockMaster setup (items + vendors).
  2. Run a test requisition → PO → receipt on one branch.
  3. Issue to a pilot unit and reconcile with FormReport.