manual entry addition on atendance process

This commit is contained in:
mashfiq 2025-07-22 18:11:23 +06:00
parent 05be80a74e
commit ee4e739248
4 changed files with 47 additions and 16 deletions

View File

@ -443,7 +443,7 @@ namespace HRM.DA
foreach(var item in Groupdate) foreach(var item in Groupdate)
{ {
Thread myNewThread = new Thread(() => Process(item.Key, Thread myNewThread = new Thread(() => Process(item.Key,
EnumProcessMode.Auto, oemp.PayrollTypeID, ouser.ID, emps)); EnumProcessMode.Auto, oemp.PayrollTypeID, ouser.ID, emps, false));
myNewThread.Start(); myNewThread.Start();
} }
@ -462,16 +462,16 @@ namespace HRM.DA
_shifts = new ShiftService().GetAllShift(); _shifts = new ShiftService().GetAllShift();
for (DateTime currentDate = ProcessDate; currentDate <= endDate; currentDate = currentDate.AddDays(1)) 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<Employee> emps) public void Process(DateTime fromDate, EnumProcessMode prMode, int payrollTypeID, int processUserID, List<Employee> emps, bool overrideManualEntry)
{ {
bool isEchoTex = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "attendence", "echotexprocess"); bool isEchoTex = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "attendence", "echotexprocess");
if (isEchoTex == true) if (isEchoTex == true)
{ {
echoTexProcess(fromDate, prMode, payrollTypeID, processUserID, emps); echoTexProcess(fromDate, prMode, payrollTypeID, processUserID, emps, overrideManualEntry);
return; return;
} }
_attnRunSummary = new AttnProcessRunSummary(); _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(); AttnProcessRunSummary oAttnRunSummary = new AttnProcessRunSummary();
@ -2668,7 +2668,7 @@ namespace HRM.DA
.FirstOrDefault(obj => obj.EmployeeID == emp.ID); .FirstOrDefault(obj => obj.EmployeeID == emp.ID);
// 2. If Attendendence is manually enterred // 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 // 2.1 If Both In and Out are Manually Enterred then add the item
if (!manualEntry.OnlyManualInTime && !manualEntry.OnlyManualOutTime) if (!manualEntry.OnlyManualInTime && !manualEntry.OnlyManualOutTime)

View File

@ -2,7 +2,7 @@
<form> <form>
<div class="card card-w-title"> <div class="card card-w-title">
<div class="p-grid form-group"> <div class="p-grid form-group">
<div class="p-col-12 p-md-4"> <div class="p-col-12 p-md-6 p-lg-4">
<div class="p-col-12"> <div class="p-col-12">
<label for="processFromDate">Process From</label> <label for="processFromDate">Process From</label>
</div> </div>
@ -17,7 +17,7 @@
</div> </div>
</div> </div>
<div class="p-col-12 p-md-4"> <div class="p-col-12 p-md-6 p-lg-4">
<div class="p-col-12"> <div class="p-col-12">
<label for="processToDate">Process To</label> <label for="processToDate">Process To</label>
</div> </div>
@ -32,17 +32,17 @@
</div> </div>
</div> </div>
<div class="p-col-12 p-md-2"> <div class="p-col-12 p-md-4 p-lg-1">
<div class="p-col-12"> <div class="p-col-12">
<label for="chkIWithEmployee">Employee Wise</label> <label for="chkIWithEmployee">Employee Wise</label>
</div> </div>
<div class="p-col-12"> <div class="p-col-12">
<input type="checkbox" (change)="checkBoxChange()" [checked]="withEmployee" <input type="checkbox" (change)="checkBoxChange()" [checked]="withEmployee"
id="withEmployee" kendoCheckBox/> id="chkIWithEmployee" kendoCheckBox/>
</div> </div>
</div> </div>
<div class="p-col-12 p-md-2" *ngIf="withEmployee"> <div class="p-col-12 p-md-4 p-lg-2" *ngIf="withEmployee">
<div class="p-col-12"> <div class="p-col-12">
<label for="employeePicker">Select Employee</label> <label for="employeePicker">Select Employee</label>
</div> </div>
@ -54,6 +54,16 @@
></app-employee-picker> ></app-employee-picker>
</div> </div>
</div> </div>
<div class="p-col-12 p-md-4 p-lg-1" *ngIf="enableManualEntry">
<div class="p-col-12">
<label for="chkOverrideManualEntry">Override Manual Entry</label>
</div>
<div class="p-col-12">
<input type="checkbox" [checked]="overrideManualEntry" (change)="checkBoxChangeOverrideManualEntry()"
id="manualEntry" kendoCheckBox/>
</div>
</div>
</div> </div>
<div class="p-grid form-group"> <div class="p-grid form-group">
<div class="p-col-12 p-md-5"> <div class="p-col-12 p-md-5">

