diff --git a/HRM.DA/Service/Attendance/AttendanceProcess.cs b/HRM.DA/Service/Attendance/AttendanceProcess.cs index 1fd9fc2..378e2cb 100644 --- a/HRM.DA/Service/Attendance/AttendanceProcess.cs +++ b/HRM.DA/Service/Attendance/AttendanceProcess.cs @@ -443,7 +443,7 @@ namespace HRM.DA foreach(var item in Groupdate) { Thread myNewThread = new Thread(() => Process(item.Key, - EnumProcessMode.Auto, oemp.PayrollTypeID, ouser.ID, emps)); + EnumProcessMode.Auto, oemp.PayrollTypeID, ouser.ID, emps, false)); myNewThread.Start(); } @@ -462,16 +462,16 @@ namespace HRM.DA _shifts = new ShiftService().GetAllShift(); for (DateTime currentDate = ProcessDate; currentDate <= endDate; currentDate = currentDate.AddDays(1)) { - Process(currentDate, EnumProcessMode.Auto, payrollTypeID, processUserID, emp); + Process(currentDate, EnumProcessMode.Auto, payrollTypeID, processUserID, emp, false); } } - public void Process(DateTime fromDate, EnumProcessMode prMode, int payrollTypeID, int processUserID, List emps) + public void Process(DateTime fromDate, EnumProcessMode prMode, int payrollTypeID, int processUserID, List emps, bool overrideManualEntry) { bool isEchoTex = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "attendence", "echotexprocess"); if (isEchoTex == true) { - echoTexProcess(fromDate, prMode, payrollTypeID, processUserID, emps); + echoTexProcess(fromDate, prMode, payrollTypeID, processUserID, emps, overrideManualEntry); return; } _attnRunSummary = new AttnProcessRunSummary(); @@ -2565,7 +2565,7 @@ namespace HRM.DA - public void echoTexProcess(DateTime Attdate, EnumProcessMode prMode, int payrolltypeid, int processUserID, List< Employee> employees) + public void echoTexProcess(DateTime Attdate, EnumProcessMode prMode, int payrolltypeid, int processUserID, List< Employee> employees, bool overrideManualEntry) { AttnProcessRunSummary oAttnRunSummary = new AttnProcessRunSummary(); @@ -2668,7 +2668,7 @@ namespace HRM.DA .FirstOrDefault(obj => obj.EmployeeID == emp.ID); // 2. If Attendendence is manually enterred - if (manualEntry != null) + if (manualEntry != null && overrideManualEntry == false) { // 2.1 If Both In and Out are Manually Enterred then add the item if (!manualEntry.OnlyManualInTime && !manualEntry.OnlyManualOutTime) diff --git a/HRM.UI/ClientApp/src/app/attendance/attendance-process/attendance-process.component.html b/HRM.UI/ClientApp/src/app/attendance/attendance-process/attendance-process.component.html index 98aeef3..ba19677 100644 --- a/HRM.UI/ClientApp/src/app/attendance/attendance-process/attendance-process.component.html +++ b/HRM.UI/ClientApp/src/app/attendance/attendance-process/attendance-process.component.html @@ -2,7 +2,7 @@
-
+
@@ -17,7 +17,7 @@
-
+
@@ -32,17 +32,17 @@
-
+
+ id="chkIWithEmployee" kendoCheckBox/>
-
+
@@ -54,6 +54,16 @@ >
+ +
+
+ +
+
+ +
+
diff --git a/HRM.UI/ClientApp/src/app/attendance/attendance-process/attendance-process.component.ts b/HRM.UI/ClientApp/src/app/attendance/attendance-process/attendance-process.component.ts index 5cf2a97..ec7b9bb 100644 --- a/HRM.UI/ClientApp/src/app/attendance/attendance-process/attendance-process.component.ts +++ b/HRM.UI/ClientApp/src/app/attendance/attendance-process/attendance-process.component.ts @@ -27,6 +27,8 @@ export class AttendanceProcessComponent { processStatus: string = ""; withEmployee: boolean = false; showModal: boolean = false; + enableManualEntry: boolean = false; + overrideManualEntry: boolean = false; constructor(public attnService: AttendanceServices, public datatransferservice: DataTransferService, public loadingPanel: loadingPanelService, public notificationService: HRMNotificationService, @@ -65,6 +67,13 @@ export class AttendanceProcessComponent { } public GetSelectedEmployee(childData) { this.selectedEmployees = childData; + if (this.selectedEmployees != undefined && this.selectedEmployees.length == 1) { + this.enableManualEntry = true; + } + else { + this.enableManualEntry = false; + } + this.overrideManualEntry = false; } public onSave(e): void { @@ -91,16 +100,16 @@ export class AttendanceProcessComponent { // } //} - var attnRequest: { fromDate: Date, toDate: Date, isWithEmployee: boolean, employeeID: number }[]; + var attnRequest: { fromDate: Date, toDate: Date, isWithEmployee: boolean, employeeID: number, overrideManualEntry: boolean }[]; attnRequest = []; - - attnRequest.push({ "fromDate": this.fromDate, "toDate": this.toDate, "isWithEmployee": true, "employeeID": 0 }); + debugger + attnRequest.push({ "fromDate": this.fromDate, "toDate": this.toDate, "isWithEmployee": true, "employeeID": 0, "overrideManualEntry": this.overrideManualEntry }); if (this.withEmployee) { if (this.selectedEmployees != undefined && this.selectedEmployees.length > 0) { attnRequest = []; this.selectedEmployees.forEach(x => { - attnRequest.push({ "fromDate": this.fromDate, "toDate": this.toDate, "isWithEmployee": false, "employeeID": x.employeeID }); + attnRequest.push({ "fromDate": this.fromDate, "toDate": this.toDate, "isWithEmployee": false, "employeeID": x.employeeID, "overrideManualEntry": this.overrideManualEntry }); }); } @@ -138,8 +147,18 @@ export class AttendanceProcessComponent { else this.withEmployee = true; + this.enableManualEntry = false; + this.overrideManualEntry = false; + } public onClickNotInWorkPlanEmployee() { this.showModal = true; } + public checkBoxChangeOverrideManualEntry() { + if (this.overrideManualEntry) { + this.overrideManualEntry = false; + } + else + this.overrideManualEntry = true; + } } diff --git a/HRM.UI/Controllers/Attendance/AttendanceController.cs b/HRM.UI/Controllers/Attendance/AttendanceController.cs index 84b5f0d..eccce54 100644 --- a/HRM.UI/Controllers/Attendance/AttendanceController.cs +++ b/HRM.UI/Controllers/Attendance/AttendanceController.cs @@ -2697,6 +2697,7 @@ namespace HRM.UI.Controllers.Attendance DateTime fromDate = DateTime.Today; DateTime toDate = DateTime.Today; bool withoutEmployee = true; + bool overrideManualEntry = false; List emps = null; List employees = null; int empid; @@ -2711,6 +2712,7 @@ namespace HRM.UI.Controllers.Attendance fromDate = (DateTime)item["fromDate"].ToObject(); toDate = (DateTime)item["toDate"].ToObject(); withoutEmployee = (bool)item["isWithEmployee"].ToObject(); + overrideManualEntry = (bool)item["overrideManualEntry"].ToObject(); if (withoutEmployee == true) break; if (withoutEmployee == false && emps == null) emps = new List(); @@ -2735,7 +2737,7 @@ namespace HRM.UI.Controllers.Attendance for (DateTime attDate = fromDate; attDate <= toDate; attDate = attDate.AddDays(1)) { new AttendanceProcess().Process(new DateTime(attDate.Year, attDate.Month, attDate.Day), - EnumProcessMode.Manual, (int)currentUser.PayrollTypeID, currentUser.UserID, employees); + EnumProcessMode.Manual, (int)currentUser.PayrollTypeID, currentUser.UserID, employees, overrideManualEntry); } } catch (Exception e)