All tables
tables · table

lablenumbers

The lablenumbers table is a utility table used to store sequential label identification data for invoices. It tracks the individual units or packages (e.g., "1 of 8", "2 of 8") associated with a specific invoice shipment. This data is primarily consumed by the viewinvlabelprinting view to generate physical shipping labels that correlate invoice headers, item details, and total package counts.

Row count
8
Last entry
Source
tables

Columns

7
ColumnTypeNullableMeaning
indexINTNOUnique record identifier (Primary Key).
compcodeVARCHARYESInternal company code used for multi-tenant data separation.
invnoINTYESThe specific invoice number associated with these labels.
invyearINTYESThe financial year or invoice year suffix.
lableVARCHARYESThe descriptive text for the physical label.
custcodeVARCHARYESUnique identifier for the customer.
saleitemcodeVARCHARYESReference to the item master for the item being labeled.

Full documentation

### 1) Overview
 The `lablenumbers` table is a utility table used to store sequential label identification data for invoices. It tracks the individual units or packages (e.g., "1 of 8", "2 of 8") associated with a specific invoice shipment. This data is primarily consumed by the `viewinvlabelprinting` view to generate physical shipping labels that correlate invoice headers, item details, and total package counts.
 
 ### 2) Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | INT | NO | Unique record identifier (Primary Key). | Auto-incrementing integers. | `WHERE index = 0` |
 | **compcode** | VARCHAR | YES | Internal company code used for multi-tenant data separation. | e.g., "DAS" | `JOIN ... ON p.compcode = r.compcode` |
 | **invno** | INT | YES | The specific invoice number associated with these labels. | e.g., 19578 | `JOIN ... ON p.invno = r.invno` |
 | **invyear** | INT | YES | The financial year or invoice year suffix. | e.g., 2025 | `JOIN ... ON p.invyear = r.invyear` |
 | **lable** | VARCHAR | YES | The descriptive text for the physical label. | e.g., "1 of 8", "2 of 8" | `SELECT lable FROM ...` |
 | **custcode** | VARCHAR | YES | Unique identifier for the customer. | e.g., "C001" | `JOIN cust ON ...` |
 | **saleitemcode** | VARCHAR | YES | Reference to the item master for the item being labeled. | Likely relates to `saleitemmas.itemcode` | `JOIN saleitemmas ON ...` |
 
 ### 3) Relationships & Join Map
 
 #### Real Physical Joins (Authoritative)
 Based on the `SCHEMA_MAP` and established usage in `viewinvlabelprinting`, the table joins via a composite key:
 
 * **dbo.invhdr (Invoice Header)**
  * `compcode` -> `invhdr.compcode`
  * `invno` -> `invhdr.invno`
  * `invyear` -> `invhdr.invyear`
 * **dbo.invdtl (Invoice Details)**
  * `compcode` -> `invdtl.compcode`
  * `invno` -> `invdtl.invno`
  * `invyear` -> `invdtl.invyear`
 * **dbo.cust (Customer Master)**
  * `compcode` -> `cust.compcode`
  * `custcode` -> `cust.custcode`
 
 #### Likely Inference Joins
 * **dbo.saleitemmas (Item Master)**: Likely joins on `compcode` and `saleitemcode` (mapping to `saleitemmas.itemcode`).
 * **dbo.pdiinspectiondtl**: Relates via `saleitemcode`.