From 999280b9069ea9a5edceae4da0f3d6bdb2638df3 Mon Sep 17 00:00:00 2001 From: mashfiq Date: Sun, 27 Apr 2025 14:49:02 +0600 Subject: [PATCH] attendance manual entry modified --- HRM.DA/DA/Attendance/DailyAttnProcessDA.cs | 44 ++++++++++++----- .../Attendance/DailyAttnProcessService.cs | 11 ++++- .../_models/Attendance/dailyAttnProcess.ts | 5 ++ .../attendance/attendance.service.ts | 3 ++ HRM.UI/ClientApp/src/app/app.api.service.ts | 2 +- ...-edit-for-multiple-employee.component.html | 2 +- ...al-edit-for-multiple-employee.component.ts | 24 +++++++--- .../salary-days-deduct-edit.component.html | 48 +++++++++++-------- .../salary-days-deduct-edit.component.ts | 2 +- ...-deduction-parameterization.component.html | 2 +- .../Attendance/AttendanceController.cs | 38 ++++++--------- 11 files changed, 113 insertions(+), 68 deletions(-) diff --git a/HRM.DA/DA/Attendance/DailyAttnProcessDA.cs b/HRM.DA/DA/Attendance/DailyAttnProcessDA.cs index d60c7d2..f31d9f9 100644 --- a/HRM.DA/DA/Attendance/DailyAttnProcessDA.cs +++ b/HRM.DA/DA/Attendance/DailyAttnProcessDA.cs @@ -24,19 +24,37 @@ namespace HRM.DA #region Insert function - //internal static void Insert(TransactionContext tc, DailyAttnProcess item) - //{ - // tc.ExecuteNonQuery( - // "INSERT INTO DailyAttnProcess(DailyAttnProcessID, EmployeeID, AttnDate, ShiftID, InTime, OutTime,WorkDayType, AttenType, Comments,Reason, IsManualEntry,IsLate, LateHour, EarlyHour, OTHour, ReferenceID, CreatedBy, CreatedDate, OtRemarks, BenefitRemarks, TempShiftID, WFStatus, ApprovedOTHOUR, LMRemarks, DHRemarks, SalaryMonth, ActualInTime, ActualOutTime, CLAIMWFSTATUS)" + - // " VALUES(%n, %n, %d, %n, %D, %D, %n, %n, %s,%s,%b, %b, %n, %n, %n, %n, %n, %d, %s, %s, %n,%n,%n, %s, %s, %d,%D,%D, %n)", - // item.ID, item.EmployeeID, item.AttnDate, DataReader.GetNullValue(item.ShiftID), - // DataReader.GetNullValue(item.EmpInTime), DataReader.GetNullValue(item.EmpOutTime), item.WorkDayType, - // item.AttenType, item.Comments, item.Reason, item.IsManualEntry, item.IsLate, item.LateHour, - // item.EarlyHour, item.OTHour, DataReader.GetNullValue(item.ReferenceID, 0), item.CreatedBy, - // item.CreatedDate, item.OtRemarks, item.BenefitRemarks, item.TempShiftID, - // item.WFStatus, item.ApprovedOTHour, item.LMRemarks, item.DHRemarks, item.SalaryMonth, item.ActualInTime, - // item.ActualOutTime, (int)EnumClaimWFStatus.None); - //} + internal static void Insert(TransactionContext tc, DailyAttnProcess item) + { + //tc.ExecuteNonQuery( + // "INSERT INTO DailyAttnProcess(DailyAttnProcessID, EmployeeID, AttnDate, ShiftID, InTime, OutTime,WorkDayType, AttenType, Comments,Reason, IsManualEntry,IsLate, LateHour, EarlyHour, OTHour, ReferenceID, CreatedBy, CreatedDate, OtRemarks, BenefitRemarks, TempShiftID, WFStatus, ApprovedOTHOUR, LMRemarks, DHRemarks, SalaryMonth, ActualInTime, ActualOutTime, CLAIMWFSTATUS)" + + // " VALUES(%n, %n, %d, %n, %D, %D, %n, %n, %s,%s,%b, %b, %n, %n, %n, %n, %n, %d, %s, %s, %n,%n,%n, %s, %s, %d,%D,%D, %n)", + // item.ID, item.EmployeeID, item.AttnDate, DataReader.GetNullValue(item.ShiftID), + // DataReader.GetNullValue(item.EmpInTime), DataReader.GetNullValue(item.EmpOutTime), item.WorkDayType, + // item.AttenType, item.Comments, item.Reason, item.IsManualEntry, item.IsLate, item.LateHour, + // item.EarlyHour, item.OTHour, DataReader.GetNullValue(item.ReferenceID, 0), item.CreatedBy, + // item.CreatedDate, item.OtRemarks, item.BenefitRemarks, item.TempShiftID, + // item.WFStatus, item.ApprovedOTHour, item.LMRemarks, item.DHRemarks, item.SalaryMonth, item.ActualInTime, + // item.ActualOutTime, (int)EnumClaimWFStatus.None); + tc.ExecuteNonQuery(@"INSERT INTO DailyAttnProcess(DailyAttnProcessID, EmployeeID, AttnDate, + ShiftID, InTime, OutTime, + WorkDayType, ATTENTYPE, Comments, + IsManualEntry,OnlyManualInTime,OnlyManualOutTime, + LateHour, EarlyHour, OTHour, + ReferenceID, CreatedBy, CreatedDate) + VALUES(%n, %n, %d, + %n, %D, %D, + %n, %n, %s, + %b, %b, %b, + %n, %n, %n, + %n, %n, %d)", + item.ID, item.EmployeeID, item.AttnDate, + DataReader.GetNullValue(item.ShiftID), DataReader.GetNullValue(item.InTime), DataReader.GetNullValue(item.OutTime), + item.WorkDayType, item.AttenType, item.Comments, + item.IsManualEntry, item.OnlyManualInTime, item.OnlyManualOutTime, + item.LateHour, item.EarlyHour, item.OTHour, + DataReader.GetNullValue(item.ReferenceID), item.CreatedBy, item.CreatedDate); + } #endregion diff --git a/HRM.DA/Service/Attendance/DailyAttnProcessService.cs b/HRM.DA/Service/Attendance/DailyAttnProcessService.cs index c75ebb9..dbf454f 100644 --- a/HRM.DA/Service/Attendance/DailyAttnProcessService.cs +++ b/HRM.DA/Service/Attendance/DailyAttnProcessService.cs @@ -1137,7 +1137,16 @@ namespace HRM.DA tc = TransactionContext.Begin(true); foreach (DailyAttnProcess item in oDAttnProcessess) { - DailyAttnProcessDA.ManualEditUpdate(tc, item); + if (item.IsNew) + { + int id = tc.GenerateID("DailyAttnProcess", "DAILYATTNPROCESSID"); + base.SetObjectID(item, id); + DailyAttnProcessDA.Insert(tc, item); + } + else + { + DailyAttnProcessDA.ManualEditUpdate(tc, item); + } } //if (attnMonthlyBenefit.Count > 0) diff --git a/HRM.UI/ClientApp/src/app/_models/Attendance/dailyAttnProcess.ts b/HRM.UI/ClientApp/src/app/_models/Attendance/dailyAttnProcess.ts index b07f422..b8ee9d8 100644 --- a/HRM.UI/ClientApp/src/app/_models/Attendance/dailyAttnProcess.ts +++ b/HRM.UI/ClientApp/src/app/_models/Attendance/dailyAttnProcess.ts @@ -48,6 +48,8 @@ export class DailyAttnProcess extends BaseObject { this.actualOutTime = new Date(); this.actualShiftID = null; this.shift= null; + this.onlyManualInTime = false; + this.onlyManualOutTime = false; } attnDate: Date; inTime: Date; @@ -90,6 +92,9 @@ export class DailyAttnProcess extends BaseObject { shift: Shift; remarksType: number; + onlyManualInTime: boolean; + onlyManualOutTime: boolean; + diff --git a/HRM.UI/ClientApp/src/app/_services/attendance/attendance.service.ts b/HRM.UI/ClientApp/src/app/_services/attendance/attendance.service.ts index 24e305e..b0309e8 100644 --- a/HRM.UI/ClientApp/src/app/_services/attendance/attendance.service.ts +++ b/HRM.UI/ClientApp/src/app/_services/attendance/attendance.service.ts @@ -276,6 +276,9 @@ export class AttendanceServices { getDailyAttnProcessByEmp(empList: any) { return this.apiService.httpPost('/Attendance' + '/getDailyAttnProcessByEmp', empList); } + getDailyAttnProcessByEmpForManualEntry(empList: any) { + return this.apiService.httpPost('/Attendance' + '/getDailyAttnProcessByEmpForManualEntry', empList); + } // DailyAttnProcess getDailyAttnProcessByEmployeeId(employeeId: number) { diff --git a/HRM.UI/ClientApp/src/app/app.api.service.ts b/HRM.UI/ClientApp/src/app/app.api.service.ts index b188d3c..1448727 100644 --- a/HRM.UI/ClientApp/src/app/app.api.service.ts +++ b/HRM.UI/ClientApp/src/app/app.api.service.ts @@ -14,7 +14,7 @@ export class ApiService { public isSSO = false; public versionDeployement = false; // public versionNumber = `V-${GlobalfunctionExtension.generateVersionNumber(new Date(2025, 1, 25))}-`+"01"; - public versionNumber = `V-20250421-`+"01"; + public versionNumber = `V-20250427-`+"01"; public static BASE_URL = ''; public base_url = ''; // public currentLink = ''; diff --git a/HRM.UI/ClientApp/src/app/attendance/attendance-manual-edit-for-multiple-employee/attendance-manual-edit-for-multiple-employee.component.html b/HRM.UI/ClientApp/src/app/attendance/attendance-manual-edit-for-multiple-employee/attendance-manual-edit-for-multiple-employee.component.html index 0ca69b3..6435563 100644 --- a/HRM.UI/ClientApp/src/app/attendance/attendance-manual-edit-for-multiple-employee/attendance-manual-edit-for-multiple-employee.component.html +++ b/HRM.UI/ClientApp/src/app/attendance/attendance-manual-edit-for-multiple-employee/attendance-manual-edit-for-multiple-employee.component.html @@ -329,7 +329,7 @@
-
diff --git a/HRM.UI/ClientApp/src/app/attendance/attendance-manual-edit-for-multiple-employee/attendance-manual-edit-for-multiple-employee.component.ts b/HRM.UI/ClientApp/src/app/attendance/attendance-manual-edit-for-multiple-employee/attendance-manual-edit-for-multiple-employee.component.ts index 26963f6..6ed35fb 100644 --- a/HRM.UI/ClientApp/src/app/attendance/attendance-manual-edit-for-multiple-employee/attendance-manual-edit-for-multiple-employee.component.ts +++ b/HRM.UI/ClientApp/src/app/attendance/attendance-manual-edit-for-multiple-employee/attendance-manual-edit-for-multiple-employee.component.ts @@ -34,7 +34,7 @@ export class AttendanceManualEditForMultipleEmployeeComponent implements OnInit approvalRole: string; isVisibleEmpPicker: boolean = false; isVisibleCordinatorPicker: boolean = false; - isVisiblelmPicker: boolean= false; + isVisiblelmPicker: boolean = false; selectedShiftID: number; selectedStatus: EnumAttendanceType; selectedAttnDate: Date; @@ -85,7 +85,7 @@ export class AttendanceManualEditForMultipleEmployeeComponent implements OnInit this.selectInTime = new Date(); this.selectedOutTime = new Date(); this.loadDropDownLists(); - // this.selectedStatus = EnumAttendanceType.Present; + // this.selectedStatus = EnumAttendanceType.Present; this.getPendindBillings(); } @@ -143,7 +143,7 @@ export class AttendanceManualEditForMultipleEmployeeComponent implements OnInit }, () => { if (this.shifts.length > 0) { -// this.selectedShiftID = this.shifts[0].id; + // this.selectedShiftID = this.shifts[0].id; this.shifts[0].inTime = new Date(this.shifts[0].inTime); this.shifts[0].outTime = new Date(this.shifts[0].outTime); this.dateChange(); @@ -236,7 +236,7 @@ export class AttendanceManualEditForMultipleEmployeeComponent implements OnInit } else if (type == 6) if (this.remarksList.find(y => y.value == this.selectedRemarks).name == "Other") { - + x.empRemarks = this.otherRemarks; } else { @@ -274,7 +274,8 @@ export class AttendanceManualEditForMultipleEmployeeComponent implements OnInit if (attnRequest.length == 0) return; - this.attendanceServices.getDailyAttnProcessByEmp(attnRequest).subscribe( + // this.attendanceServices.getDailyAttnProcessByEmp(attnRequest).subscribe( + this.attendanceServices.getDailyAttnProcessByEmpForManualEntry(attnRequest).subscribe( (resp) => { if (this.dailyAttenProcessList == undefined || this.dailyAttenProcessList.length == 0) { @@ -371,8 +372,17 @@ export class AttendanceManualEditForMultipleEmployeeComponent implements OnInit } - if ((x.inTime == null || x.outTime == null) && x.attenType == EnumAttendanceType.Present) { - msg = msg + "Employee: " + x.employee.employeeNo + ", Status present is not allowed while inTime and outTime is not entered.; "; + if ((x.inTime == null && x.outTime == null) && x.attenType == EnumAttendanceType.Present) { + msg = msg + "Employee: " + x.employee.employeeNo + ", Status present is not allowed while In Time and Out Time is not entered.; "; + + } + else { + if (x.inTime != null && x.outTime == null) { + x.onlyManualInTime = true; + } + if (x.inTime == null && x.outTime != null) { + x.onlyManualOutTime = true; + } } var bvalid = false; diff --git a/HRM.UI/ClientApp/src/app/payroll/days-deduction/salary-days-deduction-parameterization/salary-days-deduct-edit/salary-days-deduct-edit.component.html b/HRM.UI/ClientApp/src/app/payroll/days-deduction/salary-days-deduction-parameterization/salary-days-deduct-edit/salary-days-deduct-edit.component.html index 1328e8c..cf32b0e 100644 --- a/HRM.UI/ClientApp/src/app/payroll/days-deduction/salary-days-deduction-parameterization/salary-days-deduct-edit/salary-days-deduct-edit.component.html +++ b/HRM.UI/ClientApp/src/app/payroll/days-deduction/salary-days-deduction-parameterization/salary-days-deduct-edit/salary-days-deduct-edit.component.html @@ -1,21 +1,23 @@
-
-
- -
-
- - +
+
+
+ +
+
+ + +
@@ -26,7 +28,7 @@ [selectable]="{enabled: true, checkboxOnly: true, mode: 'multiple'}" [selectedKeys]="_selectedgrades" [kendoGridSelectBy]="'id'" - [height]="200"> + [height]="500">
-

