All tables
tables · table

rmpotabitem

The rmpotabitem table serves as the line-item detail repository for Raw Material Purchase Orders (RM PO). It stores specific data for each raw material associated with a Purchase Order, including quantities, unit rates, unit of measure (UOM), and technical specifications like HSN codes. It acts as the child table to rmpotab (the PO header) and links directly to the raw material master (rmmas) and brand master (brandmas).

Row count
580
Last entry
Source
tables

Columns

13
ColumnTypeNullableMeaning
indexintegerNoPrimary Key (Internal)
compcodestringNoCompany Identifier
ponointegerNoPurchase Order Number
rmcodestringNoRaw Material Code
uomstringYesUnit of Measure
qtynumberYesOrdered Quantity
rmratenumberYesRate per unit of Raw Material
invyearintegerNoFinancial/Invoice Year
rmexdetailstringYesExtra item-level details/description
br_codeintegerYesBrand/Make Code
hsnstringYesHarmonized System Nomenclature (Tax)
LockstringYesItem Lock Status
SNonumberYesSerial Number within the PO

Full documentation

### 1) Overview
 The `rmpotabitem` table serves as the line-item detail repository for Raw Material Purchase Orders (RM PO). It stores specific data for each raw material associated with a Purchase Order, including quantities, unit rates, unit of measure (UOM), and technical specifications like HSN codes. It acts as the child table to `rmpotab` (the PO header) and links directly to the raw material master (`rmmas`) and brand master (`brandmas`).
 
 ### 2) Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | No | Primary Key (Internal) | | Primary Key |
 | **compcode** | string | No | Company Identifier | e.g., 'DAS' | Join Key |
 | **pono** | integer | No | Purchase Order Number | | Join Key |
 | **rmcode** | string | No | Raw Material Code | e.g., 'S15C41' | Join Key / FK to `rmmas` |
 | **uom** | string | Yes | Unit of Measure | KGS, MTR | Descriptive |
 | **qty** | number | Yes | Ordered Quantity | | Aggregation |
 | **rmrate** | number | Yes | Rate per unit of Raw Material | | Commercial Calculation |
 | **invyear** | integer | No | Financial/Invoice Year | e.g., 2024 | Join Key |
 | **rmexdetail** | string | Yes | Extra item-level details/description | | Descriptive |
 | **br_code** | integer | Yes | Brand/Make Code | | FK to `brandmas` |
 | **hsn** | string | Yes | Harmonized System Nomenclature (Tax) | e.g., '72155090' | Tax Reporting |
 | **Lock** | string | Yes | Item Lock Status | 'N', Null | Logic Filtering |
 | **SNo** | number | Yes | Serial Number within the PO | | Ordering / Row ID |
 
 ### 3) Relationships & Join Map
 
 #### Parent Tables
 * **dbo.rmpotab**: The primary header table. Join on `compcode`, `pono`, and `invyear`.
 * **dbo.rmmas**: The Raw Material master. Join on `compcode` and `rmcode`.
 * **dbo.brandmas**: Contains manufacturer/brand names. Join on `compcode` and `br_code`.
 
 #### Child / Reference Tables
 * **dbo.rmincoming**: Records the actual receipt of materials against these PO lines. Join on `compcode`, `pono`, and `rmcode`.
 * **dbo.rmpotabitemamnd**: Contains the history of changes (amendments) for these specific items. Join on `compcode`, `pono`, and `rmcode`.
 * **dbo.scheduledtl**: Used in scheduling procurement. Join on `compcode` and `pono`.
 
 #### Recommended Joins (Strict)
 ```sql
 -- Fetching PO Details with Material Names
 SELECT a.pono, b.rmname, a.qty, a.rmrate
 FROM rmpotabitem a
 INNER JOIN rmmas b ON a.compcode = b.compcode AND a.rmcode = b.rmcode;
 
 -- Fetching PO Details with Brand/Make
 SELECT a.pono, a.rmcode, c.br_name
 FROM rmpotabitem a
 LEFT JOIN brandmas c ON a.compcode = c.compcode AND a.br_code = c.Br_code;
 
 -- Checking Balance (PO vs Incoming)
 SELECT a.pono, a.qty AS Ordered, SUM(i.billwt) AS Received
 FROM rmpotabitem a
 INNER JOIN rmincoming i ON a.compcode = i.compcode AND a.pono = i.pono AND a.rmcode = i.rmcode
 GROUP BY a.pono, a.qty;
 ```