All tables
tables · table

cmrrduty

The cmrrduty table is a transaction-level ledger in SQL Server that stores the breakdown of duties, taxes, and additional charges associated with Material Repair Receipts (CMRR). It acts as a child table to the cmrrhdr (Header) and is typically populated when consumable items or repairable goods are received back from a vendor. It allows for multi-tax line items (e.g., CGST, SGST, IGST) per receipt number (mrpno).

Row count
20,102
Last entry
Source
tables

Columns

6
ColumnTypeNullableMeaning
indexintegerNOPrimary Key (Internal)
compcodestringNOUnique identifier for the company/branch.
mrpnointegerNOMaterial Receipt Plan Number. Corresponds to the receipt header.
duty_codeintegerNOCode identifying the type of tax or duty applied.
amountnumberYESThe calculated monetary value of the specific duty.
snointegerYESSerial number within the specific MRP document.

Full documentation

### 1. Overview
 The `cmrrduty` table is a transaction-level ledger in SQL Server that stores the breakdown of duties, taxes, and additional charges associated with **Material Repair Receipts (CMRR)**. It acts as a child table to the `cmrrhdr` (Header) and is typically populated when consumable items or repairable goods are received back from a vendor. It allows for multi-tax line items (e.g., CGST, SGST, IGST) per receipt number (`mrpno`).
 
 ### 2. Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | NO | Primary Key (Internal) | Auto-incrementing | `PRIMARY KEY` |
 | **compcode** | string | NO | Unique identifier for the company/branch. | e.g., "DAS", "HFL" | Join key; filter for multi-tenant data. |
 | **mrpno** | integer | NO | Material Receipt Plan Number. Corresponds to the receipt header. | e.g., 56, 136 | Join key to `cmrrhdr` and `cmrrdtl`. |
 | **duty_code** | integer | NO | Code identifying the type of tax or duty applied. | 51 (CGST), 52 (SGST), 53 (IGST), 8 (CST) | Join key to `cdutymas` or `dutymas`. |
 | **amount** | number | YES | The calculated monetary value of the specific duty. | e.g., 1112.4, 0.08 | Summed for tax reporting (GST Input). |
 | **sno** | integer | YES | Serial number within the specific MRP document. | 1, 2, 3... | Used for row ordering per document. |
 
 ### 3. Relationships & Join Map
 
 The table is a bridge between Receipt Headers and Tax Masters. Joins must always include `compcode`.
 
 #### Authoritative Joins (SCHEMA_MAP Priority)
 * **dbo.cmrrhdr (Header)**: Joins on `mrpno` and `compcode` to retrieve bill dates, bill numbers, and vendor codes.
 * **dbo.cmrrdtl (Details)**: Joins on `mrpno` and `compcode` to link specific duties back to the items received.
 * **dbo.cdutymas (Duty Master)**: Joins on `duty_code` and `compcode` to retrieve the names of the taxes (e.g., "Output CGST @ 9%").
 
 #### Likely Joins (Inferred from Usage)
 * **dbo.vendmas (Vendor Master)**: Joined via `cmrrhdr (vendcode)` to link tax amounts to specific vendors for GST Input credit reports.
 * **dbo.appdutymas**: Joins on `duty_code` to determine which taxes are applicable to specific transaction types.
 
 ---