diff --git a/HRM.BO/Attendance/DailyAttnProcess.cs b/HRM.BO/Attendance/DailyAttnProcess.cs index 276aebe..1efed3a 100644 --- a/HRM.BO/Attendance/DailyAttnProcess.cs +++ b/HRM.BO/Attendance/DailyAttnProcess.cs @@ -441,20 +441,21 @@ namespace HRM.BO } } - public bool OnlyManualInTime - { - get { - return (this.IsManualEntry == true && this.ActualInTime != null) ? true : false;} + //public bool OnlyManualInTime + //{ + // get { + // return (this.IsManualEntry == true && this.ActualInTime != null) ? true : false;} - } - public bool OnlyManualOutTime - { - get - { - return (this.IsManualEntry == true && this.ActualOutTime != null) ? true : false; - } - } - + //} + //public bool OnlyManualOutTime + //{ + // get + // { + // return (this.IsManualEntry == true && this.ActualOutTime != null) ? true : false; + // } + //} + public bool OnlyManualInTime { get; set; } + public bool OnlyManualOutTime { get; set; } @@ -3382,6 +3383,7 @@ namespace HRM.BO DataTable getTopEmpAbsentData(Employee oEmp, EnumAttendanceType type); DataTable getcorehrAbsentData(Employee oEmp, EnumAttendanceType type); DataSet AttnDaysSummaryForSalaryProcess(DateTime FromDate, DateTime ToDate); + List GetByEmployees(DateTime attnDate, string employeeIDs); } #endregion diff --git a/HRM.DA/DA/Attendance/DailyAttnProcessDA.cs b/HRM.DA/DA/Attendance/DailyAttnProcessDA.cs index 6e1c3db..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 @@ -4092,6 +4110,11 @@ namespace HRM.DA return ds.Tables[0]; } + internal static IDataReader GetByEmployees(TransactionContext tc, DateTime attnDate, string employeeIDs) + { + return tc.ExecuteReader("SELECT * FROM DailyAttnProcess WHERE AttnDate=%d And employeeid in (%q)", attnDate, employeeIDs); + + } } #endregion diff --git a/HRM.DA/Service/Attendance/DailyAttnProcessService.cs b/HRM.DA/Service/Attendance/DailyAttnProcessService.cs index 14f6208..e44b483 100644 --- a/HRM.DA/Service/Attendance/DailyAttnProcessService.cs +++ b/HRM.DA/Service/Attendance/DailyAttnProcessService.cs @@ -46,7 +46,9 @@ namespace HRM.DA oDailyAttnProcess.AttenType = (EnumAttendanceType)oReader.GetInt32("AttenType").Value; oDailyAttnProcess.Comments = oReader.GetString("Comments") == null ? "" : oReader.GetString("Comments"); oDailyAttnProcess.Reason = oReader.GetString("Reason") == null ? "" : oReader.GetString("Reason"); - oDailyAttnProcess.IsManualEntry = oReader.GetBoolean("IsManualEntry").Value; + oDailyAttnProcess.IsManualEntry = oReader.GetBoolean("IsManualEntry", false); + oDailyAttnProcess.OnlyManualInTime = oReader.GetBoolean("OnlyManualInTime", false); + oDailyAttnProcess.OnlyManualOutTime = oReader.GetBoolean("OnlyManualOutTime", false); oDailyAttnProcess.IsFromMobile = (EnumIsFromMobile)oReader.GetInt32("IsFromMobile").Value; oDailyAttnProcess.InTimeLatitude = oReader.GetString("InTimeLatitude") == null ? 0.0m : Convert.ToDecimal(oReader.GetString("InTimeLatitude")); oDailyAttnProcess.OutTimeLatitude = oReader.GetString("OutTimeLatitude") == null ? 0.0m : Convert.ToDecimal(oReader.GetString("OutTimeLatitude")); @@ -1135,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) @@ -4807,6 +4818,29 @@ namespace HRM.DA return dt; } + public List GetByEmployees(DateTime attnDate, string employeeIDs) + { + List dailyAttnProcesses = new List(); + TransactionContext tc = null; + try + { + tc = TransactionContext.Begin(); + DataReader dr = new DataReader(DailyAttnProcessDA.GetByEmployees(tc, attnDate, employeeIDs)); + dailyAttnProcesses = this.CreateObjects(dr); + dr.Close(); + tc.End(); + } + catch (Exception e) + { + #region Handle Exception + if (tc != null) + tc.HandleError(); + ExceptionLog.Write(e); + throw new ServiceException(e.Message, e); + #endregion + } + return dailyAttnProcesses; + } } 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 9387ff3..84b5f0d 100644 --- a/HRM.UI/Controllers/Attendance/AttendanceController.cs +++ b/HRM.UI/Controllers/Attendance/AttendanceController.cs @@ -1331,6 +1331,85 @@ namespace HRM.UI.Controllers.Attendance return Ok(attnProcesses); } + [HttpPost("getDailyAttnProcessByEmpForManualEntry")] + public ActionResult getDailyAttnProcessByEmpForManualEntry(dynamic data) + { + List _dAttnProcessess = new List(); + DailyAttnProcess _dAttnProcess = null; + CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User); + try + { + var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data)); + string empids = ""; + DateTime attnDate = DateTime.Today; + List empIdList = new List(); + foreach (var item in items) + { + int empID = (int)item["employeeid"].ToObject(); + empids = empids + empID.ToString() + ","; + attnDate = (DateTime)item["attnDate"].ToObject(); + empIdList.Add(empID); + } + + 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); + + foreach (var empid in empIdList) + { + bool existInList = false; + foreach (DailyAttnProcess dattnPs in _dAttnProcessess) + { + if (dattnPs.EmployeeID == empid) + { + existInList = true; + } + } + if (!existInList) + { + bool ExistInSavedData = false; + if (dAttnProcessess != null && dAttnProcessess.Count > 0) + { + foreach (DailyAttnProcess dAttnProcess in dAttnProcessess) + { + if (dAttnProcess.EmployeeID == empid) + { + ExistInSavedData = true; + _dAttnProcessess.Add(dAttnProcess); + } + } + } + + if (!ExistInSavedData) + { + _dAttnProcess = new DailyAttnProcess(); + _dAttnProcess.EmployeeID = empid; + _dAttnProcess.AttnDate = attnDate; + _dAttnProcessess.Add(_dAttnProcess); + } + } + } + + //if (_dAttnProcessess != null && _dAttnProcessess.Count > 0) + //{ + // int serial = 1; + // foreach (DailyAttnProcess dAttnProcess in _dAttnProcessess) + // { + // if (dAttnProcess.IsNew) + // { + + // } + // } + //} + } + catch (Exception e) + { + return StatusCode(StatusCodes.Status500InternalServerError, e.Message); + } + + return Ok(_dAttnProcessess); + } // DailyAttnProcess [HttpGet("getDailyAttnProcessByEmployeeId/{employeeId}")]