tables · table
paydprt_mas
The paydprt_mas table serves as the Department Master for payroll and organizational management. It defines the mapping between department codes (dpcode) and their descriptive names (dpname) within a specific company (compcode). This table is a critical reference used across human resources, attendance tracking, equipment maintenance, and material requisition modules.
Row count
21
Last entry
—
Source
tables
Columns
3| Column | Type | Nullable | Meaning |
|---|---|---|---|
compcode | string | No | Unique identifier for the company/legal entity. |
dpcode | string | No | Unique department code (often fixed-length/padded). |
dpname | string | Yes | Descriptive name of the department. |
Full documentation
### 1) Overview The `paydprt_mas` table serves as the **Department Master** for payroll and organizational management. It defines the mapping between department codes (`dpcode`) and their descriptive names (`dpname`) within a specific company (`compcode`). This table is a critical reference used across human resources, attendance tracking, equipment maintenance, and material requisition modules. ### 2) Column Dictionary | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage | | :--- | :--- | :--- | :--- | :--- | :--- | | **compcode** | string | No | Unique identifier for the company/legal entity. | e.g., "DAS", "ERA" | `JOIN`, `WHERE` | | **dpcode** | string | No | Unique department code (often fixed-length/padded). | e.g., "101", "106" | `JOIN`, `GROUP BY` | | **dpname** | string | Yes | Descriptive name of the department. | e.g., "HR", "QUALITY" | `SELECT` | ### 3) Relationships & Join Map The `paydprt_mas` table is primarily used as a lookup table to translate numeric or alphanumeric department codes into readable names for reporting. #### Primary Joins (Authoritative via SCHEMA_MAP): * **dbo.attandence**: Joined on `compcode` and `dpcode`. Used to aggregate attendance stats, employee counts, and hours worked by department. * **dbo.empmas**: Joined on `compcode` and `dpcode`. Maps individual employees to their assigned departments. * **dbo.machine**: Joined on `compcode` and `dpcode`. Associates production or maintenance machinery with specific departments. #### Secondary Joins (Functional): * **dbo.citemiss**: Joined on `compcode` and `dpcode`. Tracks material/item issues to specific departments. * **dbo.cmrpreq**: Joined on `compcode` and `dpcode`. Identifies which department originated a Material Requirement Planning (MRP) request. * **dbo.fghdr**: Joined on `compcode` and `dpcode`. Links finished goods headers to a responsible department. * **dbo.itemreturn**: Joined on `compcode` and `dpcode`. Tracks items returned to stock from specific departments. > **Note on Data Content:** The `dpcode` values in the provided data contain trailing spaces (e.g., `'101 '`). When performing joins in T-SQL, trailing spaces are typically ignored in comparisons, but it is recommended to use `RTRIM(dpcode)` if strict string matching is required.