AttendanceProcess Modification
Task No- 20250320-0128
This commit is contained in:
parent
4b7e9c47b1
commit
9200c31f10
|
@ -223,7 +223,7 @@ namespace HRM.DA
|
||||||
id);
|
id);
|
||||||
tc.ExecuteNonQuery("DELETE FROM SalaryMonthly WHERE SalaryProcessID=%n", id);
|
tc.ExecuteNonQuery("DELETE FROM SalaryMonthly WHERE SalaryProcessID=%n", id);
|
||||||
//}
|
//}
|
||||||
tc.ExecuteNonQuery("DELETE FROM SalaryProcess WHERE SalaryProcessID=%n", id);
|
//tc.ExecuteNonQuery("DELETE FROM SalaryProcess WHERE SalaryProcessID=%n", id);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void UndoMonthlySalaryByIDs(TransactionContext tc, string ids)
|
internal static void UndoMonthlySalaryByIDs(TransactionContext tc, string ids)
|
||||||
|
|
|
@ -473,7 +473,7 @@ namespace HRM.DA
|
||||||
}
|
}
|
||||||
_attnRunSummary = new AttnProcessRunSummary();
|
_attnRunSummary = new AttnProcessRunSummary();
|
||||||
_attnRunSummary.ProcessMode = prMode;
|
_attnRunSummary.ProcessMode = prMode;
|
||||||
// bool isInOutApplicable = false;
|
//bool isInOutApplicable = false;
|
||||||
|
|
||||||
_shifts = _shifts ?? new ShiftService().GetAllShift();
|
_shifts = _shifts ?? new ShiftService().GetAllShift();
|
||||||
|
|
||||||
|
@ -483,7 +483,7 @@ namespace HRM.DA
|
||||||
#region Initialization for Attendence Process
|
#region Initialization for Attendence Process
|
||||||
|
|
||||||
Attdate = fromDate;
|
Attdate = fromDate;
|
||||||
// isInOutApplicable = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "attendence", "inoutapplicable");
|
//isInOutApplicable = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "attendence", "inoutapplicable");
|
||||||
|
|
||||||
List<DailyAttnProcess> dailyattProcesses = new List<DailyAttnProcess>();
|
List<DailyAttnProcess> dailyattProcesses = new List<DailyAttnProcess>();
|
||||||
List<DailyAttendanceAllowance> dailyAttendanceAllowances = new List<DailyAttendanceAllowance>();
|
List<DailyAttendanceAllowance> dailyAttendanceAllowances = new List<DailyAttendanceAllowance>();
|
||||||
|
@ -2597,7 +2597,11 @@ namespace HRM.DA
|
||||||
|
|
||||||
List<Shift> shifts =new ShiftService().GetAllShift();
|
List<Shift> shifts =new ShiftService().GetAllShift();
|
||||||
List<WorkPlanGroup> workPlanGroups = new WorkPlanGroupService().GetAll();
|
List<WorkPlanGroup> workPlanGroups = new WorkPlanGroupService().GetAll();
|
||||||
if( employees == null) employees = new EmployeeService().GetAllLive();
|
//if( employees == null) employees = new EmployeeService().GetAllLive();
|
||||||
|
if( employees == null)
|
||||||
|
employees = new EmployeeService().Get(EnumEmployeeStatus.Live, payrolltypeid)
|
||||||
|
.OrderBy(num => num.EmployeeNo.Length).ThenBy(num => Convert.ToInt32(num.EmployeeNo)).ToList();
|
||||||
|
|
||||||
List<Employee> discontinueEmps =new EmployeeService().GetDiscontinueEmp(Attdate, DateTime.Now, payrolltypeid);
|
List<Employee> discontinueEmps =new EmployeeService().GetDiscontinueEmp(Attdate, DateTime.Now, payrolltypeid);
|
||||||
|
|
||||||
//List<AttnRawData> attRawdata = new AttnRawDataService().Get(startTime, ToTime, payrolltypeid);// get raw data by a date and order by date, employee, punchTime
|
//List<AttnRawData> attRawdata = new AttnRawDataService().Get(startTime, ToTime, payrolltypeid);// get raw data by a date and order by date, employee, punchTime
|
||||||
|
@ -2636,7 +2640,6 @@ namespace HRM.DA
|
||||||
|
|
||||||
foreach (Employee emp in employees)
|
foreach (Employee emp in employees)
|
||||||
{
|
{
|
||||||
|
|
||||||
//EmpTempid = emp.ID.Integer;
|
//EmpTempid = emp.ID.Integer;
|
||||||
|
|
||||||
#region EmployeeWise Setup
|
#region EmployeeWise Setup
|
||||||
|
|
|
@ -2960,9 +2960,9 @@ namespace HRM.DA
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DateTime GetLastProcessDateUsingPayrollType(int PayrolltypeID)
|
public DateTime? GetLastProcessDateUsingPayrollType(int PayrolltypeID)
|
||||||
{
|
{
|
||||||
DateTime lastProcessDate = DateTime.MinValue;
|
DateTime? lastProcessDate = null;
|
||||||
TransactionContext tc = null;
|
TransactionContext tc = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -2972,7 +2972,7 @@ namespace HRM.DA
|
||||||
{
|
{
|
||||||
lastProcessDate = oreader.GetDateTime("LastProcessDate").HasValue
|
lastProcessDate = oreader.GetDateTime("LastProcessDate").HasValue
|
||||||
? oreader.GetDateTime("LastProcessDate").Value
|
? oreader.GetDateTime("LastProcessDate").Value
|
||||||
: DateTime.MinValue;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
oreader.Close();
|
oreader.Close();
|
||||||
|
|
|
@ -209,6 +209,10 @@ export class AttendanceServices {
|
||||||
// return this.apiService.httpGet<EmployeeWorkPlanSetup[]>('/Attendance' + '/getNotYetAssiged');
|
// return this.apiService.httpGet<EmployeeWorkPlanSetup[]>('/Attendance' + '/getNotYetAssiged');
|
||||||
return this.apiService.httpGet<Employee[]>('/Attendance' + '/getNotYetAssiged');
|
return this.apiService.httpGet<Employee[]>('/Attendance' + '/getNotYetAssiged');
|
||||||
}
|
}
|
||||||
|
getLastAttnProcessDate() {
|
||||||
|
// return this.apiService.httpGet<EmployeeWorkPlanSetup[]>('/Attendance' + '/getNotYetAssiged');
|
||||||
|
return this.apiService.httpGet<Date>('/Attendance' + '/getLastAttnProcessDate');
|
||||||
|
}
|
||||||
getEmployeeWorkPlanSetupByWPGroupID(groupId: number) {
|
getEmployeeWorkPlanSetupByWPGroupID(groupId: number) {
|
||||||
return this.apiService.httpGet<EmployeeWorkPlanSetup[]>('/Attendance' + '/getEmployeeWorkPlanSetupByWPGroupID' + '/' + groupId);
|
return this.apiService.httpGet<EmployeeWorkPlanSetup[]>('/Attendance' + '/getEmployeeWorkPlanSetupByWPGroupID' + '/' + groupId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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-5">
|
<div class="p-col-12 p-md-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-5">
|
<div class="p-col-12 p-md-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>
|
||||||
|
@ -33,12 +33,23 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="p-col-12 p-md-2">
|
<div class="p-col-12 p-md-2">
|
||||||
|
<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/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="p-col-12 p-md-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>
|
||||||
<div class="p-col-12">
|
<div class="p-col-12">
|
||||||
<app-employee-picker
|
<app-employee-picker
|
||||||
[MultiSelect]="true"
|
[MultiSelect]="true"
|
||||||
|
[isActive]="withEmployee"
|
||||||
(ItemSelected)="GetSelectedEmployee($event)"
|
(ItemSelected)="GetSelectedEmployee($event)"
|
||||||
></app-employee-picker>
|
></app-employee-picker>
|
||||||
</div>
|
</div>
|
||||||
|
@ -47,7 +58,11 @@
|
||||||
<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">
|
||||||
<div class="p-col-12">
|
<div class="p-col-12">
|
||||||
<label for="txtWP">(Number of Employees not in Work Plan : {{ employees.length }})</label>
|
<!-- <label for="txtLE">(Number of Attendance Employees : {{ employees.length }})</label> -->
|
||||||
|
<label for="txtWP">Number of Employees not in Work Plan : {{ employees.length }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="p-col-12" *ngIf="lastProcessDate != null">
|
||||||
|
<label style="color: red;" for="txtWP">Last Process date : {{ lastProcessDate != null ? (lastProcessDate | date: 'dd MMM yyyy') : '' }}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-col-12">
|
<div class="p-col-12">
|
||||||
<button icon="rotate"
|
<button icon="rotate"
|
||||||
|
|
|
@ -23,7 +23,9 @@ export class AttendanceProcessComponent {
|
||||||
selectedEmployees: SearchEmployee[] = [];
|
selectedEmployees: SearchEmployee[] = [];
|
||||||
notYetAssingedList: EmployeeWorkPlanSetup[];
|
notYetAssingedList: EmployeeWorkPlanSetup[];
|
||||||
employees: any[] = [];
|
employees: any[] = [];
|
||||||
processStatus:string = "";
|
lastProcessDate: Date;
|
||||||
|
processStatus: string = "";
|
||||||
|
withEmployee: 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,
|
||||||
|
@ -35,7 +37,7 @@ export class AttendanceProcessComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.notYetAssingedList =[]
|
this.notYetAssingedList = []
|
||||||
this.fromDate = new Date();
|
this.fromDate = new Date();
|
||||||
this.toDate = new Date();
|
this.toDate = new Date();
|
||||||
this.attnService.getNotYetAssiged().subscribe(
|
this.attnService.getNotYetAssiged().subscribe(
|
||||||
|
@ -46,7 +48,18 @@ export class AttendanceProcessComponent {
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
});
|
});
|
||||||
|
this.attnService.getLastAttnProcessDate().subscribe(
|
||||||
|
(resp) => {
|
||||||
|
if (resp != null) {
|
||||||
|
this.lastProcessDate = new Date(resp);
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
(x) => {
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
public GetSelectedEmployee(childData) {
|
public GetSelectedEmployee(childData) {
|
||||||
this.selectedEmployees = childData;
|
this.selectedEmployees = childData;
|
||||||
|
@ -81,18 +94,25 @@ export class AttendanceProcessComponent {
|
||||||
|
|
||||||
|
|
||||||
attnRequest.push({ "fromDate": this.fromDate, "toDate": this.toDate, "isWithEmployee": true, "employeeID": 0 });
|
attnRequest.push({ "fromDate": this.fromDate, "toDate": this.toDate, "isWithEmployee": true, "employeeID": 0 });
|
||||||
if (this.selectedEmployees != undefined && this.selectedEmployees.length > 0) {
|
if (this.withEmployee) {
|
||||||
attnRequest = [];
|
if (this.selectedEmployees != undefined && this.selectedEmployees.length > 0) {
|
||||||
this.selectedEmployees.forEach(x => {
|
attnRequest = [];
|
||||||
attnRequest.push({ "fromDate": this.fromDate, "toDate": this.toDate, "isWithEmployee": false, "employeeID": x.employeeID });
|
this.selectedEmployees.forEach(x => {
|
||||||
|
attnRequest.push({ "fromDate": this.fromDate, "toDate": this.toDate, "isWithEmployee": false, "employeeID": x.employeeID });
|
||||||
});
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.notificationService.showWarning('Please Select Employee!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
this.loadingPanel.ShowLoadingPanel = true;
|
this.loadingPanel.ShowLoadingPanel = true;
|
||||||
|
|
||||||
this.attnService.dailyAttnProcessManual(attnRequest).subscribe(
|
this.attnService.dailyAttnProcessManual(attnRequest).subscribe(
|
||||||
(x) => {
|
(x) => {
|
||||||
|
|
||||||
},
|
},
|
||||||
(x) => {
|
(x) => {
|
||||||
this.loadingPanel.ShowLoadingPanel = false;
|
this.loadingPanel.ShowLoadingPanel = false;
|
||||||
|
@ -106,4 +126,15 @@ export class AttendanceProcessComponent {
|
||||||
this.processStatus = "Attendance Process is completed successfully.";
|
this.processStatus = "Attendance Process is completed successfully.";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public checkBoxChange() {
|
||||||
|
debugger
|
||||||
|
if (this.withEmployee) {
|
||||||
|
this.withEmployee = false;
|
||||||
|
this.selectedEmployees = [];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
this.withEmployee = true;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ using Microsoft.Extensions.Options;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
using System.Data.SqlTypes;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using static iTextSharp.text.pdf.AcroFields;
|
using static iTextSharp.text.pdf.AcroFields;
|
||||||
|
@ -957,6 +958,22 @@ namespace HRM.UI.Controllers.Attendance
|
||||||
|
|
||||||
return Ok(items);
|
return Ok(items);
|
||||||
}
|
}
|
||||||
|
[HttpGet("getLastAttnProcessDate")]
|
||||||
|
public ActionResult getLastAttnProcessDate()
|
||||||
|
{
|
||||||
|
DateTime? date = new DateTime();
|
||||||
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
date = new DailyAttnProcessService().GetLastProcessDateUsingPayrollType((int)currentUser.PayrollTypeID);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Ok(date);
|
||||||
|
}
|
||||||
|
|
||||||
[HttpGet("getEmployeeWorkPlanSetupByWPGroupID/{groupId}")]
|
[HttpGet("getEmployeeWorkPlanSetupByWPGroupID/{groupId}")]
|
||||||
public ActionResult GetEmployeeWorkPlanSetupByWPGroupID(int groupId)
|
public ActionResult GetEmployeeWorkPlanSetupByWPGroupID(int groupId)
|
||||||
|
@ -2618,6 +2635,12 @@ namespace HRM.UI.Controllers.Attendance
|
||||||
(int)currentUser.PayrollTypeID);
|
(int)currentUser.PayrollTypeID);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//employees = new EmployeeService().Get(EnumEmployeeStatus.Live, (int)currentUser.PayrollTypeID)
|
||||||
|
// .OrderBy(num => num.EmployeeNo.Length).ThenBy(num => Convert.ToInt32(num.EmployeeNo)).ToList();
|
||||||
|
//count++;
|
||||||
|
}
|
||||||
|
|
||||||
for (DateTime attDate = fromDate; attDate <= toDate; attDate = attDate.AddDays(1))
|
for (DateTime attDate = fromDate; attDate <= toDate; attDate = attDate.AddDays(1))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user