All tables
tables · table

fghdr

The fghdr table (likely standing for Finished Goods Header) serves as the primary transaction log for the procurement and receipt of Semi-Finished (SF) goods from external suppliers. In the context of the ERP system, it tracks the lifecycle of an incoming material receipt note (MRP), including challan quantities, physical receipt, quality acceptance/rejection, and associated financial details like item rates, bill amounts, and GST components.

Row count
7,042
Last entry
2026-01-14
Source
tables

Columns

29
ColumnTypeNullableMeaning
indexintegerNoPrimary Key (Internal)
compcodestringYesCompany Code
mrpnonumberYesMaterial Receipt Note Number
mrpdatedatetimeYesDate of Material Receipt Note
gpnointegerYesGate Pass Number
gpdatedatetimeYesGate Pass Entry Date
ponostringYesPurchase Order Number
billnonumberYesSupplier Invoice/Bill Number
billdatedatetimeYesSupplier Invoice/Bill Date
itemratenumberYesPurchase Rate per unit
chqtynumberYesQuantity as per Supplier Challan
recqtynumberYesActual Quantity Received
acptqtynumberYesQuantity Accepted after QC
rejqtynumberYesQuantity Rejected after QC
irnointegerYesInspection Report Number
irdatedatetimeYesInspection Date
supcodestringYesSupplier Unique Code
itemcodestringYesItem/Product Unique Code
lotnostringYesSupplier/Internal Lot Number
billamountnumberYesTotal Invoice Value (Net)
usernamestringYesUser who processed the entry
noprcodestringYesProcess or Operation Code
heatnostringYesMaterial Heat Number
cgst_amtnumberYesCentral GST Amount
sgst_amtnumberYesState GST Amount
igst_amtstringYesIntegrated GST Amount
Vou_Auth_flagstringYesVoucher Authorization Status
Auth_FlagstringYesGeneral Authorization Status
st38stringYesForm 38 or Statutory Reference

Full documentation

### 1) Overview
 The `fghdr` table (likely standing for **Finished Goods Header**) serves as the primary transaction log for the procurement and receipt of Semi-Finished (SF) goods from external suppliers. In the context of the ERP system, it tracks the lifecycle of an incoming material receipt note (MRP), including challan quantities, physical receipt, quality acceptance/rejection, and associated financial details like item rates, bill amounts, and GST components.
 
 Key characteristics include:
 - **Transaction Tracking**: Records the link between Gate Passes (`gpno`), Purchase Orders (`pono`), and Material Receipt Notes (`mrpno`).
 - **Quality Control**: Segregates quantities into Challan (`chqty`), Received (`recqty`), Accepted (`acptqty`), and Rejected (`rejqty`).
 - **Financial Integration**: Stores item rates and tax amounts (CGST/SGST/IGST) used for generating purchase registers and GST input reports.
 - **Traceability**: Maintains `lotno` and `heatno` for material tracking from the supplier into the production/inventory pipeline.
 
 ### 2) Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | No | Primary Key (Internal) | Incremental | PK |
 | **compcode** | string | Yes | Company Code | e.g., "DAS", "BAM" | Filter/Join |
 | **mrpno** | number | Yes | Material Receipt Note Number | e.g., 76.0, 104.0 | Join/Group |
 | **mrpdate** | datetime | Yes | Date of Material Receipt Note | | Temporal Analysis |
 | **gpno** | integer | Yes | Gate Pass Number | | Tracking |
 | **gpdate** | datetime | Yes | Gate Pass Entry Date | | Audit |
 | **pono** | string | Yes | Purchase Order Number | | Join to `sfpo`/`cpohdr` |
 | **billno** | number | Yes | Supplier Invoice/Bill Number | | Reference |
 | **billdate** | datetime | Yes | Supplier Invoice/Bill Date | | Reference |
 | **itemrate** | number | Yes | Purchase Rate per unit | | Calculation |
 | **chqty** | number | Yes | Quantity as per Supplier Challan | | Reconciliation |
 | **recqty** | number | Yes | Actual Quantity Received | | Reconciliation |
 | **acptqty** | number | Yes | Quantity Accepted after QC | | Inventory Update |
 | **rejqty** | number | Yes | Quantity Rejected after QC | | Debit Note Basis |
 | **irno** | integer | Yes | Inspection Report Number | | QC Link |
 | **irdate** | datetime | Yes | Inspection Date | | Audit |
 | **supcode** | string | Yes | Supplier Unique Code | e.g., "RF", "ST" | Join to `suppmas` |
 | **itemcode** | string | Yes | Item/Product Unique Code | e.g., "CP-00" | Join to `itemmas` |
 | **lotno** | string | Yes | Supplier/Internal Lot Number | | Traceability |
 | **billamount** | number | Yes | Total Invoice Value (Net) | | Financials |
 | **username** | string | Yes | User who processed the entry | | Audit |
 | **noprcode** | string | Yes | Process or Operation Code | e.g., "CLOSE", "HARD" | Join to `itemopr` |
 | **heatno** | string | Yes | Material Heat Number | | Traceability |
 | **cgst_amt** | number | Yes | Central GST Amount | | Taxation |
 | **sgst_amt** | number | Yes | State GST Amount | | Taxation |
 | **igst_amt** | string | Yes | Integrated GST Amount | | Taxation |
 | **Vou_Auth_flag** | string | Yes | Voucher Authorization Status | 'Y', 'N' | Accounting Logic |
 | **Auth_Flag** | string | Yes | General Authorization Status | 'Y', 'N' | Approval Logic |
 | **st38** | string | Yes | Form 38 or Statutory Reference | | Compliance |
 
 ### 3) Relationships & Join Map
 
 #### Real Physical Joins (Authoritative):
 - **suppmas**: Join on `compcode` and `supcode` to retrieve supplier names and addresses for purchase registers.
 - **itemmas**: Join on `compcode` and `itemcode` to get item descriptions, part numbers, and HSN codes.
 - **sfpo / cpohdr**: Join on `compcode` and `pono` to link receipts back to the original Semi-Finished Purchase Order.
 - **srnduty**: Join on `compcode` and `mrpno` to retrieve tax breakups (VAT/GST duties) used in views like `VATC4` and `LP3`.
 - **debithdr / debitdtl**: Join on `compcode`, `mrpno`, and `itemcode` (likely) to process quantity rejections into debit notes.
 - **itemopr**: Join on `compcode`, `itemcode`, and `noprcode` (mapping to `oprcode`) to calculate process-specific weights or next operation balances.
 
 #### Process Inferences (Likely):
 - **goodsbal**: Linked via `compcode` and `itemcode` for opening balance calculations in stock reports.
 - **product2 / mrcirhdr**: Linked via `compcode` and `lotno` for end-to-end material history (WIP tracking).
 
 ---