All tables
tables · table

dprt_mas

The dprt_mas (Department Master) table serves as the authoritative registry for all functional departments and sections within the organization. It maps specific department codes (dpcode) to their respective names and heads of departments. This table is a critical organizational dimension used for cost-center tracking, machine allocation, human resource management (attendance), and material issuance.

Row count
443
Last entry
Source
tables

Columns

6
ColumnTypeNullableMeaning
compcodestringNoUnique identifier for the company/legal entity.
dpcodestringNoThe primary unique identifier for the department or section.
dpnamestringYesThe descriptive name of the department.
dpheadstringYesThe name of the individual responsible for the department.
usernamestringYesThe system user who created or last modified the record.
indexintegerNoTechnical surrogate key (as seen in source JSON).

Full documentation

### 1) Overview
 The `dprt_mas` (Department Master) table serves as the authoritative registry for all functional departments and sections within the organization. It maps specific department codes (`dpcode`) to their respective names and heads of departments. This table is a critical organizational dimension used for cost-center tracking, machine allocation, human resource management (attendance), and material issuance.
 
 ### 2) Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **compcode** | string | No | Unique identifier for the company/legal entity. | "DAS", "BPH" | Joins with almost all tables to ensure multi-tenancy. |
 | **dpcode** | string | No | The primary unique identifier for the department or section. | "01", "CNC", "DESIGN", "ACCOUNT" | Primary key used to link to employees, machines, and transactions. |
 | **dpname** | string | Yes | The descriptive name of the department. | "DRILL SECTION", "QUALITY DEPARTMENT" | Used in reporting for display purposes. |
 | **dphead** | string | Yes | The name of the individual responsible for the department. | "G.K. ARYA", "SANDEEP YOGI" | Used for workflow approvals and responsibility reporting. |
 | **username** | string | Yes | The system user who created or last modified the record. | "cstore", "system" | Audit trail and record ownership. |
 | **index** | integer | No | Technical surrogate key (as seen in source JSON). | | Used for record ordering; usually not used in business joins. |
 
 ### 3) Relationships & Join Map
 
 The `dprt_mas` table acts as a central lookup for any entity or transaction that requires departmental categorization.
 
 #### Authoritative Joins (Based on SCHEMA_MAP):
 
 * **dbo.machine**: Joins on `compcode` and `dpcode`. Used to identify which department owns a specific piece of machinery.
 * **dbo.empmas**: Joins on `compcode` and `dpcode`. Used to associate employees with their parent department.
 * **dbo.attandence**: Joins on `compcode` and `dpcode`. Used for departmental labor and attendance analysis.
 * **dbo.citemiss** (Consumable Item Issue): Joins on `compcode` and `dpcode`. Tracks which department requested or received consumable materials.
 * **dbo.itemreturn**: Joins on `compcode` and `dpcode`. Tracks returns of items from specific departments.
 * **dbo.cmrpreq** (Consumable Material Requirement): Joins on `compcode` and `dpcode`. Links material requirements to the initiating cost center.
 
 #### Likely Joins (Inferred from usage):
 
 * **dbo.fghdr**: Likely joins on `dpcode` to identify the department responsible for producing Finished Goods (FG).
 * **dbo.rmincoming**: Likely joins on `dpcode` to track the destination department for raw material reception.
 * **dbo.paydprt_mas**: Joins on `dpcode` (Likely identical to `dprt_mas` but used specifically in payroll context).