tables · table
pohdr
The pohdr table serves as the Purchase Order Header (often functioning as a Sales Order header in this ERP context) for customer-facing transactions. It stores high-level administrative details, shipment addresses, payment terms, and amendment tracking for orders received from customers.
Row count
915
Last entry
2026-12-20
Source
tables
Columns
20| Column | Type | Nullable | Meaning |
|---|---|---|---|
compcode | string | No | Unique identifier for the company/branch. |
PONO | string | No | Customer Purchase Order Number. |
custcode | string | No | Unique identifier for the customer. |
POdate | datetime | Yes | The date the Purchase Order was issued by the customer. |
locked | string | Yes | Finalization status of the PO. |
amndno | integer | No | Amendment/Revision number for the PO. |
amnddate | datetime | Yes | The date of the last amendment. |
oano | number | Yes | Internal Order Acceptance Number. |
oadate | datetime | Yes | Internal Order Acceptance Date. |
currency | string | Yes | Transaction currency for the order. |
credit_days | integer | Yes | Number of days allowed for payment. |
mode_payment | string | Yes | Defined method of payment. |
desp_thru | string | Yes | Mode of dispatch or transport provider. |
Consignee | string | Yes | The party to whom the goods are being sent. |
validupto | datetime | Yes | Expiry date of the PO terms. |
wefdate | datetime | Yes | "With Effect From" date for terms/pricing. |
useradd | string | Yes | Username of the creator. |
addtime | string | Yes | Timestamp of record creation. |
usermod | string | Yes | Username of the last modifier. |
modtime | string | Yes | Timestamp of last modification. |
Full documentation
### 1) Overview The `pohdr` table serves as the **Purchase Order Header** (often functioning as a Sales Order header in this ERP context) for customer-facing transactions. It stores high-level administrative details, shipment addresses, payment terms, and amendment tracking for orders received from customers. Key functional aspects include: * **Version Control:** Uses `amndno` (Amendment Number) to track revisions of a single `PONO`. * **Status Management:** Employs the `locked` flag to indicate whether an order is finalized. * **External Integration:** Links internal Order Acceptance numbers (`oano`) to customer Purchase Orders (`PONO`). ### 2) Column Dictionary | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage | | :--- | :--- | :--- | :--- | :--- | :--- | | **compcode** | string | No | Unique identifier for the company/branch. | e.g., "DAS" | Primary Join Key | | **PONO** | string | No | Customer Purchase Order Number. | | Primary Business Key | | **custcode** | string | No | Unique identifier for the customer. | e.g., "NAEL", "BIL" | Join Key to `cust` table | | **POdate** | datetime | Yes | The date the Purchase Order was issued by the customer. | | Filter/Reporting | | **locked** | string | Yes | Finalization status of the PO. | 'Y' (Locked), 'N' (Unlocked) | Filter for Active Rates | | **amndno** | integer | No | Amendment/Revision number for the PO. | 0 for original | Version Tracking | | **amnddate** | datetime | Yes | The date of the last amendment. | | Tracking | | **oano** | number | Yes | Internal Order Acceptance Number. | | Join to `oadtl` | | **oadate** | datetime | Yes | Internal Order Acceptance Date. | | Tracking | | **currency** | string | Yes | Transaction currency for the order. | e.g., "INR", "USD" | Financial Reporting | | **credit_days** | integer | Yes | Number of days allowed for payment. | | Terms Calculation | | **mode_payment** | string | Yes | Defined method of payment. | | Reference | | **desp_thru** | string | Yes | Mode of dispatch or transport provider. | | Logistics | | **Consignee** | string | Yes | The party to whom the goods are being sent. | | Shipping | | **validupto** | datetime | Yes | Expiry date of the PO terms. | | Validation | | **wefdate** | datetime | Yes | "With Effect From" date for terms/pricing. | | Pricing Logic | | **useradd** | string | Yes | Username of the creator. | | Audit | | **addtime** | string | Yes | Timestamp of record creation. | | Audit | | **usermod** | string | Yes | Username of the last modifier. | | Audit | | **modtime** | string | Yes | Timestamp of last modification. | | Audit | ### 3) Relationships & Join Map The `pohdr` table acts as a central hub for sales/customer order processing. #### Primary Joins (Strictly based on SCHEMA_MAP): * **podtl (PO Details):** Joins via `(pono, custcode, compcode)`. This is the most common join to retrieve line items for a header. * **cust (Customer Master):** Joins via `(custcode, compcode)` to retrieve customer names and credit profiles. * **pohdramnd (PO Amendment History):** Joins via `(pono, custcode, compcode)` to track previous versions of headers. * **oadtl (Order Acceptance Details):** Joins via `(oano, compcode)` (Likely, as oano is the internal link). * **debithdr (Debit Notes):** Joins via `(pono, compcode)` (Likely, per `AgainstPONo` in `Debithdr`). #### Reference Context: * **Price Extraction:** Used in `FGStock` and `PPC_COPQ` procedures to determine the valid rate for an item by joining `pohdr` -> `podtl` -> `saleitemmas` where `pohdr.locked = 'N'`. * **Balance Tracking:** Used in `viewsobalance` to calculate outstanding quantities against customer invoices.