All tables
tables · table

sfpo

The sfpo table serves as the Purchase Order Header for Semi-Finished (SF) goods. It stores high-level procurement metadata, including supplier references, contract terms (Term 1-7), delivery schedules, and taxation totals (GST breakdown). It is a critical component in the procurement-to-receipt workflow, linking indents (requisitions) to final goods receipts (fghdr).

Row count
46
Last entry
2026-03-31
Source
tables

Columns

22
ColumnTypeNullableMeaning
indexintegerNoPrimary Key
compcodestringNoPhysical Company Code
pononumberNoPurchase Order Number
podatedatetimeYesDate PO was issued
supcodestringYesSupplier Code
indentnointegerYesReference Requisition Number
deliverydatetimeYesExpected Delivery Date
f_o_rstringYesFreight on Receipt terms
usernamestringYesRecord Creator
amndnointegerYesAmendment/Version Number
authflagnumberYesAuthorization Status
povaluenumberYesTotal Base Value of PO
invyearintegerYesFinancial Year for Invoice/PO
consigneestringYesShipping destination code
PODocstringYesHuman-readable PO Document ID
TaxableAmtnumberYesAmount subject to tax
CGST_AmtnumberYesCentral GST Amount
SGST_AmtnumberYesState GST Amount
IGST_AmtnumberYesIntegrated GST Amount
LocationstringYesPhysical Plant/Warehouse location
lockstringYesRecord modification lock
auth_datedatetimeYesFinal Authorization Timestamp

Full documentation

### 1. Overview
 The `sfpo` table serves as the **Purchase Order Header** for Semi-Finished (SF) goods. It stores high-level procurement metadata, including supplier references, contract terms (Term 1-7), delivery schedules, and taxation totals (GST breakdown). It is a critical component in the procurement-to-receipt workflow, linking indents (requisitions) to final goods receipts (`fghdr`).
 
 ### 2. Column dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | No | Primary Key | | |
 | **compcode** | string | No | Physical Company Code | e.g., "DAS" | Joins to `suppmas`, `sfpoitem` |
 | **pono** | number | No | Purchase Order Number | | Unique PO ID per year |
 | **podate** | datetime | Yes | Date PO was issued | | Filtering by date range |
 | **supcode** | string | Yes | Supplier Code | e.g., "ST", "RF" | Joins to `suppmas.supcode` |
 | **indentno** | integer | Yes | Reference Requisition Number | | Joins to `sfindent.indentno` |
 | **delivery** | datetime | Yes | Expected Delivery Date | | Schedule tracking |
 | **f_o_r** | string | Yes | Freight on Receipt terms | e.g., "Rohtak" | Shipping terms |
 | **term_1..7** | string | Yes | Standardized Contract Terms | | Payment/Shipping details |
 | **username** | string | Yes | Record Creator | | Audit trail |
 | **amndno** | integer | Yes | Amendment/Version Number | 0 = Original | Track PO revisions |
 | **authflag** | number | Yes | Authorization Status | 1.0 = Authorized | Logic gate for processing |
 | **povalue** | number | Yes | Total Base Value of PO | | Financial reporting |
 | **invyear** | integer | Yes | Financial Year for Invoice/PO | e.g., 2013 | Part of composite logical key |
 | **consignee** | string | Yes | Shipping destination code | | Joins to `suppmas.supcode` |
 | **PODoc** | string | Yes | Human-readable PO Document ID | e.g., "SF/2021-22/0009" | Display on reports |
 | **TaxableAmt** | number | Yes | Amount subject to tax | | Tax calculation base |
 | **CGST_Amt** | number | Yes | Central GST Amount | | Financial reconciliation |
 | **SGST_Amt** | number | Yes | State GST Amount | | Financial reconciliation |
 | **IGST_Amt** | number | Yes | Integrated GST Amount | | Interstate transactions |
 | **Location** | string | Yes | Physical Plant/Warehouse location | | Joins to `location.location` |
 | **lock** | string | Yes | Record modification lock | 'Y', 'N' | Concurrency control |
 | **auth_date** | datetime | Yes | Final Authorization Timestamp | | Audit/SLA tracking |
 
 ### 3. Relationships & join map
 
 #### Primary Logical Key
 The logical uniqueness of a record is typically maintained by: `compcode` + `pono` + `invyear` + `amndno`.
 
 #### Joins (Authoritative via SCHEMA_MAP)
 * **PO Line Items**: Join to `sfpoitem` using `(pono, compcode, invyear)`.
 * **Supplier Details**: Join to `suppmas` using `(supcode, compcode)`.
 * **Requisition Reference**: Join to `sfindent` using `(indentno, compcode)`.
 * **Goods Receipt**: Join to `fghdr` (Finish Goods Header) using `(pono, compcode)` to track received vs. ordered quantities.
 * **Site/Location**: Join to `location` using `(location, compcode)`.
 * **HSN/Taxation**: Join to `chapter` (Inferred via REFERENCE_JSON) using `(hsn)`.
 
 #### Likely Joins (Based on Usage)
 * **Amendments**: Join to `sfpoamnd` using `(pono, compcode, invyear, amndno)` to compare historical versions.
 * **User Info**: Join to `pass1` using `(username, compcode)`.