| Server IP : 103.175.220.74 / Your IP : 216.73.216.151 Web Server : nginx/1.18.0 System : Linux p-floo-wj1-db 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : deploy ( 1003) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/app/onega.id/erp/production/ |
Upload File : |
# HR Module Analysis
## Module Overview
The HR module is a comprehensive human resources management system covering employee management, recruitment, leave management, overtime tracking, timesheets, salary/payroll processing, and organizational structure management. It serves as the central hub for all HR operations and employee-related data.
## Module Structure
```
Modules/HR/
├── Actions/ (13 action classes for various HR operations)
│ └── ...
├── Entities/
│ ├── Department.php
│ ├── Employee.php
│ ├── EmployeeAttachment.php
│ ├── EmployeeFile.php
│ ├── EmployeeLeave.php
│ ├── EmployeeProject.php
│ ├── EmployeeSalary.php
│ ├── Leave.php
│ ├── LeaveDate.php
│ ├── LeaveType.php
│ ├── Overtime.php
│ ├── OvertimeFile.php
│ ├── Payroll.php
│ ├── PayrollPayment.php
│ ├── RecruitmentForm.php
│ ├── RecruitmentPosition.php
│ └── Timesheet.php
├── Http/
│ ├── Controllers/
│ │ ├── HRController.php
│ │ ├── DepartmentController.php
│ │ ├── EmployeeController.php
│ │ ├── LeaveController.php
│ │ ├── OvertimeController.php
│ │ ├── PayrollController.php
│ │ ├── TimesheetController.php
│ │ ├── HRRecruitmentController.php
│ │ └── API/
│ ├── Requests/V1/
│ └── Resources/V1/
├── Routes/
│ ├── web.php
│ ├── api.php
│ ├── mobile.php
│ └── ...
├── Database/
│ └── Migrations/
├── Tests/
├── Providers/
│ ├── RouteServiceProvider.php
│ └── HRServiceProvider.php
└── Config/config.php
```
## Entity Relationships Diagram
```mermaid
erDiagram
DEPARTMENT ||--o{ EMPLOYEE : has
DEPARTMENT ||--o{ LEAVE-TYPE : defines
EMPLOYEE ||--o{ EMPLOYEE-FILE : documents
EMPLOYEE ||--o{ EMPLOYEE-LEAVE : requests
EMPLOYEE ||--o{ EMPLOYEE-PROJECT : assigned
EMPLOYEE ||--o{ EMPLOYEE-SALARY : has
EMPLOYEE ||--o{ TIMESHEET : submits
EMPLOYEE ||--o{ OVERTIME : submits
EMPLOYEE ||--o{ PAYROLL : processed
EMPLOYEE }o--|| DEPARTMENT : "in"
EMPLOYEE ||--o{ EMPLOYEE-ATTACHMENT : attachments
EMPLOYEE-FILE }o--|| EMPLOYEE : "for"
EMPLOYEE-LEAVE }o--|| EMPLOYEE : "by"
EMPLOYEE-LEAVE }o--|| LEAVE : "for"
EMPLOYEE-LEAVE ||--o{ LEAVE-DATE : contains
LEAVE }o--|| LEAVE-TYPE : "is"
LEAVE-DATE }o--|| EMPLOYEE-LEAVE : "in"
LEAVE-TYPE }o--|| DEPARTMENT : "for"
EMPLOYEE-PROJECT }o--|| EMPLOYEE : "assigned"
EMPLOYEE-PROJECT }o--|| PROJECT : "to"
EMPLOYEE-SALARY }o--|| EMPLOYEE : "for"
TIMESHEET ||--o{ TIMESHEET : "daily"
TIMESHEET }o--|| EMPLOYEE : "submitted_by"
TIMESHEET }o--|| PROJECT : "for"
OVERTIME }o--|| EMPLOYEE : "submitted_by"
OVERTIME ||--o{ OVERTIME-FILE : attachments
OVERTIME-FILE }o--|| OVERTIME : "for"
PAYROLL }o--|| EMPLOYEE : "for"
PAYROLL ||--o{ PAYROLL-PAYMENT : payments
PAYROLL-PAYMENT }o--|| PAYROLL : "in"
RECRUITMENT-POSITION ||--o{ RECRUITMENT-FORM : receives
RECRUITMENT-FORM }o--|| RECRUITMENT-POSITION : "for"
PROJECT ||--o{ EMPLOYEE : "has"
PROJECT ||--o{ EMPLOYEE-PROJECT : "with"
```
## Core Workflows
### 1. Employee Management Workflow
```
Recruitment → Hiring → Employee Creation → Assign Department →
Update Employee Info → Track Employment History → Termination
```
### 2. Leave Request Workflow
```
Employee Submits Leave Request → Manager Reviews → Approval/Rejection →
System Records Leave Dates → Deduct from Leave Balance →
Update Leave History
```
### 3. Overtime Request Workflow
```
Employee Submits Overtime Request → Attach Supporting Documents →
Manager Review & Approval → Record Overtime Hours → Payroll Processing
```
### 4. Timesheet Submission Workflow
```
Employee Creates Timesheet → Log Daily Work Hours → Assign to Projects →
Submit for Approval → Manager Reviews → Payroll Integration
```
### 5. Payroll Processing Workflow
```
Period Start → Calculate Salary → Apply Deductions → Calculate Taxes →
Add Allowances/Overtime → Generate Payroll → Record Payments →
Distribute Salaries
```
### 6. Recruitment Workflow
```
Create Job Position → Post Opening → Receive Applications →
Review Forms → Interview → Hire → Create Employee Record
```
## Key Entities Description
| Entity | Purpose | Key Fields |
|--------|---------|-----------|
| **Employee** | Employee master data | emp_code, name, department_id, start_date, status |
| **Department** | Organizational departments | dept_code, name, manager_id, location |
| **EmployeeFile** | Employee documents | employee_id, file_type, file_path, upload_date |
| **Leave** | Leave request record | employee_id, leave_type_id, start_date, end_date, status |
| **LeaveType** | Types of leave available | type_name, allocation_days, department_id |
| **LeaveDate** | Individual leave dates | leave_id, leave_date, half_day |
| **Overtime** | Overtime requests | employee_id, date, hours, approval_status |
| **OvertimeFile** | Supporting docs for OT | overtime_id, file_path |
| **Timesheet** | Daily work hours | employee_id, timesheet_date, hours_worked, project_id |
| **EmployeeSalary** | Salary information | employee_id, base_salary, allowances, deductions |
| **Payroll** | Salary calculation record | employee_id, period_date, gross_salary, deductions, net_salary |
| **PayrollPayment** | Payment records | payroll_id, payment_date, amount, payment_method |
| **RecruitmentPosition** | Job openings | position_title, department_id, required_qualifications |
| **RecruitmentForm** | Job applications | position_id, applicant_name, email, resume_path |
## Controllers
| Controller | Responsibilities |
|------------|------------------|
| **HRController** | Main HR dashboard & overview |
| **EmployeeController** | Employee management, profiles, documents |
| **DepartmentController** | Department management & organization structure |
| **LeaveController** | Leave request management & leave balance tracking |
| **OvertimeController** | Overtime request management & approval |
| **PayrollController** | Payroll processing, salary calculation |
| **TimesheetController** | Timesheet submission & approval |
| **HRRecruitmentController** | Recruitment position & application management |
## Integration Points
- **Purchase Module**: Employee-related procurement via reimbursement
- **Accounting Module**: Payroll transactions, reimbursement approval
- **Project Management**: Employee project assignments and timesheets
- **Core App**: User management, project assignments, department structure
## Action Classes
- **EmployeeActions**: Create, update, delete employee records
- **LeaveActions**: Leave request creation, approval, cancellation
- **OvertimeActions**: Overtime request management
- **TimesheetActions**: Timesheet submission and approval
- **PayrollActions**: Payroll calculation and processing
- **RecruitmentActions**: Position creation, application review
## Key Features
1. **Employee Master Data**: Complete employee information management
2. **Organizational Structure**: Department and hierarchy management
3. **Leave Management**: Flexible leave types with balance tracking
4. **Leave Balance**: Automatic tracking of leave allocation and usage
5. **Overtime Tracking**: Request submission with approval workflow
6. **Timesheet System**: Daily work hour tracking by project
7. **Salary Management**: Base salary, allowances, deductions configuration
8. **Payroll Processing**: Automated salary calculation and payment tracking
9. **Recruitment**: Job opening management and application tracking
10. **Document Management**: Employee file storage and history
11. **Project Assignment**: Track employee allocation to projects
12. **Approval Workflows**: Multi-level approval for leaves, overtime, timesheets
## Status Flow
```
Employee: Active → On Leave → On Vacation → Terminated → Archived
Leave Request: Draft → Submitted → Approved → Rejected → Completed
Overtime: Draft → Submitted → Approved → Rejected → Paid
Timesheet: Draft → Submitted → Approved → Rejected → Finalized
Payroll: Draft → Posted → Paid → Archived
```
## Business Rules
1. **Leave Allocation**: Leave balance calculated per leave type per employee
2. **Leave Balance**: Automatic deduction of leave dates from balance
3. **Overtime Approval**: Requires manager approval before payment
4. **Timesheet Tracking**: Linked to project assignments
5. **Payroll Frequency**: Monthly/bi-weekly based on company policy
6. **Tax Calculation**: PTKP status applied for tax calculation
7. **Soft Deletes**: Maintains employee history for compliance
8. **Department Hierarchy**: Supports organizational structure
## Leave Management
- Multiple leave types per department
- Configurable allocation per year
- Leave date tracking (full day/half day)
- Leave balance management
- Carry-forward policy support
## Payroll Features
- Configurable salary components (base, allowances, deductions)
- Automatic tax calculation
- Overtime pay integration
- Leave deduction handling
- Multiple payment methods
- Payment history tracking
## Reporting & Analytics
- Employee list by department
- Leave balance reports
- Overtime summary reports
- Payroll reports and analysis
- Recruitment pipeline tracking
- Attendance/timesheet reports