diff --git a/Mohem/src/app/attendance-tracking/home/home.component.ts b/Mohem/src/app/attendance-tracking/home/home.component.ts
index a02ea816..aa8ca30b 100644
--- a/Mohem/src/app/attendance-tracking/home/home.component.ts
+++ b/Mohem/src/app/attendance-tracking/home/home.component.ts
@@ -25,6 +25,7 @@ export class HomeComponent implements OnInit {
public isCheckedIn = undefined;
public displayTime: any;
public percent: any;
+ public spentHours: any;
public userData = this.sharedData.getSharedData(AuthenticatedUser.SHARED_DATA, false);
constructor(
public cs: CommonService,
@@ -96,9 +97,12 @@ export class HomeComponent implements OnInit {
convertAndAssignTime(data) {
this.remainingTime = this.convertInSeconds(data.P_REMAINING_HOURS.split(':'));
this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':'));
- this.isCheckedIn = this.remainingTime === this.scheduledTime ? false : true;
- this.initTimer();
- }
+ this.spentHours = this.convertInSeconds(data.P_SPENT_HOURS.split(':'));
+ this.isCheckedIn = this.spentHours === 0 ? false : true;
+ if (this.isCheckedIn) {
+ this.initTimer();
+ }
+}
showAttendanceTracking() {
const request = {
diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts
index 2ae0e2b3..f628722b 100644
--- a/Mohem/src/app/home/home.page.ts
+++ b/Mohem/src/app/home/home.page.ts
@@ -121,26 +121,16 @@ export class HomePage implements OnInit {
public hasFinished = false;
public remainingTime: any;
public scheduledTime: any;
+ public spentHours: any;
public isCheckedIn = undefined;
public displayTime: any;
public menuEntries: any;
public percent: any;
-///////////////////////////////// TIME AND DATE VALUES///////////////////////////////
-public monthName: any;
-public yearDate: any;
-public selEmp: string;
-public selMenu: MenuResponse = new MenuResponse();
-public respID: number;
-public menuType: any;
-public dayAndHoursPageNumber = 1;
-public selectedFilters: any = {};
-public selectedShiftFilter: any;
-public arrDaysAttendance: any = [];
-public arrDaysAbsent: any = [];
-public arrDaysOff: any = [];
-public arrFutrueDays: any = [];
-
-/////////////////////////////// END//////////////////////////////////////////////////
+ public selEmp: string;
+ public selMenu: MenuResponse = new MenuResponse();
+ public respID: number;
+ public menuType: any;
+
constructor(
public ts: TranslatorService,
public menu: MenuController,
@@ -524,8 +514,11 @@ convertAndAssignTime(data) {
console.log(data);
this.remainingTime = this.convertInSeconds(data.P_REMAINING_HOURS.split(':'));
this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':'));
- this.isCheckedIn = this.remainingTime === this.scheduledTime ? false : true;
- this.initTimer();
+ this.spentHours = this.convertInSeconds(data.P_SPENT_HOURS.split(':'));
+ this.isCheckedIn = this.spentHours === 0 ? false : true;
+ if (this.isCheckedIn) {
+ this.initTimer();
+ }
}
showAttendanceTracking() {
@@ -597,7 +590,7 @@ openPage(subMenu) {
this.common.openPayslipPage();
}
if (subMenu.REQUEST_TYPE === 'TIME_CARD') {
- this.getDayHoursTypeDetails();
+ this.common.openTimeCardPage();
}
}
@@ -631,98 +624,16 @@ getAccrualBalance() {
openattentracking() {
this.common.openAttenTrackingpage();
- }
+}
openProfilePage() {
this.common.openEditProfile();
- }
+}
openStatsButton(link: string) {
console.log(link);
this.common.openPage(link);
- }
-
- public getDayHoursTypeDetails() {
- const dayAndHoursReqObj = new GetDayAndHoursDetailsRequest();
- this.monthName = moment().format('MMMM');
- this.yearDate = moment().format('YYYY');
- this.selEmp = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
- this.respID = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
- this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
- this.menuType = this.selMenu.List_Menu.MENU_TYPE;
-
- dayAndHoursReqObj.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
- dayAndHoursReqObj.P_MENU_TYPE = this.menuType;
- dayAndHoursReqObj.P_SELECTED_RESP_ID = this.respID;
- dayAndHoursReqObj.SearchMonth = this.monthName;
- dayAndHoursReqObj.SearchYear = this.yearDate;
- dayAndHoursReqObj.P_PAGE_NUM = this.dayAndHoursPageNumber;
- dayAndHoursReqObj.P_PAGE_LIMIT = 100;
-
- if (Object.keys(this.selectedFilters).length !== 0) {
- dayAndHoursReqObj.P_SHT_TYPE = this.selectedShiftFilter;
- dayAndHoursReqObj.P_EXCESS_FLAG = this.selectedFilters['P_EXCESS_FLAG'.toString()].value;
- dayAndHoursReqObj.P_TIMEBACK_FLAG = this.selectedFilters['P_TIMEBACK_FLAG'.toString()].value;
- dayAndHoursReqObj.P_COMP_OFF_FLAG = this.selectedFilters['P_COMP_OFF_FLAG'.toString()].value;
- dayAndHoursReqObj.P_NON_SCHEDULED_FLAG = this.selectedFilters['P_NON_SCHEDULED_FLAG'.toString()].value;
- dayAndHoursReqObj.P_LATE_IN_FLAG = this.selectedFilters['P_LATE_IN_FLAG'.toString()].value;
- dayAndHoursReqObj.P_EARLY_OUT_FLAG = this.selectedFilters['P_EARLY_OUT_FLAG'.toString()].value;
- dayAndHoursReqObj.P_SHORTAGE_FLAG = this.selectedFilters['P_SHORTAGE_FLAG'.toString()].value;
- dayAndHoursReqObj.P_MISSING_SWIPE_FLAG = this.selectedFilters['P_MISSING_SWIPE_FLAG'.toString()].value;
- dayAndHoursReqObj.P_ACTUAL_WOB_SEC = this.selectedFilters['P_ACTUAL_WOB_SEC'.toString()].value;
- dayAndHoursReqObj.P_ANALAYZED_FLAG = this.selectedFilters['P_ANALAYZED_FLAG'.toString()].value;
- dayAndHoursReqObj.P_APPR_TIMEBACK_FLAG = this.selectedFilters['P_APPR_TIMEBACK_FLAG'.toString()].value;
- }
-
- this.timeCardService.getDayHoursTypeDetails(dayAndHoursReqObj).subscribe((result) => {
- if (this.common.validResponse(result)) {
- this.countAllAttendDays(result.GetDayHoursTypeDetailsList);
- // this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'calendarDateValue');
- this.common.openTimeCardPage();
- }
- });
-
- }
-
-
-
-
-countAllAttendDays(allDays) {
- for (let i = 0; i < allDays.length; i++) {
- if (allDays[i].DAY_TYPE == 'OFF') {
- // offDay
- this.arrDaysOff.push({startTime: new Date(allDays[i].SCHEDULE_DATE),
- endTime: new Date(allDays[i].SCHEDULE_DATE)});
- } else if (allDays[i].DAY_TYPE == 'SCHEDULED' && !allDays[i].REMARKS) {
- // attendace
- this.arrDaysAttendance.push({startTime: new Date(allDays[i].SCHEDULE_DATE),
- endTime: new Date(allDays[i].SCHEDULE_DATE)});
- } else if (allDays[i].DAY_TYPE == 'SCHEDULED' && allDays[i].REMARKS) {
- // absent
- this.arrDaysAbsent.push(
- {
- startTime: new Date(allDays[i].SCHEDULE_DATE),
- endTime: new Date(allDays[i].SCHEDULE_DATE),
- isoTime: '09:00:00',
- allDay: false
- }
- );
- } else {
- this.arrFutrueDays.push(
- {
- startTime: new Date(allDays[i].SCHEDULE_DATE),
- endTime: new Date(allDays[i].SCHEDULE_DATE),
- isoTime: '09:00:00',
- allDay: false
- }
- );
- }
- }
- this.common.sharedService.setSharedData(this.arrDaysOff, 'calendarDayOffDateValue');
- this.common.sharedService.setSharedData(this.arrDaysAttendance, 'calendarAttendanceDateValue');
- this.common.sharedService.setSharedData( this.arrDaysAbsent, 'calendarDaysAbsentDateValue');
- this.common.sharedService.setSharedData( this.arrFutrueDays, 'calendarDaysFutrueDateValue');
- }
+}
}
diff --git a/Mohem/src/app/my-team/details/details.component.html b/Mohem/src/app/my-team/details/details.component.html
index d62bae40..f439d8df 100644
--- a/Mohem/src/app/my-team/details/details.component.html
+++ b/Mohem/src/app/my-team/details/details.component.html
@@ -90,7 +90,7 @@
{{ts.trPK('attendance','monthly-attendance-calendar')}}