All tables
tables · table

cpotext

The cpotext table serves as a repository for extended textual information related to Central Purchase Orders (CPOs). While standard item details are stored in structured detail tables, this table captures unstructured data such as technical specifications, annexures, delivery schedules, and special terms and conditions. It is primarily used for generating printed purchase order documents where long-form text (e.g., machine specifications or legal clauses) is required.

Row count
44
Last entry
Source
tables

Columns

5
ColumnTypeNullableMeaning
indexintegerNoInternal unique identifier/Primary Key
compcodestringNoCompany Code identifier
ponointegerNoPurchase Order Number
cpodetailstringYesExtended text content, specifications, or annexures
invyearintegerNoFinancial or Inventory Year

Full documentation

### 1) Overview
 The `cpotext` table serves as a repository for extended textual information related to Central Purchase Orders (CPOs). While standard item details are stored in structured detail tables, this table captures unstructured data such as technical specifications, annexures, delivery schedules, and special terms and conditions. It is primarily used for generating printed purchase order documents where long-form text (e.g., machine specifications or legal clauses) is required.
 
 ### 2) Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | No | Internal unique identifier/Primary Key | Auto-incremented integers | Primary Key for record isolation. |
 | **compcode** | string | No | Company Code identifier | e.g., "DAS" | Join key used to filter by specific business entity. |
 | **pono** | integer | No | Purchase Order Number | e.g., 359, 1858 | Core foreign key linking to PO header and details. |
 | **cpodetail** | string | Yes | Extended text content, specifications, or annexures | Multiline text/HTML/Unstructured data | Used in reporting and PO print-outs. |
 | **invyear** | integer | No | Financial or Inventory Year | e.g., 2017, 2023 | Join key to ensure PO uniqueness across years. |
 
 ### 3) Relationships & Join Map
 
 The `cpotext` table acts as an extension of the Purchase Order system. It provides supplemental text for headers and items.
 
 **Primary Joins (Strictly per SCHEMA_MAP):**
 * **dbo.cpohdr**: Joins on `pono`, `compcode`, and `invyear`. This link provides the main PO metadata (Supplier, Date, Total Value) for the specific text record.
 * **dbo.cpodtl**: Joins on `pono`, `compcode`, and `invyear`. This link associates the text with specific items on the purchase order (Likely for item-specific technical specs).
 * **dbo.cpotextamnd**: Joins on `pono`, `compcode`, and `invyear`. This links the current text to its amendment history (specifically via `amendno` found in the amnd table).
 
 **Secondary Joins (Usage Context):**
 * **dbo.cpotemphdr**: Joins on `pono`, `compcode`, and `invyear`. Used during the draft phase before the PO is finalized.
 * **dbo.Performainvhdr**: Joins on `pono`, `compcode`, and `invyear`. Used when referencing the original PO text during the Proforma Invoice generation.