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
| Controller | Primary responsibility |
|---|---|
| StockDashboard | Module home |
| StockMaster | Items, vendors, groups, company/branch stock |
Procurement
| Controller | Primary responsibility |
|---|---|
| Requisition | Internal requisition |
| GeneratePurchaseOrder | PO creation |
| ClosePurchaseOrder | PO closure |
| ItemReceived | Vendor receipt |
Issue paths
| Controller | Primary responsibility |
|---|---|
| ItemIssue | Generic issue |
| ItemIssueBranchToBranch | Branch-to-branch |
| ItemIssueBranchToSupervisor | Branch to supervisor |
| ItemIssueCompanyUnitSite | Company to unit site |
| ItemIssueSupervisorToSupervisor | Supervisor transfer |
| EmpIssueEntry / EmpItemIssue | Employee issue |
Return paths
| Controller | Primary responsibility |
|---|---|
| ItemReturn | Generic return |
| ItemReturnFromBranchToBranch | Branch return |
| ItemReturnFromBranchSupervisorToCompany | To company |
| ItemReturnFromSupervisorToBranch | Supervisor to branch |
| ItemReturnFromUnitSiteToCompany | Unit site to company |
| ItemReturnfromSuperToSuper | Supervisor loop |
Reports
| Controller | Primary responsibility |
|---|---|
| FormReport | Stock form reports |
Views / Layout
| Asset | Role |
|---|---|
_StockLayout.cshtml | Module shell |
| Stock dashboard CSS | Unified sidebar styling |
| FormReport views + Crystal | Printable stock forms |
DAL
Representative classes in DAL/Stock/:
| DAL class | Role |
|---|---|
| Requisition_DAL | Requisition CRUD |
| ItemReceiveFromVendor_DAL | GRN / receipt |
| ItemIssueToUnit_DAL / ItemIssueCompanyToUnitSite_DAL | Issue transactions |
| ItemReturnFromSupervisorToBranch_DAL | Return paths |
| CompanyStock_DAL / BranchStock_DAL | Location balances |
| VendorMaster_DAL / ItemMaster_DAL | Masters |
| EmpIssueEntry_DAL / frmItemIssueToEmployee_DAL | Employee issues |
Business Objects
Namespace: BO.Stock
| BO type | Role |
|---|---|
| ItemMaster_BO | Item definition |
| VendorMaster_BO | Vendor master |
| CompanyStock_BO / BranchStock_BO | Location stock |
| ItemIssueCompanyToUnitSite_BO | Issue payload |
| EmpIssueEntry_BO | Employee issue lines |
| ItemReturnFromSupervisorToBranch_BO | Return payload |
Typical Workflow
Procure-to-issue cycle:
Data Flow
- Masters define items, UOM, vendors, and stock locations scoped by
CompID. - Requisition writes demand → PO links vendor and quantities.
- ItemReceived increments stock via receipt SPs.
- Issue controllers decrement source location and increment destination (employee/unit).
- Return controllers reverse or transfer balances.
- FormReport reads ledger snapshots for print/export.
Reports
| Output | Controller |
|---|---|
| Stock form reports | FormReport (Crystal / Excel) |
| Dashboard summaries | StockDashboard via stock DAL |
Management MIS for uniform issue/recovery may also appear in Management Dashboard.
Permissions
| Gate | Requirement |
|---|---|
| Module flag | dtVerifyUser.ZSTOCK == true |
| Session | Valid CompID |
| Branch context | BranchCode from session on branch-scoped screens |
| Menu permissions | Per-screen DB permissions |
Common Issues
| Symptom | Likely cause |
|---|---|
| Negative stock | Issue without receipt or wrong return path |
| PO cannot close | Open receipts or partial GRN |
| Wrong issue screen | Multiple similarly named ItemIssue controllers |
| Empty form report | Date/location filter or unpublished .rpt |
Related Pages
Important Notes
Issue and return paths are split by organizational topology. Pick the controller that matches your from → to locations, not the shortest name.
Use ClosePurchaseOrder after final receipt to prevent duplicate GRNs.
Common Mistakes
| Mistake | Consequence |
|---|---|
| Using ItemIssue when EmpItemIssue is required | Employee ledger not updated |
| Skipping requisition audit trail | Procurement compliance gap |
| Issuing before GRN | On-hand quantity errors |
Next Steps
- Complete StockMaster setup (items + vendors).
- Run a test requisition → PO → receipt on one branch.
- Issue to a pilot unit and reconcile with FormReport.