All tables
tables · table

rmreturncust

The rmreturncust table serves as a ledger for Raw Material Returns from Customers. It tracks instances where raw materials previously issued to or processed for a customer (often in a job-work or sub-contracting context) are returned to the company’s inventory. It includes detailed financial information (taxable amounts, GST breakdown), logistics details (vehicle numbers), and strict auditing references back to original Material Resource Planning/Receipt numbers (mrpno) and Job numbers (jobno).

Row count
98
Last entry
2026-01-05
Source
tables

Columns

28
ColumnTypeNullableMeaning
indexintegerNoPrimary Key
compcodestringNoCompany identifier
returnnointegerNoDocument number for the return
returndatedatetimeNoDate the return was processed
issuenointegerYesReference to original issue document
jobnointegerYesLink to Job Card or Work Order
mrpnointegerNoMaterial Receipt Process Number
rmcodestringNoRaw Material Code
chnointegerYesChallan Number reference
returnwtnumberNoWeight of material returned
remarksstringYesInternal notes
usernamestringYesName of processing user
useraddstringYesUser who added the record
addtimestringYesTimestamp of record creation
invyearintegerYesFinancial/Accounting year
locationstringYesPhysical storage location code
docstringYesFormatted Document string
TaxableAmtnumberYesBase amount before tax
cgst_pernumberYesCGST Percentage
sgst_pernumberYesSGST Percentage
igst_pernumberYesIGST Percentage
cgst_amtnumberYesCalculated CGST value
sgst_amtnumberYesCalculated SGST value
igst_amtnumberYesCalculated IGST value
Total_amtnumberYesTotal value (Taxable + GST)
Vehicle_NostringYesDelivery vehicle registration
consigneestringYesParty receiving/returning material
despbystringYesPerson/Method of dispatch

Full documentation

### 1. Overview
 The `rmreturncust` table serves as a ledger for **Raw Material Returns from Customers**. It tracks instances where raw materials previously issued to or processed for a customer (often in a job-work or sub-contracting context) are returned to the company’s inventory. It includes detailed financial information (taxable amounts, GST breakdown), logistics details (vehicle numbers), and strict auditing references back to original Material Resource Planning/Receipt numbers (`mrpno`) and Job numbers (`jobno`).
 
 ### 2. Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | No | Primary Key | Auto-incrementing ID | `WHERE [index] = 0` |
 | **compcode** | string | No | Company identifier | e.g., "DAS", "RF2" | `JOIN` key for company context |
 | **returnno** | integer | No | Document number for the return | Unique per year | Filter by document ID |
 | **returndate** | datetime | No | Date the return was processed | ISO 8601 | `WHERE returndate >= '2024-04-01'` |
 | **issueno** | integer | Yes | Reference to original issue document | 0 if N/A | Link to `mchdr` (Likely) |
 | **jobno** | integer | Yes | Link to Job Card or Work Order | References `jobcardno` | `JOIN dbo.jobhdr` |
 | **mrpno** | integer | No | Material Receipt Process Number | Unique batch/lot identifier | `JOIN dbo.rmjobrec1st` |
 | **rmcode** | string | No | Raw Material Code | References `rmmas` | `JOIN dbo.rmmas` |
 | **chno** | integer | Yes | Challan Number reference | | Link to `dbo.ChallanBinTrayHDR` |
 | **returnwt** | number | No | Weight of material returned | In kg/units | `SUM(returnwt)` for stock |
 | **remarks** | string | Yes | Internal notes | e.g., "WITHOUT OPERATION" | Descriptive |
 | **username** | string | Yes | Name of processing user | | Audit trail |
 | **useradd** | string | Yes | User who added the record | | Audit trail |
 | **addtime** | string | Yes | Timestamp of record creation | | Audit trail |
 | **invyear** | integer | Yes | Financial/Accounting year | e.g., 2024 | Accounting filters |
 | **location** | string | Yes | Physical storage location code | | `JOIN dbo.location` |
 | **doc** | string | Yes | Formatted Document string | e.g., "JWR/24-25/00048" | UI Display |
 | **TaxableAmt** | number | Yes | Base amount before tax | | Financial reporting |
 | **cgst_per** | number | Yes | CGST Percentage | e.g., 9.0, 14.0 | Tax calculation |
 | **sgst_per** | number | Yes | SGST Percentage | e.g., 9.0, 14.0 | Tax calculation |
 | **igst_per** | number | Yes | IGST Percentage | | Tax calculation |
 | **cgst_amt** | number | Yes | Calculated CGST value | | Financial reporting |
 | **sgst_amt** | number | Yes | Calculated SGST value | | Financial reporting |
 | **igst_amt** | number | Yes | Calculated IGST value | | Financial reporting |
 | **Total_amt** | number | Yes | Total value (Taxable + GST) | | Financial reporting |
 | **Vehicle_No** | string | Yes | Delivery vehicle registration | | Logistics tracking |
 | **consignee** | string | Yes | Party receiving/returning material | e.g., "BAPR", "SKF" | `JOIN dbo.cust` (Likely) |
 | **despby** | string | Yes | Person/Method of dispatch | | Operational log |
 
 ### 3. Relationships & Join Map
 
 #### Real Physical Joins (via SCHEMA_MAP)
 * **dbo.rmjobrec1st**: Join on `(mrpno, compcode)`. This is the primary relationship used to reconcile customer returns against specific material batches issued for job work.
 * **dbo.rmmas**: Join on `(rmcode, compcode)`. Used to retrieve material names, grades, and base units.
 * **dbo.jobhdr**: Join on `jobno` (matching `jobcardno`) and `compcode`. Links returns to specific vendor job cards.
 * **dbo.location**: Join on `(location, compcode)` to determine the physical warehouse site.
 
 #### Likely Joins (Inferred from Usage)
 * **dbo.cust**: Joins on `consignee` (likely matching `custcode`) to get customer master details.
 * **dbo.rmreturn**: Often used in union with this table to provide a complete view of all material returns (vendor + customer).
 
 #### Join Example
 ```sql
 SELECT 
  r.doc, 
  m.rmname, 
  j.heatno, 
  r.returnwt 
 FROM dbo.rmreturncust r
 INNER JOIN dbo.rmmas m ON r.rmcode = m.rmcode AND r.compcode = m.compcode
 INNER JOIN dbo.rmjobrec1st j ON r.mrpno = j.mrpno AND r.compcode = j.compcode
 WHERE r.compcode = 'DAS';
 ```