|
|
|
|
@ -15,7 +15,7 @@ import { attendanceSwipeScannerRequest } from './models/attendanceSwipe.Request'
|
|
|
|
|
import { Response } from 'src/app/hmg-common/services/models/response';
|
|
|
|
|
import { AttendanceService } from './services/attendance.services';
|
|
|
|
|
import { LoginRequest } from '../hmg-common/services/authentication/models/login.request';
|
|
|
|
|
import { FileUploaderComponent } from '../hmg-common/ui/file-uploader/file-uploader.component'
|
|
|
|
|
import { FileUploaderComponent } from '../hmg-common/ui/file-uploader/file-uploader.component';
|
|
|
|
|
import { Camera } from '@ionic-native/Camera/ngx';
|
|
|
|
|
import { File } from '@ionic-native/file/ngx';
|
|
|
|
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
|
|
|
@ -28,10 +28,10 @@ import { PerformanceAppraisalResponse } from '../hmg-common/services/dashbored/p
|
|
|
|
|
import { AttendanceTrackingResponse } from '../hmg-common/services/dashbored/attendance-tracking.response';
|
|
|
|
|
import { OpenPeriodDatesResponse } from '../hmg-common/services/dashbored/models/openPeriodDatesResponse';
|
|
|
|
|
import { GetSubordinatesAttdStatusRequest } from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest';
|
|
|
|
|
import { GetSubordinatesLeavesRequest } from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest'
|
|
|
|
|
import { GetOpenNotificationsResponse } from '../hmg-common/services/dashbored/models/GetOpenNotificationsResponse'
|
|
|
|
|
import { GetSubordinatesAttdStatusResponse } from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse'
|
|
|
|
|
import { GetSubordinatesLeavesResponse } from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesResponse'
|
|
|
|
|
import { GetSubordinatesLeavesRequest } from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest';
|
|
|
|
|
import { GetOpenNotificationsResponse } from '../hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
|
|
|
|
|
import { GetSubordinatesAttdStatusResponse } from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse';
|
|
|
|
|
import { GetSubordinatesLeavesResponse } from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesResponse';
|
|
|
|
|
import { AccrualService } from '../accrual-balances/services/accrual.service';
|
|
|
|
|
import { GetDayAndHoursDetailsRequest } from '../time-card/service/models/get-day-hours-type-details.request';
|
|
|
|
|
import * as moment from 'moment';
|
|
|
|
|
@ -125,7 +125,7 @@ export class HomePage implements OnInit {
|
|
|
|
|
public displayTime: any;
|
|
|
|
|
public menuEntries: any;
|
|
|
|
|
public percent: any;
|
|
|
|
|
/////////////////////////////////TIME AND DATE VALUES///////////////////////////////
|
|
|
|
|
///////////////////////////////// TIME AND DATE VALUES///////////////////////////////
|
|
|
|
|
public monthName: any;
|
|
|
|
|
public yearDate: any;
|
|
|
|
|
public selEmp: string;
|
|
|
|
|
@ -138,9 +138,9 @@ public selectedShiftFilter: any;
|
|
|
|
|
public arrDaysAttendance: any = [];
|
|
|
|
|
public arrDaysAbsent: any = [];
|
|
|
|
|
public arrDaysOff: any = [];
|
|
|
|
|
public arrFutrueDays: any =[];
|
|
|
|
|
public arrFutrueDays: any = [];
|
|
|
|
|
|
|
|
|
|
///////////////////////////////END//////////////////////////////////////////////////
|
|
|
|
|
/////////////////////////////// END//////////////////////////////////////////////////
|
|
|
|
|
constructor(
|
|
|
|
|
public ts: TranslatorService,
|
|
|
|
|
public menu: MenuController,
|
|
|
|
|
@ -162,9 +162,9 @@ public arrFutrueDays: any =[];
|
|
|
|
|
private permissions: DevicePermissionsService,
|
|
|
|
|
public DS: DashboredService,
|
|
|
|
|
public accrualService: AccrualService,
|
|
|
|
|
////////////////////////////////////////TIME AND DATE////////////////////////////
|
|
|
|
|
//////////////////////////////////////// TIME AND DATE////////////////////////////
|
|
|
|
|
public timeCardService: TimeCardService
|
|
|
|
|
/////////////////////END/////////////////////////////////////////////////////////
|
|
|
|
|
///////////////////// END/////////////////////////////////////////////////////////
|
|
|
|
|
) {
|
|
|
|
|
this.events.subscribe('img-change', displayImg => {
|
|
|
|
|
this.userImage = this.sanitizer.bypassSecurityTrustUrl('data:Image/*;base64,' + displayImg);
|
|
|
|
|
@ -526,16 +526,19 @@ convertAndAssignTime(data) {
|
|
|
|
|
this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':'));
|
|
|
|
|
this.isCheckedIn = this.remainingTime === this.scheduledTime ? false : true;
|
|
|
|
|
this.initTimer();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showAttendanceTracking() {
|
|
|
|
|
this.DS.getAttendanceTracking().subscribe((result: AttendanceTrackingResponse) => {
|
|
|
|
|
const request = {
|
|
|
|
|
P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER
|
|
|
|
|
};
|
|
|
|
|
this.DS.getAttendanceTracking(request).subscribe((result: AttendanceTrackingResponse) => {
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
const key = 'GetAttendanceTrackingList';
|
|
|
|
|
this.convertAndAssignTime(result[key]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openPeriodDateDashbored() {
|
|
|
|
|
this.DS.getOpenPeriodDates(() => { console.log('Error '); }).subscribe((result: OpenPeriodDatesResponse) => {
|
|
|
|
|
@ -645,7 +648,7 @@ openStatsButton(link: string) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//////calling time and date to load it in calendar///////
|
|
|
|
|
////// calling time and date to load it in calendar///////
|
|
|
|
|
public getDayHoursTypeDetails() {
|
|
|
|
|
const dayAndHoursReqObj = new GetDayAndHoursDetailsRequest();
|
|
|
|
|
this.monthName = moment().format('MMMM');
|
|
|
|
|
@ -693,39 +696,39 @@ openStatsButton(link: string) {
|
|
|
|
|
|
|
|
|
|
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),
|
|
|
|
|
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
|
|
|
|
|
} 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
|
|
|
|
|
} 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",
|
|
|
|
|
isoTime: '09:00:00',
|
|
|
|
|
allDay: false
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
this.arrFutrueDays.push(
|
|
|
|
|
{
|
|
|
|
|
startTime: new Date(allDays[i].SCHEDULE_DATE),
|
|
|
|
|
endTime: new Date(allDays[i].SCHEDULE_DATE),
|
|
|
|
|
isoTime: "09:00:00",
|
|
|
|
|
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');
|
|
|
|
|
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');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|