All tables
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
ColumnTypeNullableMeaning
indexintegerNoInternal primary identifier.
compcodestringNoUnique identifier for the company/branch.
oanointegerNo**Order Acceptance Number**. The primary document reference.
oadatedatetimeNoDate the order acceptance was created.
custcodestringNoUnique identifier for the customer.
ponostringYesCustomer's Purchase Order number.
podatedatetimeYesDate of the customer's Purchase Order.
schdatefromstringYesStart date for the delivery schedule.
schdatetostringYesEnd date for the delivery schedule.
amendnointegerNoAmendment version number.
amenddatedatetimeYesDate the document was last amended.
reasonstringYesNarrative for the order acceptance or amendment.
custSchNostringYesCustomer'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.
 
 ---