From e530aa664336c6bb3cc521458264384934597430 Mon Sep 17 00:00:00 2001 From: mashfiq Date: Wed, 16 Oct 2024 18:14:02 +0600 Subject: [PATCH 1/2] Prod bonus attn Time Modification --- .../production-bonus-attendance.component.ts | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/HRM.UI/ClientApp/src/app/payroll-ot/production-bonus-attendance/production-bonus-attendance.component.ts b/HRM.UI/ClientApp/src/app/payroll-ot/production-bonus-attendance/production-bonus-attendance.component.ts index 3e7feac..f423f8d 100644 --- a/HRM.UI/ClientApp/src/app/payroll-ot/production-bonus-attendance/production-bonus-attendance.component.ts +++ b/HRM.UI/ClientApp/src/app/payroll-ot/production-bonus-attendance/production-bonus-attendance.component.ts @@ -45,8 +45,8 @@ export class ProductionBonusAttendanceComponent implements OnInit { selectedDate: Date = new Date; - startTime: Date; - endTime: Date; + startTime: Date = new Date(); + endTime: Date = new Date(); selectedSalaryDate: Date = new Date(); @@ -76,6 +76,16 @@ export class ProductionBonusAttendanceComponent implements OnInit { // this.Loadlayout(); this.productionBonusSetup = new ProductionBonusSetup(); this.showScheduleDate = false; + + // this.startTime.setHours(6); + // this.startTime.setMinutes(0); + // this.startTime.setSeconds(0); + this.startTime = this.setTime(this.startTime, 6, 0, 0) + + // this.endTime.setHours(23); + // this.endTime.setMinutes(0); + // this.endTime.setSeconds(0); + this.endTime = this.setTime(this.endTime, 23, 0, 0) } employeeList: Employee[] = []; @@ -162,7 +172,7 @@ export class ProductionBonusAttendanceComponent implements OnInit { } onClickRefresh() { - debugger; + // debugger; const fromDate = new Date(this.productionBonusSetup.fromDate.setHours(0, 0, 0, 0)); const toDate = new Date(this.productionBonusSetup.toDate.setHours(0, 0, 0, 0)); const selectedDate = new Date(this.selectedDate.setHours(0, 0, 0, 0)); @@ -186,7 +196,7 @@ export class ProductionBonusAttendanceComponent implements OnInit { () => { this.loadingPanelService.ShowLoadingPanel = false; this.employeeList = []; - debugger; + // debugger; if (this.prodBonusAttn.length <= 0 && (this.productionBonusSetup.productionBonusType == EnumProductionBonusType.Cutting || this.productionBonusSetup.productionBonusType == EnumProductionBonusType.Finishing)) { let data = { @@ -223,6 +233,10 @@ export class ProductionBonusAttendanceComponent implements OnInit { for (let i = 0; i < this.prodBonusAttn.length; i++) { this.AddEmployeebyId(this.prodBonusAttn[i].employeeID); } + let inTime = new Date(this.prodBonusAttn[0].inTime); + let outTime = new Date(this.prodBonusAttn[0].inTime); + this.startTime = this.setTime(inTime, inTime.getHours(), inTime.getMinutes(), inTime.getSeconds()); + this.endTime = this.setTime(outTime, outTime.getHours(), outTime.getMinutes(), outTime.getSeconds()); } } ); @@ -428,4 +442,12 @@ export class ProductionBonusAttendanceComponent implements OnInit { scrollToBottom(): void { this.gridScrollableElement.scrollTop = this.gridScrollableElement.scrollHeight; } + + public setTime(date: Date, hour: number, min: number, sec: number): Date{ + date.setHours(hour); + date.setMinutes(min); + date.setSeconds(sec); + return date; + } + } From 5c762ae99fbd56e240310b8ed84a4bd54725e709 Mon Sep 17 00:00:00 2001 From: mashfiq Date: Wed, 16 Oct 2024 18:14:02 +0600 Subject: [PATCH 2/2] Prod bonus attn Time Modification --- .../production-bonus-attendance.component.ts | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/HRM.UI/ClientApp/src/app/payroll-ot/production-bonus-attendance/production-bonus-attendance.component.ts b/HRM.UI/ClientApp/src/app/payroll-ot/production-bonus-attendance/production-bonus-attendance.component.ts index 3e7feac..654973f 100644 --- a/HRM.UI/ClientApp/src/app/payroll-ot/production-bonus-attendance/production-bonus-attendance.component.ts +++ b/HRM.UI/ClientApp/src/app/payroll-ot/production-bonus-attendance/production-bonus-attendance.component.ts @@ -45,8 +45,8 @@ export class ProductionBonusAttendanceComponent implements OnInit { selectedDate: Date = new Date; - startTime: Date; - endTime: Date; + startTime: Date = new Date(); + endTime: Date = new Date(); selectedSalaryDate: Date = new Date(); @@ -76,6 +76,8 @@ export class ProductionBonusAttendanceComponent implements OnInit { // this.Loadlayout(); this.productionBonusSetup = new ProductionBonusSetup(); this.showScheduleDate = false; + this.startTime = this.setTime(this.startTime, 6, 0, 0) + this.endTime = this.setTime(this.endTime, 23, 0, 0) } employeeList: Employee[] = []; @@ -162,7 +164,7 @@ export class ProductionBonusAttendanceComponent implements OnInit { } onClickRefresh() { - debugger; + // debugger; const fromDate = new Date(this.productionBonusSetup.fromDate.setHours(0, 0, 0, 0)); const toDate = new Date(this.productionBonusSetup.toDate.setHours(0, 0, 0, 0)); const selectedDate = new Date(this.selectedDate.setHours(0, 0, 0, 0)); @@ -186,7 +188,7 @@ export class ProductionBonusAttendanceComponent implements OnInit { () => { this.loadingPanelService.ShowLoadingPanel = false; this.employeeList = []; - debugger; + // debugger; if (this.prodBonusAttn.length <= 0 && (this.productionBonusSetup.productionBonusType == EnumProductionBonusType.Cutting || this.productionBonusSetup.productionBonusType == EnumProductionBonusType.Finishing)) { let data = { @@ -223,6 +225,10 @@ export class ProductionBonusAttendanceComponent implements OnInit { for (let i = 0; i < this.prodBonusAttn.length; i++) { this.AddEmployeebyId(this.prodBonusAttn[i].employeeID); } + let inTime = new Date(this.prodBonusAttn[0].inTime); + let outTime = new Date(this.prodBonusAttn[0].inTime); + this.startTime = this.setTime(inTime, inTime.getHours(), inTime.getMinutes(), inTime.getSeconds()); + this.endTime = this.setTime(outTime, outTime.getHours(), outTime.getMinutes(), outTime.getSeconds()); } } ); @@ -428,4 +434,12 @@ export class ProductionBonusAttendanceComponent implements OnInit { scrollToBottom(): void { this.gridScrollableElement.scrollTop = this.gridScrollableElement.scrollHeight; } + + public setTime(date: Date, hour: number, min: number, sec: number): Date{ + date.setHours(hour); + date.setMinutes(min); + date.setSeconds(sec); + return date; + } + }