All tables
tables · table

desp1stjobdtl

The desp1stjobdtl table serves as the line-item detail for first-stage job work or dispatch challans. It captures the specific operations (e.g., Hardening, Normalizing, Final inspection) performed on items listed in a dispatch challan. This table acts as a child to the desp1stjob header and is critical for calculating job work income and monitoring manufacturing progress across different operation stages.

Row count
10,806
Last entry
Source
tables

Columns

9
ColumnTypeNullableMeaning
indexintegerNoInternal primary key for the record.
compcodestringNoCompany code for multi-tenant identification.
chnointegerNoChallan Number; links to the parent dispatch header.
oprcodestringNoOperation Code identifying the manufacturing step.
withoutoprstringYesFlag indicating if operation details are bypassed.
invyearintegerNoFinancial/Invoice year associated with the challan.
itemcodestringNoThe unique identifier for the part or raw material.
oprratestringYesThe rate charged for the specific operation.
opramtstringYesTotal amount for the operation (Qty * Rate).

Full documentation

### 1) Overview
 The `desp1stjobdtl` table serves as the line-item detail for first-stage job work or dispatch challans. It captures the specific operations (e.g., Hardening, Normalizing, Final inspection) performed on items listed in a dispatch challan. This table acts as a child to the `desp1stjob` header and is critical for calculating job work income and monitoring manufacturing progress across different operation stages.
 
 ### 2) Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | No | Internal primary key for the record. | | Primary Key |
 | **compcode** | string | No | Company code for multi-tenant identification. | e.g., "DAS" | Join Key (Global) |
 | **chno** | integer | No | Challan Number; links to the parent dispatch header. | | Join Key (Header) |
 | **oprcode** | string | No | Operation Code identifying the manufacturing step. | BC, FINAL, HARD, HOT, NORM, SB | Join Key / Filter |
 | **withoutopr** | string | Yes | Flag indicating if operation details are bypassed. | 'N', 'Y' | Filter (Logic) |
 | **invyear** | integer | No | Financial/Invoice year associated with the challan. | e.g., 2023 | Join Key |
 | **itemcode** | string | No | The unique identifier for the part or raw material. | | Join Key / Search |
 | **oprrate** | string | Yes | The rate charged for the specific operation. | | Calculation |
 | **opramt** | string | Yes | Total amount for the operation (Qty * Rate). | | Financial Reporting |
 
 ### 3) Relationships & Join Map
 
 #### Parent Table
 * **desp1stjob**: Joins on `compcode`, `chno`, and `invyear`. This table provides header context such as dates, customer codes, and total quantities.
 
 #### Reference Tables
 * **itemopr**: Joins on `compcode`, `itemcode`, and `oprcode`. Used to retrieve standard operation details, drawing numbers, and weights specific to that item-operation pair.
 * **oprmas**: Joins on `compcode` and `oprcode`. Used to get the descriptive name of the operation (e.g., "HARD" -> "Hardening").
 * **itemmas**: Joins on `compcode` and `itemcode`. Used to fetch part numbers, HSN codes, and item descriptions.
 
 #### JOIN Examples
 ```sql
 -- Join with Header and Item Operations for financial reporting
 SELECT 
  h.chdate, 
  d.itemcode, 
  o.oprname, 
  d.opramt
 FROM desp1stjobdtl d
 INNER JOIN desp1stjob h ON d.chno = h.chno AND d.compcode = h.compcode AND d.invyear = h.invyear
 INNER JOIN oprmas o ON d.oprcode = o.oprcode AND d.compcode = o.compcode
 WHERE d.withoutopr = 'N';
 ```