All tables
tables · table

itemcustrate

The itemcustrate table serves as a mapping and pricing configuration ledger between Items and Customers. It defines customer-specific sales rates, part numbers, and drawing references, along with detailed packaging instructions (mode of pack, quantity, and surface finish). This table is frequently used in reporting stored procedures (e.g., jobwork1st2ndoperation_rpt, istitemwisedetail_rpt) to resolve which customer is associated with specific item production or stock.

Row count
915
Last entry
Source
tables

Columns

13
ColumnTypeNullableMeaning
indexintegerNoPrimary Key / Internal Identity
compcodestringNoCompany Code
itemcodestringNoUnique Item Identifier
custcodestringNoCustomer Code
partnostringYesCustomer-specific Part Number
sale_ratenumberYesUnit Selling Price for this specific Customer/Item
itemnamestringYesItem Name / Description
surf_finishstringYesSurface Finish requirement
packqtyintegerYesStandard Quantity per Outer Pack
modeofpackstringYesPrimary Packaging Type
custdrawingstringYesCustomer Drawing Number/Reference
submodeofpackstringYesSecondary/Inner Packaging Type
subpackqtynumberYesQuantity within the sub-pack

Full documentation

### 1) Overview
 The `itemcustrate` table serves as a mapping and pricing configuration ledger between Items and Customers. It defines customer-specific sales rates, part numbers, and drawing references, along with detailed packaging instructions (mode of pack, quantity, and surface finish). This table is frequently used in reporting stored procedures (e.g., `jobwork1st2ndoperation_rpt`, `istitemwisedetail_rpt`) to resolve which customer is associated with specific item production or stock.
 
 ### 2) Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | No | Primary Key / Internal Identity | | Internal record tracking. |
 | **compcode** | string | No | Company Code | "DAS", "BAM", etc. | Primary join key for multi-tenant data isolation. |
 | **itemcode** | string | No | Unique Item Identifier | "CP-003", "FGS" | Join key to `itemmas` and production tables. |
 | **custcode** | string | No | Customer Code | "QHTL(M)", "QH(C)" | Join key to `cust` table. |
 | **partno** | string | Yes | Customer-specific Part Number | | Cross-referencing internal items to customer IDs. |
 | **sale_rate** | number | Yes | Unit Selling Price for this specific Customer/Item | | Financial calculation of sales value. |
 | **itemname** | string | Yes | Item Name / Description | | Descriptive reporting. |
 | **surf_finish** | string | Yes | Surface Finish requirement | | Quality/Production specifications. |
 | **packqty** | integer | Yes | Standard Quantity per Outer Pack | | Logistics and shipping calculations. |
 | **modeofpack** | string | Yes | Primary Packaging Type | "BOX", "BIN", "TANKY" | Packing slip generation. |
 | **custdrawing** | string | Yes | Customer Drawing Number/Reference | | Technical documentation link. |
 | **submodeofpack** | string | Yes | Secondary/Inner Packaging Type | | Detailed packing instructions. |
 | **subpackqty** | number | Yes | Quantity within the sub-pack | | Detailed packing instructions. |
 
 ### 3) Relationships & Join Map
 
 Based on `SCHEMA_MAP` and the logic identified in `REFERENCE_JSON`, the following joins are authoritative:
 
 #### Mandatory Joins (Same-Name Columns)
 * **dbo.itemmas**: Join on `compcode` and `itemcode`. Used to fetch internal item master details.
 * **dbo.cust**: Join on `compcode` and `custcode`. Used to resolve Customer Names and Group details (referenced in `TotalItemStock_without_Vendor`).
 * **dbo.invdtl / dbo.podtl**: Join on `itemcode` (and `compcode`) to apply customer-specific rates during invoicing or order processing.
 
 #### Likely Joins (Inferred from Usage)
 * **dbo.job / dbo.jobhdr**: Join on `itemcode` and `compcode`. Used in production reports to identify which customer an active job card belongs to.
 * **dbo.saleitemmas**: Join on `itemcode` and `compcode`. Links the sales-specific item attributes to the customer rate mapping.