tables · table
oahdr
The oahdr table serves as the Order Acceptance Header within the ERP system. It records high-level metadata for sales order acceptances, including customer details, reference purchase orders (PO), amendment tracking, and scheduling dates. It is a central entity for production planning, used to compare customer requirements against actual production and stock (FG/WIP).
Row count
4,809
Last entry
2026-01-31
Source
tables
Columns
13| Column | Type | Nullable | Meaning |
|---|---|---|---|
index | integer | No | Internal primary identifier. |
compcode | string | No | Unique identifier for the company/branch. |
oano | integer | No | **Order Acceptance Number**. The primary document reference. |
oadate | datetime | No | Date the order acceptance was created. |
custcode | string | No | Unique identifier for the customer. |
pono | string | Yes | Customer's Purchase Order number. |
podate | datetime | Yes | Date of the customer's Purchase Order. |
schdatefrom | string | Yes | Start date for the delivery schedule. |
schdateto | string | Yes | End date for the delivery schedule. |
amendno | integer | No | Amendment version number. |
amenddate | datetime | Yes | Date the document was last amended. |
reason | string | Yes | Narrative for the order acceptance or amendment. |
custSchNo | string | Yes | Customer's internal schedule reference number. |
Full documentation
### 1. Overview The `oahdr` table serves as the **Order Acceptance Header** within the ERP system. It records high-level metadata for sales order acceptances, including customer details, reference purchase orders (PO), amendment tracking, and scheduling dates. It is a central entity for production planning, used to compare customer requirements against actual production and stock (FG/WIP). ### 2. Column Dictionary | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage | | :--- | :--- | :--- | :--- | :--- | :--- | | **index** | integer | No | Internal primary identifier. | Primary Key | Filtering/Ordering | | **compcode** | string | No | Unique identifier for the company/branch. | e.g., "DAS", "RF2" | Part of Composite Join Key | | **oano** | integer | No | **Order Acceptance Number**. The primary document reference. | | Primary Join Key | | **oadate** | datetime | No | Date the order acceptance was created. | | Temporal Reporting | | **custcode** | string | No | Unique identifier for the customer. | e.g., "HML(D)", "GILH" | Join to `cust` | | **pono** | string | Yes | Customer's Purchase Order number. | | Reference/Filtering | | **podate** | datetime | Yes | Date of the customer's Purchase Order. | | Reference | | **schdatefrom** | string | Yes | Start date for the delivery schedule. | | Planning | | **schdateto** | string | Yes | End date for the delivery schedule. | | Planning | | **amendno** | integer | No | Amendment version number. | 0 = Original | Version Tracking | | **amenddate** | datetime | Yes | Date the document was last amended. | | Audit/History | | **reason** | string | Yes | Narrative for the order acceptance or amendment. | | Notes | | **custSchNo** | string | Yes | Customer's internal schedule reference number. | | Reference | ### 3. Relationships & Join Map The `oahdr` table is a "Parent" header table in the sales and production workflow. Joins should always include `compcode` to maintain data isolation. #### Primary Detail Joins (One-to-Many) * **oadtl**: Joins on `oano` and `compcode`. This retrieves the specific items and quantities accepted. * **oasch**: Joins on `oano` and `compcode`. This retrieves the date-wise delivery schedule for the order. * **oadtlamnd**: Joins on `oano` and `compcode`. Used to retrieve historical amendment details for specific items. #### Master Table Joins (Many-to-One) * **cust**: Joins on `custcode` and `compcode`. Used to retrieve customer names, addresses, and group codes. #### Workflow Joins (Functional) * **invhdr**: Joins on `oano` and `compcode`. Used to track actual sales/despatches against the accepted order. * **podtl**: Joins on `pono`, `custcode`, and `compcode` (Likely). Used to link the acceptance back to pricing and original PO requirements. * **Performainvhdr**: Joins on `oano` and `compcode`. Links the acceptance to proforma invoices generated. ---