tables · table
invdtl
The invdtl table serves as the primary line-item detail repository for sales invoices within the ERP system. It records specific transaction data for each item sold, including quantities, unit rates, discounts, and item-level tax distributions (CGST, SGST, IGST).
Row count
255,126
Last entry
2026-01-15
Source
tables
Columns
47| Column | Type | Nullable | Meaning |
|---|---|---|---|
index | integer | No | Primary Key |
compcode | string | No | Company Identifier |
invno | integer | No | Invoice Number |
invyear | integer | No | Financial Year of Invoice |
itemcode | string | No | Unique Item/Product Code |
partno | string | Yes | Customer Part Number |
itemqty | number | Yes | Quantity invoiced |
itemrate | number | Yes | Unit price per item |
uom | string | Yes | Unit of Measure |
itemdisc | number | Yes | Discount percentage or amount |
itemamt | number | Yes | Total amount for the line item (Pre-tax) |
noofcases | integer | Yes | Number of packing cases/cartons |
sno | integer | Yes | Serial Number (Line sequence) |
pageno | string | Yes | Reference page in invoice documents |
ct3no | string | Yes | CT-3 certificate number (Exemption) |
packdetail | string | Yes | Packaging specifics |
packmode | string | Yes | Mode of packing |
pitemcode | string | Yes | Parent Item Code (Likely) |
pono | string | Yes | Customer Purchase Order Reference |
noofbox | string | Yes | Number of boxes |
mrpno | integer | Yes | Material Receipt/RM Batch reference |
cgst_per | string | Yes | CGST Tax Percentage |
cgst_amt | string | Yes | CGST Tax Amount |
sgst_per | string | Yes | SGST Tax Percentage |
sgst_amt | string | Yes | SGST Tax Amount |
igst_per | string | Yes | IGST Tax Percentage |
igst_amt | string | Yes | IGST Tax Amount |
hsn | string | Yes | Harmonized System Nomenclature code |
taxableamount | string | Yes | Net taxable value after discounts |
invclose | string | Yes | Status flag for item closure |
lotno | string | Yes | Manufacturing Lot Number |
custcode | string | Yes | Customer Identifier |
Suplitemrate | string | Yes | Supplementary Item Rate |
Suplamndno | string | Yes | Supplementary Amendment Number |
amndno | string | Yes | Amendment Number |
amnddate | string | Yes | Amendment Date |
PDIRNo | string | Yes | Pre-Despatch Inspection Report Number |
PDIRDate | string | Yes | PDIR Date |
HeatNo | string | Yes | Raw Material Heat Number |
tcsamt | number | Yes | Tax Collected at Source Amount |
Gross_Rate | number | Yes | Rate including certain components |
ItemName | string | Yes | Product Description |
RMC | string | Yes | Raw Material Cost (Likely) |
RMC_RMRate | string | Yes | Rate of RM used in product |
RMC_ConvCharges | string | Yes | Conversion charges for product |
ManufacturingDate | string | Yes | Date of manufacture |
ExpiryDate | string | Yes | Product expiry date |
Full documentation
### 1) Overview The `invdtl` table serves as the primary line-item detail repository for sales invoices within the ERP system. It records specific transaction data for each item sold, including quantities, unit rates, discounts, and item-level tax distributions (CGST, SGST, IGST). The table is fundamentally linked to `invhdr` (Invoice Header) via a composite key of `compcode`, `invno`, and `invyear`. It supports various business processes including domestic sales, export sales, raw material sales, and job work-related invoicing. Traceability features such as `lotno`, `HeatNo`, and `PDIRNo` (Pre-Despatch Inspection Report) are included to ensure quality control standards are met during the shipping process. ### 2) Column Dictionary | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage | | :--- | :--- | :--- | :--- | :--- | :--- | | **index** | integer | No | Primary Key | | Filter: `WHERE index = ...` | | **compcode** | string | No | Company Identifier | e.g., "DAS", "BAM" | Join: `invhdr`, `saleitemmas` | | **invno** | integer | No | Invoice Number | | Join: `invhdr`, `invtax` | | **invyear** | integer | No | Financial Year of Invoice | e.g., 2013, 2024 | Join: `invhdr`, `invtax` | | **itemcode** | string | No | Unique Item/Product Code | e.g., "CP-088" | Join: `saleitemmas`, `itemmas` | | **partno** | string | Yes | Customer Part Number | | Joins/Display | | **itemqty** | number | Yes | Quantity invoiced | | Aggregation: `SUM(itemqty)` | | **itemrate** | number | Yes | Unit price per item | | Calculation: `itemqty * itemrate` | | **uom** | string | Yes | Unit of Measure | e.g., "Nos", "PCS", "KGS" | Join logic (KGS/MTR vs Nos) | | **itemdisc** | number | Yes | Discount percentage or amount | | Calculation | | **itemamt** | number | Yes | Total amount for the line item (Pre-tax) | | Aggregation: `SUM(itemamt)` | | **noofcases** | integer | Yes | Number of packing cases/cartons | | Calculation | | **sno** | integer | Yes | Serial Number (Line sequence) | | Sorting | | **pageno** | string | Yes | Reference page in invoice documents | | Display | | **ct3no** | string | Yes | CT-3 certificate number (Exemption) | | Regulatory reporting | | **packdetail** | string | Yes | Packaging specifics | | Display | | **packmode** | string | Yes | Mode of packing | | Filter | | **pitemcode** | string | Yes | Parent Item Code (Likely) | | Relationship logic | | **pono** | string | Yes | Customer Purchase Order Reference | | Join: `podtl` | | **noofbox** | string | Yes | Number of boxes | | Display | | **mrpno** | integer | Yes | Material Receipt/RM Batch reference | | Join: `rmincoming`, `rmjobrec1st` | | **cgst_per** | string | Yes | CGST Tax Percentage | | Calculation | | **cgst_amt** | string | Yes | CGST Tax Amount | | Aggregation | | **sgst_per** | string | Yes | SGST Tax Percentage | | Calculation | | **sgst_amt** | string | Yes | SGST Tax Amount | | Aggregation | | **igst_per** | string | Yes | IGST Tax Percentage | | Calculation | | **igst_amt** | string | Yes | IGST Tax Amount | | Aggregation | | **hsn** | string | Yes | Harmonized System Nomenclature code | e.g., "87089900" | Join: `chapter` | | **taxableamount** | string | Yes | Net taxable value after discounts | | Aggregation | | **invclose** | string | Yes | Status flag for item closure | 'Y', 'N' | Filter | | **lotno** | string | Yes | Manufacturing Lot Number | | Traceability | | **custcode** | string | Yes | Customer Identifier | e.g., "APL" | Join: `cust` | | **Suplitemrate** | string | Yes | Supplementary Item Rate | | Display | | **Suplamndno** | string | Yes | Supplementary Amendment Number | | Display | | **amndno** | string | Yes | Amendment Number | | Versioning | | **amnddate** | string | Yes | Amendment Date | | Versioning | | **PDIRNo** | string | Yes | Pre-Despatch Inspection Report Number | | Traceability | | **PDIRDate** | string | Yes | PDIR Date | | Display | | **HeatNo** | string | Yes | Raw Material Heat Number | | Traceability | | **tcsamt** | number | Yes | Tax Collected at Source Amount | | Aggregation | | **Gross_Rate** | number | Yes | Rate including certain components | | Display | | **ItemName** | string | Yes | Product Description | | Display | | **RMC** | string | Yes | Raw Material Cost (Likely) | | Analysis | | **RMC_RMRate** | string | Yes | Rate of RM used in product | | Analysis | | **RMC_ConvCharges** | string | Yes | Conversion charges for product | | Analysis | | **ManufacturingDate**| string | Yes | Date of manufacture | | Traceability | | **ExpiryDate** | string | Yes | Product expiry date | | Traceability | ### 3) Relationships & Join Map #### Authoritative Joins (Schema Map) * **invhdr**: Join via `compcode`, `invno`, and `invyear`. This provides access to invoice dates, customer details, and invoice status flags. * **saleitemmas**: Join via `compcode` and `itemcode`. Used to retrieve master product descriptions (`salesname`), weights (`finishwt`), and category information. * **cust**: Join via `compcode` and `custcode` to get customer names, addresses, and GST status. * **invtax**: Join via `compcode`, `invno`, `invyear`, and `sno`. This is used to link specific tax duties associated with the invoice line. * **podtl**: Join via `compcode`, `custcode`, `pono`, and `itemcode` to reconcile against the original Customer Purchase Order. #### Functional Joins (Likely) * **rmincoming**: Join via `compcode` and `mrpno` (matching `mrpno` in `invdtl`). Primarily used when selling raw materials or items with strict RM traceability. * **rmjobrec1st**: Join via `compcode` and `mrpno`. Used in Job Work scenarios to track the return of processed material to the customer. * **pdiinspectionhdr**: Join via `compcode`, `invno`, and `invyear`. Links to pre-despatch inspection metadata. * **invlotdetail**: Join via `compcode`, `invno`, `invyear`, and `itemcode`. Provides granular lot tracking for specific items. ---