All tables
tables · table

goodreceipt

The goodreceipt table is a central inventory and quality control ledger in the SQL Server database. It tracks the physical receipt of items, the results of quality inspections (accepted vs. rejected quantities), and the subsequent entry of these items into the store. It differentiates between opening stock balances (txnflag = 0) and standard receipt transactions (txnflag = 1).

Row count
107,795
Last entry
2026-01-16
Source
tables

Columns

23
ColumnTypeNullableMeaning
indexintegerNOPrimary Key
compcodestringNOCompany Identifier
inspectnonumberYESInspection Document Number
inspecdatedatetimeYESDate of quality inspection
lotnostringYESProduction Lot Number
itemcodestringYESItem or Part Identifier
receiptqtyintegerYESTotal Quantity Received
acptqtyintegerYESQuantity passed inspection
regtdqtyintegerYESQuantity rejected by QC
reasonstringYESRejection Reason
aqtystoreintegerYESAccepted Quantity Stored
mrpnostringYESMaterial Receipt Plan Number
mrpdatestringYESDate of the MRP/MRN
vendcodestringYESSupplier Code
oprcodestringYESOperation Stage Code
uomstringYESUnit of Measure
scrapqtynumberYESQuantity scrapped during receipt
heatnostringYESRaw Material Heat Number
itemflagstringYESItem Category Flag
txnflagintegerYESTransaction Type Flag
locationstringYESStorage Location/Warehouse
IRNostringYESInspection Report Number
ProdnostringYESProduction Order Number

Full documentation

### 1. Overview
 The `goodreceipt` table is a central inventory and quality control ledger in the SQL Server database. It tracks the physical receipt of items, the results of quality inspections (accepted vs. rejected quantities), and the subsequent entry of these items into the store. It differentiates between opening stock balances (`txnflag = 0`) and standard receipt transactions (`txnflag = 1`).
 
 ### 2. Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | NO | Primary Key | | Primary key for unique record identification. |
 | **compcode** | string | NO | Company Identifier | e.g., "DAS", "BAM" | Filter for multi-tenant data partitioning. |
 | **inspectno** | number | YES | Inspection Document Number | | Joins with `goodsbal.inspectno`. |
 | **inspecdate** | datetime | YES | Date of quality inspection | | Used for stock aging and period reporting. |
 | **lotno** | string | YES | Production Lot Number | | Tracking specific batches of material. |
 | **itemcode** | string | YES | Item or Part Identifier | e.g., "CP-312" | Joins to `itemmas`, `saleitemmas`, `product1`. |
 | **receiptqty** | integer | YES | Total Quantity Received | | Base quantity before inspection. |
 | **acptqty** | integer | YES | Quantity passed inspection | | Net increase to usable inventory. |
 | **regtdqty** | integer | YES | Quantity rejected by QC | | Used for vendor performance/rejection reports. |
 | **reason** | string | YES | Rejection Reason | | Narrative or code for QC failure. |
 | **aqtystore** | integer | YES | Accepted Quantity Stored | | Actual quantity added to bin/location. |
 | **mrpno** | string | YES | Material Receipt Plan Number | | Joins with `mrcirhdr.mrpno` or `fghdr.mrpno`. |
 | **mrpdate** | string | YES | Date of the MRP/MRN | | Reference date for material planning. |
 | **vendcode** | string | YES | Supplier Code | | Joins with `vendmas.vendcode`. |
 | **oprcode** | string | YES | Operation Stage Code | e.g., "CLOSE" | Joins with `oprmas.oprcode`. |
 | **uom** | string | YES | Unit of Measure | "PCS", "KGS" | Defines the scale of quantities. |
 | **scrapqty** | number | YES | Quantity scrapped during receipt | | Waste tracking. |
 | **heatno** | string | YES | Raw Material Heat Number | | Forging/casting traceability. |
 | **itemflag** | string | YES | Item Category Flag | "I" (Item), "A" (Assembly) | Used in logic to differentiate stock types. |
 | **txnflag** | integer | YES | Transaction Type Flag | 0 (Opening Bal), 1 (Receipt) | Critical filter for inventory calculations. |
 | **location** | string | YES | Storage Location/Warehouse | | Joins with `location.location`. |
 | **IRNo** | string | YES | Inspection Report Number | | External document reference. |
 | **Prodno** | string | YES | Production Order Number | | Joins with `product1.prodno` or `fghdr.prodno`. |
 
 ---
 
 ### 3. Relationships & Join Map
 
 #### Real Physical Joins (Authoritative)
 Based on `SCHEMA_MAP` and stored procedure logic, `goodreceipt` connects to the following tables:
 
 * **dbo.itemmas**
  * Join on: `itemcode` and `compcode`
  * *Usage:* To retrieve item names, rates, and HSN codes.
 * **dbo.saleitemmas**
  * Join on: `itemcode` (or `groupcode`) and `compcode`
  * *Usage:* Used in `FGStock` procedures to link receipts to sales-facing part numbers.
 * **dbo.groupitem**
  * Join on: `goodreceipt.itemcode = groupitem.groupcode`
  * *Usage:* Used when processing assemblies (`itemflag = 'A'`) to explode components.
 * **dbo.goodsbal**
  * Join on: `inspectno`, `itemcode`, and `compcode`
  * *Usage:* To reconcile current receipts against historical balances.
 * **dbo.vendmas**
  * Join on: `vendcode` and `compcode`
  * *Usage:* Identifying the source supplier of the received goods.
 * **dbo.oprmas**
  * Join on: `oprcode` and `compcode`
  * *Usage:* Validating the production stage the receipt belongs to.
 
 #### Likely Joins (Inferred)
 * **dbo.fghdr**: Likely joins on `Prodno` or `mrpno` to link finished goods receipts to production headers.
 * **dbo.location**: Joins on `location` and `compcode` for physical site validation.