dev_chapal #51

Merged
chapal merged 4 commits from dev_chapal into devqc 2026-01-20 09:26:16 +06:00
2 changed files with 140 additions and 75 deletions

View File

@ -31,6 +31,7 @@ import { GrievanceManagementService } from '../../../_services/grievance-managem
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { WorkflowService } from '../../../_services/workflow/workflow.service'; import { WorkflowService } from '../../../_services/workflow/workflow.service';
import { AuthService } from '../../../_services/auth/auth.service'; import { AuthService } from '../../../_services/auth/auth.service';
import { SystemConfigurationService } from '../../../_services/common/systemconfiguration.service';
@Component({ @Component({
@ -99,7 +100,10 @@ export class LifeCycleEntryComponent implements OnInit {
public _selectedogranogram: OrganogramBasic; public _selectedogranogram: OrganogramBasic;
public _CurrentEmpgranogram: OrganogramBasic; public _CurrentEmpgranogram: OrganogramBasic;
public gradeSalaries: any; public gradeSalaries: any;
_MgtGradeCodes: string;
_MgtGradeCode: string[];
_nonmanagementbasicdivisor: number;
_nonmanagementexcludedamount: number;
constructor(public employeeService: EmployeeServices, constructor(public employeeService: EmployeeServices,
public apiservice: ApiService, public basicDataService: BasicService, public lifecycleService: EmpLifeCycleServices, public apiservice: ApiService, public basicDataService: BasicService, public lifecycleService: EmpLifeCycleServices,
public notificationService: HRMNotificationService, public notificationService: HRMNotificationService,
@ -108,7 +112,7 @@ export class LifeCycleEntryComponent implements OnInit {
public loadingPanelService: loadingPanelService, public loadingPanelService: loadingPanelService,
public router: Router, public workflowService: WorkflowService, public router: Router, public workflowService: WorkflowService,
public authservice: AuthService, public authservice: AuthService,
public acrouter: ActivatedRoute,) { public acrouter: ActivatedRoute, public systemConfigService: SystemConfigurationService) {
if (this.router.url === '/payroll/career-and-profile/life-cycle-entry') if (this.router.url === '/payroll/career-and-profile/life-cycle-entry')
this.apiservice.selectedMenuName = 'Employee Life Cycle'; this.apiservice.selectedMenuName = 'Employee Life Cycle';
@ -150,6 +154,55 @@ export class LifeCycleEntryComponent implements OnInit {
this.salaryMonth = new Date(this.payrollType.nextPayProcessDate); this.salaryMonth = new Date(this.payrollType.nextPayProcessDate);
} }
); );
this.systemConfigService.GetLogicValue('grade', 'managementgradecodes').subscribe(
(resp) => {
debugger;
if (resp != null && resp != '')
this._MgtGradeCodes = resp.toLowerCase();
},
(err) => {
this.notificationService.showError(err.err);
this.loadingPanelService.ShowLoadingPanel = false;
},
() => {
this._MgtGradeCode = this._MgtGradeCodes.split(',');
this.loadingPanelService.ShowLoadingPanel = false;
}
);
this.systemConfigService.GetLogicValue('grade', 'nonmanagementbasicdivisor').subscribe(
(resp) => {
debugger;
if (resp != null && resp != '')
this._nonmanagementbasicdivisor = Number(resp);
},
(err) => {
this.notificationService.showError(err.err);
this.loadingPanelService.ShowLoadingPanel = false;
},
() => {
this.loadingPanelService.ShowLoadingPanel = false;
}
);
this.systemConfigService.GetLogicValue('grade', 'nonmanagementexcludedamount').subscribe(
(resp) => {
debugger;
if (resp != null && resp != '')
this._nonmanagementexcludedamount = Number(resp);
},
(err) => {
this.notificationService.showError(err.err);
this.loadingPanelService.ShowLoadingPanel = false;
},
() => {
this.loadingPanelService.ShowLoadingPanel = false;
}
);
} }
private refreshGradeSalaries() { private refreshGradeSalaries() {
@ -621,17 +674,24 @@ export class LifeCycleEntryComponent implements OnInit {
if (entryType == "GrossSalary") { if (entryType == "GrossSalary") {
if (this._currentGrade != undefined && this.isGrade == false) { if (this._currentGrade != undefined && this.isGrade == false) {
if (this._currentGrade.basicPercentOfGross > 0) if (this._MgtGradeCode.includes(this._currentGrade.code.toUpperCase())) {
this._empLifeCycle.basicSalary = this._empLifeCycle.grossSalary * this._empLifeCycle.basicSalary = this._empLifeCycle.grossSalary * this._currentGrade.basicPercentOfGross / 100;
this._currentGrade.basicPercentOfGross / 100; }
else if (this._currentGrade.basicPercentOfGross > 0)
this._empLifeCycle.basicSalary = Math.ceil(((this._empLifeCycle.grossSalary - this._nonmanagementexcludedamount) / this._nonmanagementbasicdivisor) * 100) / 100;
} }
else if (this.isGrade == true && this._empLifeCycle.gradeID != undefined) { else if (this.isGrade == true && this._empLifeCycle.gradeID != undefined) {
if (this._empLifeCycle.gradeID != undefined) { if (this._empLifeCycle.gradeID != undefined) {
var og = this._gradeList.find(x => x.id == this._empLifeCycle.gradeID); var og = this._gradeList.find(x => x.id == this._empLifeCycle.gradeID);
if (og.basicPercentOfGross > 0) if (this._MgtGradeCode.includes(og.code.toUpperCase())) {
this._empLifeCycle.basicSalary = this._empLifeCycle.grossSalary * this._empLifeCycle.basicSalary = this._empLifeCycle.grossSalary *
og.basicPercentOfGross / 100; og.basicPercentOfGross / 100;
} }
else if (og.basicPercentOfGross > 0)
this._empLifeCycle.basicSalary = Math.ceil(((this._empLifeCycle.grossSalary - this._nonmanagementexcludedamount) / this._nonmanagementbasicdivisor) * 100) / 100;
}
} }
} }

View File

@ -1861,12 +1861,12 @@ namespace HRM.UI.Controllers
foreach (var row in ds.Tables[0].AsEnumerable()) foreach (var row in ds.Tables[0].AsEnumerable())
{ {
EmployeeDetailInfo temp = new EmployeeDetailInfo (); EmployeeDetailInfo temp = new EmployeeDetailInfo ();
Employee emp = new EmployeeService().GetFromAll(row["EMPLOYEENO"].ToString(), (int)currentUser.PayrollTypeID); //Employee emp = new EmployeeService().GetFromAll(row["EMPLOYEENO"].ToString(), (int)currentUser.PayrollTypeID);
Department tempDepartment = null; //Department tempDepartment = null;
if (emp!= null) //if (emp!= null)
{ //{
tempDepartment = emp.DepartmentID != null ? oDepartment.Find(item => item.ID == emp.DepartmentID) : null; // tempDepartment = emp.DepartmentID != null ? oDepartment.Find(item => item.ID == emp.DepartmentID) : null;
} //}
temp.EmployeeNo = row["EmployeeNo"] == null ? "" : row.Field<string>("EmployeeNo"); temp.EmployeeNo = row["EmployeeNo"] == null ? "" : row.Field<string>("EmployeeNo");
temp.Name = row["Name"] == null ? "" : row.Field<string>("Name"); temp.Name = row["Name"] == null ? "" : row.Field<string>("Name");
@ -1905,71 +1905,76 @@ namespace HRM.UI.Controllers
Department tire2 = null; Department tire2 = null;
Department tire1 = null; Department tire1 = null;
if (tempDepartment != null) //if (tempDepartment != null)
{ //{
if (tempDepartment.ParentID != null) // if (tempDepartment.ParentID != null)
{ // {
for (int i = (int)tempDepartment.Tier; i > 0; i--) // for (int i = (int)tempDepartment.Tier; i > 0; i--)
{ // {
if (i == 5) // if (i == 5)
{ // {
tire5 = oDepartment.Find(x => x.ID == tempDepartment.ID); // tire5 = oDepartment.Find(x => x.ID == tempDepartment.ID);
} // }
if (i == 4) // if (i == 4)
{ // {
if (tire5 != null) // if (tire5 != null)
{ // {
tire4 = oDepartment.Find(x => x.ID == tire5.ParentID); // tire4 = oDepartment.Find(x => x.ID == tire5.ParentID);
} // }
else // else
{ // {
tire4 = oDepartment.Find(x => x.ID == tempDepartment.ID); // tire4 = oDepartment.Find(x => x.ID == tempDepartment.ID);
} // }
} // }
if (i == 3) // if (i == 3)
{ // {
if (tire4 != null) // if (tire4 != null)
{ // {
tire3 = oDepartment.Find(x => x.ID == tire4.ParentID); // tire3 = oDepartment.Find(x => x.ID == tire4.ParentID);
} // }
else // else
{ // {
tire3 = oDepartment.Find(x => x.ID == tempDepartment.ID); // tire3 = oDepartment.Find(x => x.ID == tempDepartment.ID);
} // }
} // }
if (i == 2) // if (i == 2)
{ // {
if (tire3 != null) // if (tire3 != null)
{ // {
tire2 = oDepartment.Find(x => x.ID == tire3.ParentID); // tire2 = oDepartment.Find(x => x.ID == tire3.ParentID);
} // }
else // else
{ // {
tire2 = oDepartment.Find(x => x.ID == tempDepartment.ID); // tire2 = oDepartment.Find(x => x.ID == tempDepartment.ID);
} // }
} // }
if (i == 1) // if (i == 1)
{ // {
if (tire2 != null) // if (tire2 != null)
{ // {
tire1 = oDepartment.Find(x => x.ID == tire2.ParentID); // tire1 = oDepartment.Find(x => x.ID == tire2.ParentID);
} // }
else // else
{ // {
tire1 = oDepartment.Find(x => x.ID == tempDepartment.ID); // tire1 = oDepartment.Find(x => x.ID == tempDepartment.ID);
} // }
} // }
} // }
} // }
// temp.deptireOne = (tire1 == null) ? "" : tire1.Name;
// temp.deptireTwo = (tire2 == null) ? "" : tire2.Name;
// temp.deptireThree = (tire3 == null) ? "" : tire3.Name;
// temp.deptireFour = (tire4 == null) ? "" : tire4.Name;
// temp.deptireFive = (tire5 == null) ? "" : tire5.Name;
//}
temp.deptireOne = (tire1 == null) ? "" : tire1.Name; temp.deptireOne = (tire1 == null) ? "" : tire1.Name;
temp.deptireTwo = (tire2 == null) ? "" : tire2.Name; temp.deptireTwo = (tire2 == null) ? "" : tire2.Name;
temp.deptireThree = (tire3 == null) ? "" : tire3.Name; temp.deptireThree = (tire3 == null) ? "" : tire3.Name;
temp.deptireFour = (tire4 == null) ? "" : tire4.Name; temp.deptireFour = (tire4 == null) ? "" : tire4.Name;
temp.deptireFive = (tire5 == null) ? "" : tire5.Name; temp.deptireFive = (tire5 == null) ? "" : tire5.Name;
}
temp.Designation = row["DESIGNATION"] == null ? "" : row.Field<string>("DESIGNATION"); temp.Designation = row["DESIGNATION"] == null ? "" : row.Field<string>("DESIGNATION");
temp.Grade = row["GRADE"] == null ? "" : row.Field<string>("GRADE"); temp.Grade = row["GRADE"] == null ? "" : row.Field<string>("GRADE");
temp.Designation = row["DESIGNATION"] == null ? "" : row.Field<string>("DESIGNATION"); temp.Designation = row["DESIGNATION"] == null ? "" : row.Field<string>("DESIGNATION");