All tables
tables · table

citemusedinpitem

The citemusedinpitem table serves as a specialized Bill of Materials (BOM) or Consumption Mapping table. It defines the relationship between consumable items (citmcode) and parent production items (PItemcode).

Row count
3,053
Last entry
Source
tables

Columns

7
ColumnTypeNullableMeaning
compcodestringNoUnique identifier for the company/entity.
citmcodestringNoConsumable Item Code (Child component).
PItemcodestringNoParent Item Code (Finished or semi-finished good).
uomstringYesUnit of Measure for the consumable item.
qtynumberYesQuantity of the consumable required for one unit of the parent item.
oprcodestringYesOperation Code where this consumable is introduced.
indexintegerNoPrimary Key (Internal/Identity).

Full documentation

### 1. Overview
 The `citemusedinpitem` table serves as a specialized **Bill of Materials (BOM) or Consumption Mapping** table. It defines the relationship between consumable items (`citmcode`) and parent production items (`PItemcode`). 
 
 Unlike a standard engineering BOM, this table is operation-specific, identifying exactly which consumable is used during a particular manufacturing step (`oprcode`). It is primarily used in production requirement reports to calculate necessary stock balances and consumed quantities based on parent item production schedules.
 
 ### 2. Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **compcode** | string | No | Unique identifier for the company/entity. | e.g., "DAS", "BAM" | `JOIN`, `WHERE` |
 | **citmcode** | string | No | Consumable Item Code (Child component). | e.g., "PDF-197-36-A" | `JOIN`, `FK` |
 | **PItemcode** | string | No | Parent Item Code (Finished or semi-finished good). | e.g., "0032", "VALVEBODY" | `JOIN`, `FK` |
 | **uom** | string | Yes | Unit of Measure for the consumable item. | e.g., "PCS", "KGS" | `Comparison` |
 | **qty** | number | Yes | Quantity of the consumable required for one unit of the parent item. | e.g., 1.0, 0.5 | `Aggregation` |
 | **oprcode** | string | Yes | Operation Code where this consumable is introduced. | e.g., "IBH" | `JOIN`, `WHERE` |
 | **index** | integer | No | Primary Key (Internal/Identity). | | `PK` |
 
 ### 3. Relationships & Join Map
 
 Based on the `SCHEMA_MAP` and logic provided in the reference procedures, the following relationships are authoritative:
 
 #### Primary Joins
 * **dbo.citemmas** (Consumable Master):
  * `citemusedinpitem.citmcode` = `citemmas.citmcode`
  * `citemusedinpitem.compcode` = `citemmas.compcode`
  * *Usage*: To retrieve the name and group of the consumable item.
 * **dbo.itemmas** (Parent Item Master):
  * `citemusedinpitem.PItemcode` = `itemmas.itemcode`
  * `citemusedinpitem.compcode` = `itemmas.compcode`
  * *Usage*: To retrieve the description and part number of the produced parent item.
 * **dbo.oprmas** (Operation Master):
  * `citemusedinpitem.oprcode` = `oprmas.oprcode`
  * `citemusedinpitem.compcode` = `oprmas.compcode`
  * *Usage*: To identify the manufacturing process name associated with the consumption.
 
 #### Likely Downstream Joins (Production & Tracking)
 * **dbo.citisdtl** (Consumable Issue Detail):
  * `citemusedinpitem.citmcode` = `citisdtl.citmcode` (Likely used to track actual vs. required consumption).
 * **dbo.productionistiind** (Production Entry):
  * `citemusedinpitem.PItemcode` = `productionistiind.itemcode`
  * `citemusedinpitem.oprcode` = `productionistiind.curoprcode`
  * *Usage*: Used to calculate the total requirement of consumables based on reported production volume.