All tables
tables · table

jobpohdr

The jobpohdr table serves as the Job Purchase Order Header within the manufacturing ERP. It stores top-level information for Purchase Orders issued to external vendors (subcontractors) for job work operations (e.g., machining, heat treatment, plating).

Row count
151
Last entry
2026-01-08
Source
tables

Columns

27
ColumnTypeNullableMeaning
indexintegerNoInternal primary identity seed
compcodestringNoUnique identifier for the company/branch
ponointegerNoPurchase Order Number
podatedatetimeYesDate the Purchase Order was issued
quotnostringYesReference number of the vendor's quotation
quotdatedatetimeYesDate of the vendor's quotation
vendcodestringNoUnique code for the job work vendor
amendnointegerNoAmendment sequence number (0 = original)
amenddatedatetimeYesDate of the last PO amendment
authflagintegerYesAuthorization/Approval status
wefdatedatetimeYes"With Effect From" date for the PO validity
reasonstringYesReason for the PO or amendment
povaluenumberYesTotal base value of the PO (excluding tax)
povaluewordstringYesTotal value written in words
invyearintegerYesFinancial/Accounting year
po_flagstringYesInternal classification flag
vendcodeCstringYesConsignee/Sub-vendor code (if applicable)
PODocstringYesFormatted PO Document Number
CGST_TaxPernumberYesCentral GST Percentage
CGST_AmtnumberYesCentral GST Amount
SGST_TaxPernumberYesState GST Percentage
SGST_AmtnumberYesState GST Amount
IGST_TaxPernumberYesIntegrated GST Percentage
IGST_AmtnumberYesIntegrated GST Amount
TotalAMtnumberYesGrand total value (Base + Taxes)
POLockstringYesFlag indicating if the PO is locked for editing
LocationstringYesPhysical location/Plant associated with the PO

Full documentation

### 1. Overview
 The `jobpohdr` table serves as the **Job Purchase Order Header** within the manufacturing ERP. It stores top-level information for Purchase Orders issued to external vendors (subcontractors) for job work operations (e.g., machining, heat treatment, plating).
 
 Key functionalities include:
 * **PO Lifecycle Management:** Tracking PO dates, quotation references, and authorization status (`authflag`).
 * **Amendment Tracking:** Managing version history of orders via `amendno` and `amenddate`.
 * **Financial & Tax Compliance:** Recording the total value and detailed GST components (CGST, SGST, IGST).
 * **Contractual Terms:** Storing standardized and custom terms/conditions (`term_1` through `term_6`) for the legal agreement with the vendor.
 
 ### 2. Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | No | Internal primary identity seed | | Primary Key |
 | **compcode** | string | No | Unique identifier for the company/branch | e.g., "DAS" | Join Key |
 | **pono** | integer | No | Purchase Order Number | | Join Key |
 | **podate** | datetime | Yes | Date the Purchase Order was issued | | Filtering |
 | **quotno** | string | Yes | Reference number of the vendor's quotation | | Reference |
 | **quotdate** | datetime | Yes | Date of the vendor's quotation | | Reference |
 | **vendcode** | string | No | Unique code for the job work vendor | e.g., "AI", "HF" | Join Key (to `vendmas`) |
 | **amendno** | integer | No | Amendment sequence number (0 = original) | | Versioning |
 | **amenddate** | datetime | Yes | Date of the last PO amendment | | Audit |
 | **term_1** to **term_6** | string | Yes | Standardized contractual terms (Payment, Delivery, Tax, etc.) | | Reporting |
 | **authflag** | integer | Yes | Authorization/Approval status | 1 = Authorized, 0 = Draft | Logic Filter |
 | **wefdate** | datetime | Yes | "With Effect From" date for the PO validity | | Validity |
 | **reason** | string | Yes | Reason for the PO or amendment | | Audit |
 | **povalue** | number | Yes | Total base value of the PO (excluding tax) | | Financials |
 | **povalueword** | string | Yes | Total value written in words | | Printing |
 | **invyear** | integer | Yes | Financial/Accounting year | e.g., 2023, 2024 | Join Key |
 | **po_flag** | string | Yes | Internal classification flag | e.g., "I" (Inhouse/Import?) | Filtering |
 | **vendcodeC** | string | Yes | Consignee/Sub-vendor code (if applicable) | | Likely Join |
 | **PODoc** | string | Yes | Formatted PO Document Number | e.g., "JOB/2023-24/0010" | UI Display |
 | **CGST_TaxPer** | number | Yes | Central GST Percentage | | Calculation |
 | **CGST_Amt** | number | Yes | Central GST Amount | | Financials |
 | **SGST_TaxPer** | number | Yes | State GST Percentage | | Calculation |
 | **SGST_Amt** | number | Yes | State GST Amount | | Financials |
 | **IGST_TaxPer** | number | Yes | Integrated GST Percentage | | Calculation |
 | **IGST_Amt** | number | Yes | Integrated GST Amount | | Financials |
 | **TotalAMt** | number | Yes | Grand total value (Base + Taxes) | | Financials |
 | **POLock** | string | Yes | Flag indicating if the PO is locked for editing | "N", "Y" | Logic Filter |
 | **Location** | string | Yes | Physical location/Plant associated with the PO | | Filtering |
 
 ### 3. Relationships & Join Map
 
 #### **Primary Joins (Strictly based on SCHEMA_MAP)**
 * **jobpodtl (Job PO Details):** This is the most common join.
  * `jobpohdr.pono = jobpodtl.pono`
  * `jobpohdr.compcode = jobpodtl.compcode`
  * `jobpohdr.invyear = jobpodtl.invyear`
 * **vendmas (Vendor Master):** To retrieve vendor contact and address details.
  * `jobpohdr.vendcode = vendmas.vendcode`
  * `jobpohdr.compcode = vendmas.compcode`
 * **jobpodtlamnd (Amendment Details):**
  * `jobpohdr.pono = jobpodtlamnd.pono`
  * `jobpohdr.compcode = jobpodtlamnd.compcode`
  * `jobpohdr.invyear = jobpodtlamnd.invyear`
 * **cjobpohdr (Common/Standard Job POs):** Used in unions for cross-order reporting (as seen in `viewALLJOBOrder`).
  * `jobpohdr.compcode = cjobpohdr.compcode`
 
 #### **Inferred Indirect Joins (Likely)**
 * **mrcirhdr / mrci_rep (Job Receipting):** Although these tables link back to Job Cards (`jobno`), the stored procedures (e.g., `job_mrp_reg_j13`) frequently join `jobpohdr` to these receipting tables via `vendcode` and `compcode` to validate pricing during vendor billing.
 * **company:** Join on `compcode` to fetch plant headers for PO printing.