tables · table
potype
The potype table serves as a reference master for Purchase Order (PO) categories within the system. It defines specific types of purchase documents (e.g., "CS" for Customer Service/Contract Sale or "CP" for Central Purchase) mapped against specific company codes. This table is primarily used to validate or categorize headers in the purchasing and procurement modules.
Row count
4
Last entry
—
Source
tables
Columns
3| Column | Type | Nullable | Meaning |
|---|---|---|---|
index | integer | No | Primary key identifier for the record. |
compcode | string | No | The unique identifier for the company/branch. |
type | string | No | The alphanumeric code representing the PO Type. |
Full documentation
### 1. Overview The `potype` table serves as a reference master for Purchase Order (PO) categories within the system. It defines specific types of purchase documents (e.g., "CS" for Customer Service/Contract Sale or "CP" for Central Purchase) mapped against specific company codes. This table is primarily used to validate or categorize headers in the purchasing and procurement modules. ### 2. Column Dictionary | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage | | :--- | :--- | :--- | :--- | :--- | :--- | | **index** | integer | No | Primary key identifier for the record. | | Primary Key | | **compcode** | string | No | The unique identifier for the company/branch. | e.g., "DAS", "PDS" | Join, Filter | | **type** | string | No | The alphanumeric code representing the PO Type. | e.g., "CS", "CP" | Join, Group By | ### 3. Relationships & Join Map The `potype` table acts as a validation source for Purchase Order headers. Joins should be restricted to tables containing both company identifiers and PO type classifications. #### Primary Joins (Authoritative) * **dbo.cpohdr** (`compcode`, `type`): Joins to the Purchase Order Header to provide type-based descriptions or filtering for active POs. * **dbo.cpohdramnd** (`compcode`, `type`): Joins to the Purchase Order Amendment history to track changes within specific PO categories. * **dbo.cpotemphdr** (`compcode`, `type`): Joins to the temporary/draft Purchase Order storage during the creation process. #### Likely/Inferred Joins * **dbo.company** (`compcode`): Joins to retrieve full company metadata. * **dbo.pohdr** (`compcode`): While `pohdr` lacks a direct `type` column in the schema map, it is functionally related to PO types via the company context. * **dbo.cust** (`compcode`, `type`): Likely used to filter customers based on the types of POs they are eligible to receive or issue.