All tables
tables · table

rgphdr

The rgphdr (Returnable Gate Pass Header) table serves as the primary registry for outgoing material transactions where the items are expected to be returned (e.g., items sent for repair, calibration, or regrinding). It captures high-level logistics, vendor/consignee data, expected return dates, and tax implications (GST) for these movements. This table is a central component in tracking outstanding external inventory and is frequently joined with rgpdtl for line-item details and cmrrhdr for processing returns.

Row count
14,182
Last entry
2026-12-15
Source
tables

Columns

29
ColumnTypeNullableMeaning
indexintegerNoPrimary Key (Internal)
compcodestringNoCompany Code
rgpnointegerNoRGP Number
rgpdatedatetimeNoGate Pass Date
vendcodestringNoVendor Code
remarksstringYesTransaction Purpose
throughstringYesCarrier/Bearer
retdatedatetimeYesExpected Return Date
mprintstringYesPrint Status
st38stringYesForm/Statutory Ref
vehiclestringYesVehicle Number
mrgpnointegerYesMaster RGP Number
tpnamestringYesTransporter Name
rgpdocstringYesDocument String Reference
senderstringYesSending User/Dept
userAddstringYesCreated By
AddDatetimedatetimeYesCreation Timestamp
TotIssQtynumberYesTotal Issued Quantity
TotRecQtynumberYesTotal Received Quantity
LocationstringYesPhysical Site/Plant
authflagintegerYesAuthorization Status
consigneestringYesConsignee Code
CGST_AmtnumberYesCentral Tax Amount
SGST_AmtnumberYesState Tax Amount
IGST_AmtnumberYesIntegrated Tax Amount
TotalAMtnumberYesTotal Invoice Value
tpcodestringYesTransporter Code
HSNstringYesHarmonized System Nom.
e_waybill_nostringYesE-Way Bill Number

Full documentation

### 1. Overview
 The `rgphdr` (Returnable Gate Pass Header) table serves as the primary registry for outgoing material transactions where the items are expected to be returned (e.g., items sent for repair, calibration, or regrinding). It captures high-level logistics, vendor/consignee data, expected return dates, and tax implications (GST) for these movements. This table is a central component in tracking outstanding external inventory and is frequently joined with `rgpdtl` for line-item details and `cmrrhdr` for processing returns.
 
 ### 2. Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | No | Primary Key (Internal) | Incremental | PK for internal indexing. |
 | **compcode** | string | No | Company Code | e.g., "DAS" | Primary join key across all tables. |
 | **rgpno** | integer | No | RGP Number | e.g., 20141 | Unique transaction ID for the Gate Pass. |
 | **rgpdate** | datetime | No | Gate Pass Date | | Filters for reporting (e.g., `GSTITC04`). |
 | **vendcode** | string | No | Vendor Code | | Join to `vendmas.vendcode`. |
 | **remarks** | string | Yes | Transaction Purpose | e.g., "FOR CALIBRATION" | Descriptive context for the pass. |
 | **through** | string | Yes | Carrier/Bearer | | Name of the person carrying the item. |
 | **retdate** | datetime | Yes | Expected Return Date | | Used to track overdue returns. |
 | **mprint** | string | Yes | Print Status | "Y", "N" | Tracking document output. |
 | **st38** | string | Yes | Form/Statutory Ref | | Specific statutory reference codes. |
 | **vehicle** | string | Yes | Vehicle Number | | Logistics tracking. |
 | **mrgpno** | integer | Yes | Master RGP Number | | Document sequence or grouping reference. |
 | **tpname** | string | Yes | Transporter Name | | Used for logistics identification. |
 | **rgpdoc** | string | Yes | Document String Reference | | Formatted No (e.g., "2014-2015/RGP/1"). |
 | **sender** | string | Yes | Sending User/Dept | | internal tracking. |
 | **userAdd** | string | Yes | Created By | | Audit trail. |
 | **AddDatetime** | datetime | Yes | Creation Timestamp | | Audit trail. |
 | **TotIssQty** | number | Yes | Total Issued Quantity | | Header-level sum of items sent out. |
 | **TotRecQty** | number | Yes | Total Received Quantity | | Tracking balance/outstanding. |
 | **Location** | string | Yes | Physical Site/Plant | | Linked to `location.location`. |
 | **authflag** | integer | Yes | Authorization Status | 0, 1 | 1 = Authorized for exit. |
 | **consignee** | string | Yes | Consignee Code | | Join to `vendmas.vendcode` or `cust.custcode`. |
 | **CGST_Amt** | number | Yes | Central Tax Amount | | Tax reporting. |
 | **SGST_Amt** | number | Yes | State Tax Amount | | Tax reporting. |
 | **IGST_Amt** | number | Yes | Integrated Tax Amount | | Tax reporting. |
 | **TotalAMt** | number | Yes | Total Invoice Value | | Gross financial value of the pass. |
 | **tpcode** | string | Yes | Transporter Code | | Join to `transptmas.tpcode`. |
 | **HSN** | string | Yes | Harmonized System Nom. | | Taxation classification. |
 | **e_waybill_no** | string | Yes | E-Way Bill Number | | Logistics/Tax compliance. |
 
 ### 3. Relationships & Join Map
 
 #### Logical Relationships:
 * **Detailed Items:** One `rgphdr` record is parent to many `rgpdtl` records.
 * **Returns Processing:** Linked to `cmrrhdr` and `cmrrdtl` when items are returned against a specific RGP number.
 * **Logistics:** Linked to `transptmas` for transporter details.
 * **Stakeholders:** Linked to `vendmas` (Vendors) or `cust` (Customers/Consignees).
 
 #### Join Rules (SCHEMA_MAP Authoritative):
 
 | Primary Table | Join Table | Join Columns | Meaning |
 | :--- | :--- | :--- | :--- |
 | `rgphdr` | `rgpdtl` | `compcode`, `rgpno` | Header to Line Item details. |
 | `rgphdr` | `vendmas` | `compcode`, `vendcode` | Fetching vendor names and addresses. |
 | `rgphdr` | `cmrrhdr` | `compcode`, `rgpno` | Linking returns to the original Gate Pass. |
 | `rgphdr` | `cmrrdtl` | `compcode`, `rgpno` | Linking individual item returns to the original Gate Pass. |
 | `rgphdr` | `transptmas`| `compcode`, `tpcode` | Fetching Transporter IDs and names. |
 | `rgphdr` | `Statemas` | `statecode` | **Likely** (via `vendmas` intermediate join for tax reporting). |