fix: remove obsolete attendancePolicy relationship calls and update 13th month calculation rules
This commit is contained in:
@@ -462,7 +462,7 @@ class EmployeeController extends Controller
|
||||
}
|
||||
|
||||
// Load user with employee relationships
|
||||
$user = User::with(['employee.branch', 'employee.department', 'employee.designation', 'employee.shift', 'employee.attendancePolicy', 'employee.documents.documentType'])
|
||||
$user = User::with(['employee.branch', 'employee.department', 'employee.designation', 'employee.shift', 'employee.documents.documentType'])
|
||||
->where('id', $employee->user_id)
|
||||
->first();
|
||||
|
||||
@@ -1149,7 +1149,7 @@ class EmployeeController extends Controller
|
||||
{
|
||||
if (Auth::user()->can('export-employee')) {
|
||||
try {
|
||||
$employees = User::with(['employee.branch', 'employee.department', 'employee.designation', 'employee.shift', 'employee.attendancePolicy'])
|
||||
$employees = User::with(['employee.branch', 'employee.department', 'employee.designation', 'employee.shift'])
|
||||
->where('type', 'employee')
|
||||
->where(function ($q) {
|
||||
if (Auth::user()->can('manage-any-employees')) {
|
||||
@@ -1182,7 +1182,6 @@ class EmployeeController extends Controller
|
||||
'Gender',
|
||||
'Shift',
|
||||
'Basic Salary',
|
||||
'Attedance Policy',
|
||||
'Employement Type',
|
||||
'Employement Status',
|
||||
'City',
|
||||
@@ -1212,7 +1211,6 @@ class EmployeeController extends Controller
|
||||
$employee->gender ?? '',
|
||||
$employee->shift->name ?? '',
|
||||
$employee->base_salary ?? '',
|
||||
$employee->attendancePolicy->name ?? '',
|
||||
$employee->employment_type ?? '',
|
||||
$employee->employee_status ?? 'active',
|
||||
$employee->city ?? '',
|
||||
|
||||
Reference in New Issue
Block a user