All tables
tables · table

oadtl

The oadtl (Order Amendment Detail) table serves as the primary line-item repository for sales orders and scheduling in the ERP system. It records specific quantities, product identifiers, and customer purchase order references associated with an Order Amendment (OA). It functions as a child table to oahdr (Header) and is critical for "Schedule vs. Dispatch" reporting, production planning, and inventory tracking.

Row count
43,371
Last entry
2026-01-08
Source
tables

Columns

12
ColumnTypeNullableMeaning
indexintegerNOPrimary Key / Row identifier
compcodestringNOCompany Code
oanointegerNOOrder Amendment Number
oadatedatetimeYESOrder Amendment Date
itemcodestringYESSystem-defined Product Code
qtynumberYESOrdered/Scheduled Quantity
ponostringYESCustomer Purchase Order Number
variantstringYESProduct variant or specification
partnostringYESCustomer Part Number
planqtynumberYESPlanned Production Quantity
tantativeQtynumberYESTentative or Projected Quantity
amendnointegerYESAmendment sequence number

Full documentation

### 1) Overview
 The `oadtl` (Order Amendment Detail) table serves as the primary line-item repository for sales orders and scheduling in the ERP system. It records specific quantities, product identifiers, and customer purchase order references associated with an Order Amendment (OA). It functions as a child table to `oahdr` (Header) and is critical for "Schedule vs. Dispatch" reporting, production planning, and inventory tracking.
 
 ### 2) Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | NO | Primary Key / Row identifier | Auto-incremented | `WHERE [index] = 10` |
 | **compcode** | string | NO | Company Code | e.g., 'DAS', 'BAM' | Join key to most master tables. |
 | **oano** | integer | NO | Order Amendment Number | | Link to `oahdr.oano`. |
 | **oadate** | datetime | YES | Order Amendment Date | | Temporal filtering for sales reports. |
 | **itemcode** | string | YES | System-defined Product Code | | Links to `saleitemmas.itemcode`. |
 | **qty** | number | YES | Ordered/Scheduled Quantity | | Used in `SUM()` for total order volume. |
 | **pono** | string | YES | Customer Purchase Order Number | | Links to customer's source document. |
 | **variant** | string | YES | Product variant or specification | | Secondary item classification. |
 | **partno** | string | YES | Customer Part Number | | Cross-reference for customer-facing docs. |
 | **planqty** | number | YES | Planned Production Quantity | | Production planning and gap analysis. |
 | **tantativeQty** | number | YES | Tentative or Projected Quantity | | Used in forecasting stored procedures. |
 | **amendno** | integer | YES | Amendment sequence number | 0, 1, 2... | Tracks revisions to the detail lines. |
 
 ### 3) Relationships & Join Map
 
 The table is a central node in the sales and production cycle, primarily linking order demands to production outcomes.
 
 #### Authoritative Joins (Based on SCHEMA_MAP & Reference logic):
 
 * **oahdr**: Joined on `oano` and `compcode`. This is a Parent-Child relationship where one header has multiple detail lines.
 * **saleitemmas**: Joined on `itemcode` and `compcode`. Used to retrieve Sales Names, Finish Weights, and Item Incharges (Custodians).
 * **podtl**: Joined on `pono`, `itemcode`, and `compcode`. Used to compare the customer's purchase order rates (`itemrate`) against the internal order quantities.
 * **oadtlamnd**: Joined on `oano`, `itemcode`, and `compcode`. Provides the history of changes/amendments for specific line items.
 * **invdtl / invhdr**: Joined via `oano` (often through subqueries) to determine `SaleQty` (Dispatched Quantity) vs. `SchQty` (Scheduled Quantity).
 
 #### Likely Joins:
 * **itemmas**: Joined via `saleitemmas.rmitemcode` or directly on `itemcode` to determine raw material requirements (MRP) based on order volume.
 * **joboadtl**: Joined on `itemcode` and `compcode` for subcontracting/job work order details.
 
 ---