All tables
tables · table

tempcust

The tempcust table serves as a transactional staging or reporting table used to track the flow of items from production (job cards) to billing (invoices) for specific customers. It bridges the gap between Material Requirement Planning (mrpno), production (jobcardno), raw material usage (rmcode), and financial dispatch (billno). It appears to be a summary table for customer-specific order fulfillment and returns.

Row count
1,635
Last entry
2026-01-12
Source
tables

Columns

23
ColumnTypeNullableMeaning
indexintegerNoPrimary Key / Row Identifier
compcodestringNoCompany Identifier
mrpnointegerYesMaterial Requisition/Receipt Number
mrpdatedatetimeYesDate associated with the MRP record
custcodestringYesCustomer Identifier
jobcardnointegerYesProduction Job Card Number
itemcodestringYesFinished good / Part identifier
rmcodestringYesRaw Material Identifier
rmweightnumberYesTotal weight of raw material used
pcsintegerYesTotal quantity in pieces
billnonumberYesInvoice or Billing document number
billdatedatetimeYesDate of billing/invoice
qtysentnumberYesQuantity dispatched to customer
qtyrecdnumberYesQuantity received (returns or reversals)
wtrecdnumberYesWeight received (returns)
retnostringYesReturn Document Number
retdatestringYesDate of return
retwtstringYesWeight of returned material
uiflagstringYesInterface or status flag
chwtnumberYesTheoretical or Chargeable weight
PjobDatedatetimeYesPrevious or Processing Job Date
CustLotNostringYesCustomer-specific lot/batch identifier
ProdLotNostringYesInternal production lot/batch identifier

Full documentation

### 1) Overview
 The `tempcust` table serves as a transactional staging or reporting table used to track the flow of items from production (job cards) to billing (invoices) for specific customers. It bridges the gap between Material Requirement Planning (`mrpno`), production (`jobcardno`), raw material usage (`rmcode`), and financial dispatch (`billno`). It appears to be a summary table for customer-specific order fulfillment and returns.
 
 ### 2) Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | No | Primary Key / Row Identifier | 0, 1, 2... | `PRIMARY KEY` |
 | **compcode** | string | No | Company Identifier | e.g., "DAS" | `JOIN`, `WHERE` |
 | **mrpno** | integer | Yes | Material Requisition/Receipt Number | e.g., 14789 | `JOIN`, `GROUP BY` |
 | **mrpdate** | datetime | Yes | Date associated with the MRP record | ISO Date | `WHERE`, `ORDER BY` |
 | **custcode** | string | Yes | Customer Identifier | e.g., "BAPR" | `JOIN` |
 | **jobcardno** | integer | Yes | Production Job Card Number | e.g., 3891 | `JOIN` |
 | **itemcode** | string | Yes | Finished good / Part identifier | e.g., "DRIVESHAFT" | `JOIN` |
 | **rmcode** | string | Yes | Raw Material Identifier | e.g., "EN353-48" | `JOIN` |
 | **rmweight** | number | Yes | Total weight of raw material used | Decimal | `SUM` |
 | **pcs** | integer | Yes | Total quantity in pieces | Integer | `SUM` |
 | **billno** | number | Yes | Invoice or Billing document number | e.g., 2388 | `JOIN` (Likely `invno`) |
 | **billdate** | datetime | Yes | Date of billing/invoice | ISO Date | `WHERE` |
 | **qtysent** | number | Yes | Quantity dispatched to customer | Decimal | `SUM` |
 | **qtyrecd** | number | Yes | Quantity received (returns or reversals) | Decimal | `SUM` |
 | **wtrecd** | number | Yes | Weight received (returns) | Decimal | `SUM` |
 | **retno** | string | Yes | Return Document Number | | `JOIN` |
 | **retdate** | string | Yes | Date of return | | `WHERE` |
 | **retwt** | string | Yes | Weight of returned material | | `SUM` |
 | **uiflag** | string | Yes | Interface or status flag | e.g., "*" | `FILTER` |
 | **chwt** | number | Yes | Theoretical or Chargeable weight | Decimal | `MATH` |
 | **PjobDate** | datetime | Yes | Previous or Processing Job Date | | `WHERE` |
 | **CustLotNo** | string | Yes | Customer-specific lot/batch identifier | | `FILTER` |
 | **ProdLotNo** | string | Yes | Internal production lot/batch identifier | | `FILTER` |
 
 ### 3) Relationships & Join Map
 
 #### Logical Joins
 * **Customer Master**: Join to `dbo.cust` on `custcode` and `compcode`.
 * **Item Master**: Join to `dbo.itemmas` on `itemcode` and `compcode`.
 * **Job Card Details**: Join to `dbo.jobhdr` on `jobcardno` and `compcode`.
 * **Raw Material Master**: Join to `dbo.rmmas` on `rmcode` and `compcode`.
 * **Invoices**: Join to `dbo.invhdr` on `billno` (mapped to `invno`) and `compcode`.
 
 #### Join Matrix (SCHEMA_MAP Priority)
 
 | From Table | To Table | Join Column(s) | Join Type |
 | :--- | :--- | :--- | :--- |
 | `tempcust` | `dbo.cust` | `compcode`, `custcode` | Consistent |
 | `tempcust` | `dbo.itemmas` | `compcode`, `itemcode` | Consistent |
 | `tempcust` | `dbo.rmmas` | `compcode`, `rmcode` | Consistent |
 | `tempcust` | `dbo.jobhdr` | `compcode`, `jobcardno` | Consistent |
 | `tempcust` | `dbo.invhdr` | `compcode`, `billno` -> `invno` | Likely |
 | `tempcust` | `dbo.mrcirhdr` | `compcode`, `mrpno` | Consistent |