All tables
tables · table

saleitemmas

The saleitemmas table is the authoritative source for item data used in the sales pipeline. While itemmas typically handles production and raw material attributes, saleitemmas focuses on the commercial side, including sales descriptions (salesname), unit prices (sale_rate), and domestic/export classification (Dom_Export). It contains a critical reference column, rmitemcode, which maps the sales item back to its physical production counterpart in the itemmas table.

Row count
1,121
Last entry
Source
tables

Columns

20
ColumnTypeNullableMeaning
indexintegerNoPrimary key identifier for the row.
compcodestringNoUnique identifier for the company/branch.
itemcodestringNoUnique identifier for the sales SKU.
salesnamestringYesThe description of the item as it appears on invoices.
typestringYesClassification of the item type.
rmitemcodestringYesReference to the physical item in `itemmas`.
uomstringYesUnit of Measure.
partnostringYesCustomer-facing part number.
finishwtnumberYesFinished weight of a single piece (likely in grams).
sale_ratenumberYesStandard selling price per unit.
godown_flagstringYesIndicator if the item is tracked in specific warehouses.
chapterstringYesTariff chapter classification for excise/customs.
selfpartnostringYesInternal manufacturer part number.
packqtyintegerYesStandard quantity per pack/box.
taxratenumberYesGST percentage applicable to the item.
hsnstringYesHarmonized System of Nomenclature code.
lockstringYesStatus indicating if the item is active or restricted.
custGroupcodenumberYesLink to a specific customer group category.
Dom_ExportstringYesFlag for Domestic or Export market.
SaleItemGroupCodeintegerYesCategory grouping for items.

Full documentation

This documentation describes the `saleitemmas` table, which serves as the **Sales Item Master**. It stores configurations for finished goods and assemblies specifically for the sales, invoicing, and order management modules, bridging production SKUs with sales-specific attributes like rates, HSN codes, and customer groupings.
 
 ### 1. Overview
 The `saleitemmas` table is the authoritative source for item data used in the sales pipeline. While `itemmas` typically handles production and raw material attributes, `saleitemmas` focuses on the commercial side, including sales descriptions (`salesname`), unit prices (`sale_rate`), and domestic/export classification (`Dom_Export`). It contains a critical reference column, `rmitemcode`, which maps the sales item back to its physical production counterpart in the `itemmas` table.
 
 ### 2. Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | No | Primary key identifier for the row. | Incremental | Internal row reference. |
 | **compcode** | string | No | Unique identifier for the company/branch. | e.g., "DAS", "BAM" | Filter for company-specific data. |
 | **itemcode** | string | No | Unique identifier for the sales SKU. | e.g., ".1", "0058" | Primary join key for sales transactions. |
 | **salesname** | string | Yes | The description of the item as it appears on invoices. | e.g., "SHAFT EXH ROCKER ARM" | Used in report headers and UI. |
 | **type** | string | Yes | Classification of the item type. | **I**: Item, **A**: Assembly | Used to filter Finished Goods vs. Kits. |
 | **rmitemcode** | string | Yes | Reference to the physical item in `itemmas`. | Internal Item Code | **Join key to `itemmas.itemcode`.** |
 | **uom** | string | Yes | Unit of Measure. | Nos, NOS, KGS, MTR | Used for quantity calculations. |
 | **partno** | string | Yes | Customer-facing part number. | e.g., "14452KYY900" | Printed on labels and invoices. |
 | **finishwt** | number | Yes | Finished weight of a single piece (likely in grams). | 1.0, 7.25 | Used to calculate total shipment weight. |
 | **sale_rate** | number | Yes | Standard selling price per unit. | Default unit price | Used in auto-populating invoices. |
 | **godown_flag** | string | Yes | Indicator if the item is tracked in specific warehouses. | Y, N | Warehouse logic filtering. |
 | **chapter** | string | Yes | Tariff chapter classification for excise/customs. | e.g., "87141090" | Used for legacy statutory reporting. |
 | **selfpartno** | string | Yes | Internal manufacturer part number. | e.g., "14452-KYY-9000" | Internal cross-referencing. |
 | **packqty** | integer | Yes | Standard quantity per pack/box. | e.g., 0, 100 | Used in packing slip logic. |
 | **taxrate** | number | Yes | GST percentage applicable to the item. | e.g., 18.0 | Default tax calculation. |
 | **hsn** | string | Yes | Harmonized System of Nomenclature code. | e.g., "87141090" | Mandatory for GST reporting. |
 | **lock** | string | Yes | Status indicating if the item is active or restricted. | Y, N | Filtering inactive items. |
 | **useradd/usermod** | string | Yes | User IDs of the creator and last modifier. | e.g., "jitender" | Audit trail. |
 | **addtime/modtime** | string | Yes | Timestamps for record creation and modification. | Date String | Audit trail. |
 | **custGroupcode** | number | Yes | Link to a specific customer group category. | Link to `CustGroupMas` | Group-specific pricing or logic. |
 | **Dom_Export** | string | Yes | Flag for Domestic or Export market. | **D**: Domestic, **E**: Export | Used in export invoice logic. |
 | **SaleItemGroupCode**| integer | Yes | Category grouping for items. | e.g., 0 | Sales reporting hierarchy. |
 
 ### 3. Relationships & Join Map
 
 #### Logical Primary Key
 * `compcode`, `itemcode`
 
 #### Standard Joins (Physical Columns)
 * **Transactions (Sales/Orders):** Joins to `dbo.invdtl`, `dbo.oadtl`, `dbo.PackingSlipdtl`, `dbo.Performainvdtl`, and `dbo.Debitdtl` using `(compcode, itemcode)`.
 * **Production Link:** Joins to `dbo.itemmas` using `saleitemmas.rmitemcode = itemmas.itemcode` (and `compcode`). This is used to derive production stock levels for sales items.
 * **Customer Grouping:** Joins to `dbo.CustGroupMas` using `(compcode, custGroupcode)`.
 * **Despatch Advice:** Joins to `dbo.despadvicedtl` and `dbo.shippingadvicedtl` via `(compcode, itemcode)`.
 
 #### Join Example (Sales Summary)
 ```sql
 SELECT 
  m.salesname, 
  d.itemqty, 
  d.itemrate, 
  i.itemname AS internal_production_name
 FROM dbo.saleitemmas m
 INNER JOIN dbo.invdtl d ON m.itemcode = d.itemcode AND m.compcode = d.compcode
 LEFT JOIN dbo.itemmas i ON m.rmitemcode = i.itemcode AND m.compcode = i.compcode
 WHERE m.compcode = 'DAS';
 ```