View File

@ -27,6 +27,8 @@ export class AttendanceProcessComponent {
processStatus: string = ""; processStatus: string = "";
withEmployee: boolean = false; withEmployee: boolean = false;
showModal: boolean = false; showModal: boolean = false;
enableManualEntry: boolean = false;
overrideManualEntry: boolean = false;
constructor(public attnService: AttendanceServices, public datatransferservice: DataTransferService, constructor(public attnService: AttendanceServices, public datatransferservice: DataTransferService,
public loadingPanel: loadingPanelService, public loadingPanel: loadingPanelService,
public notificationService: HRMNotificationService, public notificationService: HRMNotificationService,
@ -65,6 +67,13 @@ export class AttendanceProcessComponent {
} }
public GetSelectedEmployee(childData) { public GetSelectedEmployee(childData) {
this.selectedEmployees = 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 { 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 = [];
debugger
attnRequest.push({ "fromDate": this.fromDate, "toDate": this.toDate, "isWithEmployee": true, "employeeID": 0 }); attnRequest.push({ "fromDate": this.fromDate, "toDate": this.toDate, "isWithEmployee": true, "employeeID": 0, "overrideManualEntry": this.overrideManualEntry });
if (this.withEmployee) { if (this.withEmployee) {
if (this.selectedEmployees != undefined && this.selectedEmployees.length > 0) { if (this.selectedEmployees != undefined && this.selectedEmployees.length > 0) {
attnRequest = []; attnRequest = [];
this.selectedEmployees.forEach(x => { 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 else
this.withEmployee = true; this.withEmployee = true;
this.enableManualEntry = false;
this.overrideManualEntry = false;
} }
public onClickNotInWorkPlanEmployee() { public onClickNotInWorkPlanEmployee() {
this.showModal = true; this.showModal = true;
} }
public checkBoxChangeOverrideManualEntry() {
if (this.overrideManualEntry) {
this.overrideManualEntry = false;
}
else
this.overrideManualEntry = true;
}
} }

View File

@ -2697,6 +2697,7 @@ namespace HRM.UI.Controllers.Attendance
DateTime fromDate = DateTime.Today; DateTime fromDate = DateTime.Today;
DateTime toDate = DateTime.Today; DateTime toDate = DateTime.Today;
bool withoutEmployee = true; bool withoutEmployee = true;
bool overrideManualEntry = false;
List<SearchEmployee> emps = null; List<SearchEmployee> emps = null;
List<Employee> employees = null; List<Employee> employees = null;
int empid; int empid;
@ -2711,6 +2712,7 @@ namespace HRM.UI.Controllers.Attendance
fromDate = (DateTime)item["fromDate"].ToObject<DateTime>(); fromDate = (DateTime)item["fromDate"].ToObject<DateTime>();
toDate = (DateTime)item["toDate"].ToObject<DateTime>(); toDate = (DateTime)item["toDate"].ToObject<DateTime>();
withoutEmployee = (bool)item["isWithEmployee"].ToObject<bool>(); withoutEmployee = (bool)item["isWithEmployee"].ToObject<bool>();
overrideManualEntry = (bool)item["overrideManualEntry"].ToObject<bool>();
if (withoutEmployee == true) break; if (withoutEmployee == true) break;
if (withoutEmployee == false && emps == null) if (withoutEmployee == false && emps == null)
emps = new List<SearchEmployee>(); emps = new List<SearchEmployee>();
@ -2735,7 +2737,7 @@ namespace HRM.UI.Controllers.Attendance
for (DateTime attDate = fromDate; attDate <= toDate; attDate = attDate.AddDays(1)) for (DateTime attDate = fromDate; attDate <= toDate; attDate = attDate.AddDays(1))
{ {
new AttendanceProcess().Process(new DateTime(attDate.Year, attDate.Month, attDate.Day), 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) catch (Exception e)