All tables
tables · table

cpohdr

The cpohdr (Consumable Purchase Order Header) table serves as the primary repository for metadata related to purchase orders for consumable and general items (Type: 'CS'). It stores administrative details, commercial terms (FOR, delivery dates, payment terms), supplier references, and total valuation for a specific order. This table is the "Parent" in the Consumables PO lifecycle, linked to itemized details and subsequent goods receipt documents.

Row count
5,275
Last entry
2026-12-26
Source
tables

Columns

27
ColumnTypeNullableMeaning
indexintegerNOPrimary Key
compcodestringNOCompany Identifier
typestringYESPO Category
ponointegerNOPurchase Order Number
podatedatetimeYESPurchase Order Creation Date
supcodestringYESSupplier Code
indentnointegerYESRequisition/Indent Reference
deliverydatetimeYESExpected Delivery Date
f_o_rstringYESFreight On Road Terms
refdatedatetimeYESReference/Indent Date
quotationnostringYESVendor Quotation Reference
amendnointegerYESPO Amendment Sequence
remarksstringYESHeader Level Remarks
authflagintegerYESAuthorization Status
povaluenumberYESTotal PO Value
povaluewordstringYESTotal PO Value (In Words)
lockstringYESStatus Lock
invyearintegerNOFinancial/Inventory Year
useraddstringYESUser who created PO
userauthstringYESUser who authorized PO
ConsigneestringYESReceiving Party Code
locationstringYESInternal Storage Location
CGST_AmtstringYESTotal Central GST Amount
SGST_AmtstringYESTotal State GST Amount
IGST_AmtstringYESTotal Integrated GST Amount
Freight_AmtstringYESShipping/Freight Cost
Cancel_flagstringYESCancellation Status

Full documentation

### 1) Overview
 The `cpohdr` (Consumable Purchase Order Header) table serves as the primary repository for metadata related to purchase orders for consumable and general items (Type: 'CS'). It stores administrative details, commercial terms (FOR, delivery dates, payment terms), supplier references, and total valuation for a specific order. This table is the "Parent" in the Consumables PO lifecycle, linked to itemized details and subsequent goods receipt documents.
 
 ### 2) Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | NO | Primary Key | 0, 1, 2... | Internal row ID |
 | **compcode** | string | NO | Company Identifier | e.g., "DAS" | Join key to all tables |
 | **type** | string | YES | PO Category | "CS " (Consumables) | Filter/Discriminator |
 | **pono** | integer | NO | Purchase Order Number | | Unique PO reference |
 | **podate** | datetime | YES | Purchase Order Creation Date | | Temporal reporting |
 | **supcode** | string | YES | Supplier Code | Links to `suppmas` | Vendor identification |
 | **indentno** | integer | YES | Requisition/Indent Reference | | Link to `cindent` |
 | **delivery** | datetime | YES | Expected Delivery Date | | Logistics tracking |
 | **f_o_r** | string | YES | Freight On Road Terms | e.g., "ROHTAK" | Commercial terms |
 | **term_1..7** | string | YES | Commercial Terms & Conditions | | Legal/PO Printing |
 | **refdate** | datetime | YES | Reference/Indent Date | | Audit trail |
 | **quotationno** | string | YES | Vendor Quotation Reference | | Procurement trail |
 | **amendno** | integer | YES | PO Amendment Sequence | 0 = Original | Version control |
 | **remarks** | string | YES | Header Level Remarks | | User notes |
 | **authflag** | integer | YES | Authorization Status | 1 = Authorized | Workflow filter |
 | **povalue** | number | YES | Total PO Value | | Financial reporting |
 | **povalueword**| string | YES | Total PO Value (In Words) | | Document printing |
 | **lock** | string | YES | Status Lock | "N", "Y" | Edit protection |
 | **invyear** | integer | NO | Financial/Inventory Year | e.g., 2013 | Join key for partitioning |
 | **useradd** | string | YES | User who created PO | | Audit |
 | **userauth** | string | YES | User who authorized PO | | Audit |
 | **Consignee** | string | YES | Receiving Party Code | Links to `suppmas` | Shipping instruction |
 | **location** | string | YES | Internal Storage Location | Links to `location` | Inventory routing |
 | **CGST_Amt** | string | YES | Total Central GST Amount | | Taxation |
 | **SGST_Amt** | string | YES | Total State GST Amount | | Taxation |
 | **IGST_Amt** | string | YES | Total Integrated GST Amount | | Taxation |
 | **Freight_Amt** | string | YES | Shipping/Freight Cost | | Valuation |
 | **Cancel_flag** | string | YES | Cancellation Status | "Y", NULL | Exclusion filter |
 
 ### 3) Relationships & Join Map
 
 #### Join Logic:
 * **Mandatory Composite Keys:** Joins to detail or transactional tables must use `compcode`, `pono`, and `invyear` to ensure uniqueness across financial years.
 
 #### Physical Joins (SCHEMA_MAP):
 * **PO Details:** Join to `dbo.cpodtl` via `(compcode, pono, invyear)`.
 * **Supplier Info:** Join to `dbo.suppmas` via `(compcode, supcode)`.
 * **Incoming Goods:** Join to `dbo.incomconitem` via `(compcode, pono)`. Note: Goods receipts link back to the PO to track balance.
 * **Inventory Locations:** Join to `dbo.location` via `(compcode, location)`.
 * **Amendments:** Join to `dbo.cpodtlamnd` and `dbo.cpohdramnd` via `(compcode, pono, invyear, amendno)`.
 
 #### Likely Inferred Joins (Usage Context):
 * **Consumable Items:** Through `cpodtl`, joins to `dbo.citemmas` on `citmcode`.
 * **Requisition Tracking:** Links to `dbo.cindent` on `indentno` (Likely).