tables · table
rmreturnendpcs
The rmreturnendpcs table functions as a tracking ledger for raw material "end pieces" (leftover segments or scrap material) returned from job workers or vendors to the factory. In the manufacturing workflow, it acts as a reconciliation point between raw material issued (issueno) and the actual weight of usable pieces vs. scrap returned. It is primarily used in material audit reports (e.g., GST ITC-04, Job Work Status) to calculate material realization and adjust vendor balances.
Row count
978
Last entry
2026-01-15
Source
tables
Columns
17| Column | Type | Nullable | Meaning |
|---|---|---|---|
index | integer | No | Primary Key |
compcode | string | No | Company identifier |
returnno | integer | No | Unique return transaction number |
returndate | datetime | No | Date the end pieces were returned |
issueno | integer | Yes | Reference to the original RM issue |
jobno | integer | No | **Critical Link** to the production job card |
mrpno | integer | Yes | Material Requirement Planning number |
rmcode | string | No | Raw Material SKU/Code |
chno | integer | Yes | Challan Number associated with the return |
returnwt | number | No | Actual weight of the returned material |
remarks | string | Yes | Internal notes or scrap descriptions |
username | string | Yes | Current user session |
useradd | string | Yes | User who created the record |
addtime | string | Yes | Timestamp of entry creation |
gpno | integer | Yes | Gate Pass Number |
gpdate | datetime | Yes | Gate Pass Date |
location | string | Yes | Physical storage location |
Full documentation
### 1) Overview The `rmreturnendpcs` table functions as a tracking ledger for raw material "end pieces" (leftover segments or scrap material) returned from job workers or vendors to the factory. In the manufacturing workflow, it acts as a reconciliation point between raw material issued (`issueno`) and the actual weight of usable pieces vs. scrap returned. It is primarily used in material audit reports (e.g., GST ITC-04, Job Work Status) to calculate material realization and adjust vendor balances. ### 2) Column Dictionary | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage | | :--- | :--- | :--- | :--- | :--- | :--- | | **index** | integer | No | Primary Key | | `PRIMARY KEY` | | **compcode** | string | No | Company identifier | e.g., "DAS" | `JOIN`, `WHERE` | | **returnno** | integer | No | Unique return transaction number | | Internal tracking | | **returndate** | datetime | No | Date the end pieces were returned | | Temporal filtering | | **issueno** | integer | Yes | Reference to the original RM issue | 0 if not linked directly | Correlation to `rmincoming` | | **jobno** | integer | No | **Critical Link** to the production job card | | Joins with `jobhdr` | | **mrpno** | integer | Yes | Material Requirement Planning number | | Planning correlation | | **rmcode** | string | No | Raw Material SKU/Code | e.g., "TUBE22.23" | Joins with `rmmas` | | **chno** | integer | Yes | Challan Number associated with the return | | Documentation ref | | **returnwt** | number | No | Actual weight of the returned material | e.g., 50.0, 9.879 | Calculation of Balances | | **remarks** | string | Yes | Internal notes or scrap descriptions | e.g., "SCRAP PIECE" | Information only | | **username** | string | Yes | Current user session | | Audit | | **useradd** | string | Yes | User who created the record | | Audit | | **addtime** | string | Yes | Timestamp of entry creation | | Audit | | **gpno** | integer | Yes | Gate Pass Number | | Security/Inward log | | **gpdate** | datetime | Yes | Gate Pass Date | | Security/Inward log | | **location** | string | Yes | Physical storage location | | Joins with `location` | ### 3) Relationships & Join Map #### Logical Joins (Verified via SCHEMA_MAP & REFERENCE_JSON) 1. **Job Work Header (`dbo.jobhdr`)** * **Relationship**: Many-to-One * **Join Column**: `rmreturnendpcs.jobno` = `jobhdr.jobcardno` AND `compcode` * **Context**: Used to calculate the "balance weight" and "balance pieces" remaining with a vendor after returns. 2. **Raw Material Master (`dbo.rmmas`)** * **Relationship**: Many-to-One * **Join Column**: `rmreturnendpcs.rmcode` = `rmmas.rmcode` AND `compcode` * **Context**: Retrieves descriptions, sizes, and base units of measure (UoM) for reporting. 3. **Vendor Master (`dbo.vendmas`)** * **Relationship**: Indirect (Likely via `jobhdr`) * **Join Column**: `jobhdr.vendcode` = `vendmas.vendcode` * **Context**: Required for vendor-wise ledger reporting. 4. **RM Job Work Header (`dbo.rmjobhdr`)** * **Relationship**: Many-to-One * **Join Column**: `rmreturnendpcs.jobno` = `rmjobhdr.jobcardno` AND `compcode` * **Context**: Specific to raw material job processing cards. #### Usage in Reports (Reference) * **Reconciliation**: `returnwt` is often divided by `jobhdr.cw` (Cheeseweight/Piece Weight) to estimate the number of pieces returned as scrap. * **Gate Entry**: Joined in `viewinwardgateregister` to show inward movement of scrap material using `gpno`.