manual entry addition on atendance process
This commit is contained in:
parent
05be80a74e
commit
ee4e739248
|
@ -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<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");
|
||||
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)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<form>
|
||||
<div class="card card-w-title">
|
||||
<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">
|
||||
<label for="processFromDate">Process From</label>
|
||||
</div>
|
||||
|
@ -17,7 +17,7 @@
|
|||
</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">
|
||||
<label for="processToDate">Process To</label>
|
||||
</div>
|
||||
|
@ -32,17 +32,17 @@
|
|||
</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">
|
||||
<label for="chkIWithEmployee">Employee Wise</label>
|
||||
</div>
|
||||
<div class="p-col-12">
|
||||
<input type="checkbox" (change)="checkBoxChange()" [checked]="withEmployee"
|
||||
id="withEmployee" kendoCheckBox/>
|
||||
id="chkIWithEmployee" kendoCheckBox/>
|
||||
</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">
|
||||
<label for="employeePicker">Select Employee</label>
|
||||
</div>
|
||||
|
@ -54,6 +54,16 @@
|
|||
></app-employee-picker>
|
||||
</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 class="p-grid form-group">
|
||||
<div class="p-col-12 p-md-5">
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2697,6 +2697,7 @@ namespace HRM.UI.Controllers.Attendance
|
|||
DateTime fromDate = DateTime.Today;
|
||||
DateTime toDate = DateTime.Today;
|
||||
bool withoutEmployee = true;
|
||||
bool overrideManualEntry = false;
|
||||
List<SearchEmployee> emps = null;
|
||||
List<Employee> employees = null;
|
||||
int empid;
|
||||
|
@ -2711,6 +2712,7 @@ namespace HRM.UI.Controllers.Attendance
|
|||
fromDate = (DateTime)item["fromDate"].ToObject<DateTime>();
|
||||
toDate = (DateTime)item["toDate"].ToObject<DateTime>();
|
||||
withoutEmployee = (bool)item["isWithEmployee"].ToObject<bool>();
|
||||
overrideManualEntry = (bool)item["overrideManualEntry"].ToObject<bool>();
|
||||
if (withoutEmployee == true) break;
|
||||
if (withoutEmployee == false && emps == null)
|
||||
emps = new List<SearchEmployee>();
|
||||
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user