salary components

+

Salary components

@@ -70,8 +72,14 @@
- - + + +
diff --git a/HRM.UI/ClientApp/src/app/payroll/days-deduction/salary-days-deduction-parameterization/salary-days-deduct-edit/salary-days-deduct-edit.component.ts b/HRM.UI/ClientApp/src/app/payroll/days-deduction/salary-days-deduction-parameterization/salary-days-deduct-edit/salary-days-deduct-edit.component.ts index 132635d..a8bb9fd 100644 --- a/HRM.UI/ClientApp/src/app/payroll/days-deduction/salary-days-deduction-parameterization/salary-days-deduct-edit/salary-days-deduct-edit.component.ts +++ b/HRM.UI/ClientApp/src/app/payroll/days-deduction/salary-days-deduction-parameterization/salary-days-deduct-edit/salary-days-deduct-edit.component.ts @@ -211,6 +211,6 @@ export class SalaryDaysDeductEditComponent implements OnInit { } cancel() { - + this.router.navigateByUrl('/payroll/absent-deduction-Policy'); } } diff --git a/HRM.UI/ClientApp/src/app/payroll/days-deduction/salary-days-deduction-parameterization/salary-days-deduction-parameterization.component.html b/HRM.UI/ClientApp/src/app/payroll/days-deduction/salary-days-deduction-parameterization/salary-days-deduction-parameterization.component.html index 4832a8f..6cdb07e 100644 --- a/HRM.UI/ClientApp/src/app/payroll/days-deduction/salary-days-deduction-parameterization/salary-days-deduction-parameterization.component.html +++ b/HRM.UI/ClientApp/src/app/payroll/days-deduction/salary-days-deduction-parameterization/salary-days-deduction-parameterization.component.html @@ -6,7 +6,7 @@ (edit)="editHandler($event)" (remove)="removeHandler($event)"> - + diff --git a/HRM.UI/Controllers/Attendance/AttendanceController.cs b/HRM.UI/Controllers/Attendance/AttendanceController.cs index a5a45cd..84b5f0d 100644 --- a/HRM.UI/Controllers/Attendance/AttendanceController.cs +++ b/HRM.UI/Controllers/Attendance/AttendanceController.cs @@ -1335,7 +1335,8 @@ namespace HRM.UI.Controllers.Attendance public ActionResult getDailyAttnProcessByEmpForManualEntry(dynamic data) { List _dAttnProcessess = new List(); - DailyAttnProcess _dAttnProcess = new DailyAttnProcess(); + DailyAttnProcess _dAttnProcess = null; + CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User); try { var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data)); @@ -1350,17 +1351,11 @@ namespace HRM.UI.Controllers.Attendance empIdList.Add(empID); } - if (empids.Length > 0) - { - empids = empids.Substring(0, empids.Length - 1); - } + if (empids.Length > 0) empids = empids.Substring(0, empids.Length - 1); attnDate = new DateTime(attnDate.Year, attnDate.Month, attnDate.Day); List dAttnProcessess = this._dailyAttnProcessService.GetByEmployees(attnDate, empids); - - //List DailyAttnProcesses = new List(); - foreach (var empid in empIdList) { bool existInList = false; @@ -1389,27 +1384,24 @@ namespace HRM.UI.Controllers.Attendance if (!ExistInSavedData) { _dAttnProcess = new DailyAttnProcess(); - _dAttnProcess.EmployeeID = empid; - //_dAttnProcess.Employee.EmployeeNo = sEmp.Employee.EmployeeNo; - //_dAttnProcess.Employee.Name = sEmp.Employee.Name; + _dAttnProcess.AttnDate = attnDate; _dAttnProcessess.Add(_dAttnProcess); } } } - - if (_dAttnProcessess != null && _dAttnProcessess.Count > 0) - { - int serial = 1; - foreach (DailyAttnProcess dAttnProcess in _dAttnProcessess) - { - if (dAttnProcess.IsNew) - { - - } - } - } + //if (_dAttnProcessess != null && _dAttnProcessess.Count > 0) + //{ + // int serial = 1; + // foreach (DailyAttnProcess dAttnProcess in _dAttnProcessess) + // { + // if (dAttnProcess.IsNew) + // { + + // } + // } + //} } catch (Exception e) {