diff --git a/Mohem/src/app/eit/home/home.component.html b/Mohem/src/app/eit/home/home.component.html index 6e489093..2aedb05f 100644 --- a/Mohem/src/app/eit/home/home.component.html +++ b/Mohem/src/app/eit/home/home.component.html @@ -24,7 +24,7 @@ - + @@ -36,7 +36,7 @@ + *ngIf="menuItem.children && menuItem.MENU_ENTRY_TYPE=='MENU'" slot="end" class="arrow-down"> \ No newline at end of file diff --git a/Mohem/src/app/eit/home/home.component.ts b/Mohem/src/app/eit/home/home.component.ts index 2289313c..68514209 100644 --- a/Mohem/src/app/eit/home/home.component.ts +++ b/Mohem/src/app/eit/home/home.component.ts @@ -29,7 +29,7 @@ export class HomeComponent implements OnInit { openPage(page, index) { // Reset the content nav to have just this page // we wouldn't want the back button to show in this scenario - if (page.children.length == 0 || page.PROMPT == 'Time And Attendance') { + if (page.children.length == 0) { this.goToRequest(page); } else { if (this.selectedMenu == 0) { @@ -55,10 +55,9 @@ export class HomeComponent implements OnInit { if (menuEntry.REQUEST_TYPE =='PAYSLIP'){ this.cs.openPayslipPage(); } - if (menuEntry.PROMPT == 'Time And Attendance'){ + if (menuEntry.REQUEST_TYPE === 'TIME_CARD') { this.cs.openTimeCardPage(); } - } } diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts index e5630281..e418a178 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -1072,7 +1072,7 @@ export class CommonService { this.nav.navigateForward(["/payslip/home"]); } public openTimeCardPage() { - this.nav.navigateForward(["/time-card/home"]); + this.nav.navigateForward(["/time-card/time-card-details"]); } public openEarningsPage() { this.nav.navigateForward(["/payslip/Earnings"]); @@ -1084,6 +1084,10 @@ export class CommonService { this.nav.navigateForward(["/authentication/confirmLogin"]); } + public navigatePage(path) { + this.nav.navigateForward([path]); + } + public reload(url: string, from: string) { console.log("force reload called from:" + from); // window.location.reload(); diff --git a/Mohem/src/app/time-card/home/home.component.html b/Mohem/src/app/time-card/home/home.component.html index aa52c414..f853e899 100644 --- a/Mohem/src/app/time-card/home/home.component.html +++ b/Mohem/src/app/time-card/home/home.component.html @@ -1,23 +1,28 @@ + + + Time and Attendance + -
- +
+ - - - - + + + + - +

{{timeCard.heading}}

{{timeCard.description}}
- + diff --git a/Mohem/src/app/time-card/home/home.component.scss b/Mohem/src/app/time-card/home/home.component.scss index 42dcf08e..1477aa51 100644 --- a/Mohem/src/app/time-card/home/home.component.scss +++ b/Mohem/src/app/time-card/home/home.component.scss @@ -12,7 +12,7 @@ ion-card-content { ion-card { box-shadow: none !important; background-color: white; - margin: 10px 30px; + margin-bottom: 15px; } ion-header { background: #f2f2f3; @@ -22,6 +22,11 @@ ion-title{ font-family: WorkSans-Bold; font-size: 18px; } +.time-card-home-container{ + margin-right: 10px; + margin-left: 10px; + margin-top: 20px +} .header-toolbar-new{ --background: linear-gradient(90deg, rgba(132,198,143,1) 0%, rgba(41,183,197,1) 100%); border-bottom-right-radius: 30px; diff --git a/Mohem/src/app/time-card/home/home.component.ts b/Mohem/src/app/time-card/home/home.component.ts index d6617717..a33764ae 100644 --- a/Mohem/src/app/time-card/home/home.component.ts +++ b/Mohem/src/app/time-card/home/home.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit } from '@angular/core'; -import { NavController } from '@ionic/angular'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; + @Component({ selector: 'app-home', templateUrl: './home.component.html', @@ -34,11 +35,11 @@ export class HomeComponent implements OnInit { } ]; - constructor(public nav: NavController) {} + constructor(public common: CommonService) {} ngOnInit() {} - public openDetailPage() { - this.nav.navigateForward(['/time-card/time-card-details']); + public openDetailPage(path) { + this.common.navigatePage(path); } } diff --git a/Mohem/src/app/time-card/select-period/select-period.component.html b/Mohem/src/app/time-card/select-period/select-period.component.html index 58a4b24f..a3aed0b3 100644 --- a/Mohem/src/app/time-card/select-period/select-period.component.html +++ b/Mohem/src/app/time-card/select-period/select-period.component.html @@ -1,51 +1,61 @@ -

- select-period works! -

-

- select-period works! -

-

- select-period works! -

-

- select-period works! -

-

- select-period works! -

-

- select-period works! -

-

- select-period works! -

-

- select-period works! -

-

- select-period works! -

-

- select-period works! -

+
+ + + +
+ Date From + +
+
+ + +
+ Date To + +
+
+
+
-

- select-period works! -

-

- select-period works! -

-

- select-period works! -

-

- select-period works! -

+
+ + {{filter.name}} + +
+ + + + + Shift type + + + {{shift.SHT_TYPE_DESC}} + + + + + + Search
- diff --git a/Mohem/src/app/time-card/select-period/select-period.component.scss b/Mohem/src/app/time-card/select-period/select-period.component.scss index 6a342b88..038155ad 100644 --- a/Mohem/src/app/time-card/select-period/select-period.component.scss +++ b/Mohem/src/app/time-card/select-period/select-period.component.scss @@ -9,4 +9,22 @@ font-size: 20px; background: white; line-height: 2; + } + .filters-container{ + display: inline-block; + text-align: center; + margin-top: 10px; + } + .filter-tag-button{ + display: inline-block; + border-radius: 5px; + border: 2px solid #A3D077; + color: #606161; + text-align: center; + font-size: 18px; + padding: 5px; + margin: 5px; + } + .filters-container .selected { + background-color: #d4f0e4; } \ No newline at end of file diff --git a/Mohem/src/app/time-card/select-period/select-period.component.ts b/Mohem/src/app/time-card/select-period/select-period.component.ts index effe87d8..f3cafbbc 100644 --- a/Mohem/src/app/time-card/select-period/select-period.component.ts +++ b/Mohem/src/app/time-card/select-period/select-period.component.ts @@ -1,5 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { ModalController } from '@ionic/angular'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { TimeCardService } from 'src/app/time-card/service/time-card.service'; @Component({ selector: 'app-select-period', @@ -7,14 +9,91 @@ import { ModalController } from '@ionic/angular'; styleUrls: ['./select-period.component.scss'], }) export class SelectPeriodComponent implements OnInit { + public shiftTypesArray: any = []; + public selectFromDate: any; + public selectToDate: any; + public selectedShiftType: any; - constructor(public modalController: ModalController) { } + public filtersArray: any = [ + { + name: 'Excess', + active: false, + }, + { + name: 'Timeback', + active: false, + }, + { + name: 'Comp Off', + active: false, + }, + { + name: 'Non scheduled', + active: false, + }, + { + name: 'Late In', + active: false, + }, + { + name: 'Early Out', + active: false, + }, + { + name: 'Shortage', + active: false, + }, + { + name: 'Missing Swipe', + active: false, + }, + { + name: 'Work On Break', + active: false, + }, + { + name: 'Analyzed', + active: false, + }, + { + name: 'Approved Timeback', + active: false, + }, + ]; + constructor( + public modalController: ModalController, + public common: CommonService, + public timeCardService: TimeCardService) { } - ngOnInit() {} + ngOnInit() { + this.getShiftTypes(); + } - public dismiss() { + public dismissModal() { + const selectedFilters: any = []; + for (const filter of this.filtersArray) { + if (filter.active) { + selectedFilters.push(filter); + } + } this.modalController.dismiss({ - dismissed: true + dismissed: true, + selectedFiltersArray: selectedFilters, + selectedShiftType: this.selectedShiftType, + selectFromDate: this.selectFromDate, + selectToDate: this.selectToDate + }); + } + + public changeFiltersSelection(i: any) { + this.filtersArray[i].active = !this.filtersArray[i].active; + } + + public getShiftTypes() { + this.timeCardService.getShiftType().subscribe((result) => { + if (this.common.validResponse(result)) { + this.shiftTypesArray = result.GetShiftTypesList; + } }); } diff --git a/Mohem/src/app/time-card/service/models/get-day-hours-type-details.request.ts b/Mohem/src/app/time-card/service/models/get-day-hours-type-details.request.ts index 987dc09c..240f1b37 100644 --- a/Mohem/src/app/time-card/service/models/get-day-hours-type-details.request.ts +++ b/Mohem/src/app/time-card/service/models/get-day-hours-type-details.request.ts @@ -5,8 +5,8 @@ export class GetDayAndHoursDetailsRequest extends Request { public P_SELECTED_EMPLOYEE_NUMBER: string; public P_MENU_TYPE: string; public P_SELECTED_RESP_ID: number; - public P_SCHEDULE_DATE_FROM: DateTimeInput; - public P_SCHEDULE_DATE_TO: DateTimeInput; + public P_SCHEDULE_DATE_FROM: string; + public P_SCHEDULE_DATE_TO: string; public P_EXCESS_FLAG: string; public P_TIMEBACK_FLAG: string; public P_COMP_OFF_FLAG: string; diff --git a/Mohem/src/app/time-card/service/models/get-swipes-request.ts b/Mohem/src/app/time-card/service/models/get-swipes-request.ts index 006f16e3..b0afbf15 100644 --- a/Mohem/src/app/time-card/service/models/get-swipes-request.ts +++ b/Mohem/src/app/time-card/service/models/get-swipes-request.ts @@ -3,7 +3,7 @@ import { DateTimeInput } from "src/app/uI-elements/date-time.input"; export class GetSwipesRequest extends Request { public P_SELECTED_EMPLOYEE_NUMBER: string; - public P_SCHEDULE_DATE: DateTimeInput; + public P_SCHEDULE_DATE: string; public P_PAGE_NUM: number; public P_PAGE_LIMIT: number; } diff --git a/Mohem/src/app/time-card/service/models/get-time-card-summary.request.ts b/Mohem/src/app/time-card/service/models/get-time-card-summary.request.ts index 7e5036f0..4f845c1e 100644 --- a/Mohem/src/app/time-card/service/models/get-time-card-summary.request.ts +++ b/Mohem/src/app/time-card/service/models/get-time-card-summary.request.ts @@ -5,8 +5,8 @@ export class GetTimeCardSummaryRequest extends Request { public P_SELECTED_EMPLOYEE_NUMBER: string; public P_MENU_TYPE: string; public P_SELECTED_RESP_ID: number; - public P_SCHEDULE_DATE_FROM: DateTimeInput; - public P_SCHEDULE_DATE_TO: DateTimeInput; + public P_SCHEDULE_DATE_FROM: string; + public P_SCHEDULE_DATE_TO: string; public P_EXCESS_FLAG: string; public P_TIMEBACK_FLAG: string; public P_COMP_OFF_FLAG: string; diff --git a/Mohem/src/app/time-card/shift-details/shift-details.component.html b/Mohem/src/app/time-card/shift-details/shift-details.component.html new file mode 100644 index 00000000..8882ea7f --- /dev/null +++ b/Mohem/src/app/time-card/shift-details/shift-details.component.html @@ -0,0 +1,118 @@ + + + + + + Shift Details + + + + +
+ + +

Days

+ + + + Shift type + + + {{shiftData.SHT_TYPE_DESC}} + + + + + Shift + + + {{shiftData.SHT_NAME}} + + + + + Break + + + {{shiftData.BREAK_NAME}} + + + + + Work On Break + + + {{shiftData.ACTUAL_WOB_HRS}} + + + +

Actual Swipe(s)

+
+ + + Start + + + {{shiftData.SHT_ACTUAL_START_TIME}} + + + + + End + + + {{shiftData.SHT_ACTUAL_END_TIME}} + + + +

Approved Swipe(s)

+
+ + + Start + + + {{shiftData.APPROVED_START_TIME}} + + + + + Start Reason + + + {{shiftData.APPROVED_START_REASON_DESC}} + + + + + End + + + {{shiftData.APPROVED_END_TIME}} + + + + + End Reason + + + {{shiftData.APPROVED_END_REASON_DESC}} + + + + + Actual Hours + + + {{shiftData.SHT_ACTUAL_HRS}} + + +
+
+
+
+ +
+ No results Found +
+
\ No newline at end of file diff --git a/Mohem/src/app/time-card/shift-details/shift-details.component.scss b/Mohem/src/app/time-card/shift-details/shift-details.component.scss new file mode 100644 index 00000000..976ada04 --- /dev/null +++ b/Mohem/src/app/time-card/shift-details/shift-details.component.scss @@ -0,0 +1,30 @@ +ion-header{ + overflow: hidden; + background: #f2f2f3; +} +ion-content{ + --ion-background-color: #f2f2f3; +} + +ion-card-content { + padding: 0px; +} + +ion-card { + box-shadow: none !important; + background-color: white; + margin: 10px; +} + +ion-title{ + text-align: center; + font-family: WorkSans-Bold; + font-size: 18px; + margin-right: 45px; +} + +.header-toolbar-new{ + --background: linear-gradient(90deg, rgba(132,198,143,1) 0%, rgba(41,183,197,1) 100%); + border-bottom-right-radius: 30px; + border-bottom-left-radius: 30px; +} diff --git a/Mohem/src/app/time-card/shift-details/shift-details.component.spec.ts b/Mohem/src/app/time-card/shift-details/shift-details.component.spec.ts new file mode 100644 index 00000000..808e6498 --- /dev/null +++ b/Mohem/src/app/time-card/shift-details/shift-details.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ShiftDetailsComponent } from './shift-details.component'; + +describe('ShiftDetailsComponent', () => { + let component: ShiftDetailsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ShiftDetailsComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ShiftDetailsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/time-card/shift-details/shift-details.component.ts b/Mohem/src/app/time-card/shift-details/shift-details.component.ts new file mode 100644 index 00000000..6d5ffb67 --- /dev/null +++ b/Mohem/src/app/time-card/shift-details/shift-details.component.ts @@ -0,0 +1,62 @@ +import { Component, OnInit } from '@angular/core'; +import { TimeCardService } from 'src/app/time-card/service/time-card.service'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; +import { GetShiftDetailRequest } from 'src/app/time-card/service/models/get-shift-detail.request'; +import { GetSwipesRequest } from 'src/app/time-card/service/models/get-swipes-request'; +import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; +import * as moment from 'moment'; + +@Component({ + selector: 'app-shift-details', + templateUrl: './shift-details.component.html', + styleUrls: ['./shift-details.component.scss'], +}) +export class ShiftDetailsComponent implements OnInit { + public selectedShift: any; + public shiftDetailsData: any; + public swipeDetailsData: any; + constructor( + public timeCardService: TimeCardService, + public common: CommonService, + public sharedData: SharedDataService) { } + + ngOnInit() { + this.selectedShift = this.sharedData.getSharedData('selectedShift', false); + console.log(this.selectedShift); + if (this.selectedShift.origin === 'shiftDetails') { + this.getScheduleShiftDetails(); + } else if (this.selectedShift.origin === 'shiftSwipes') { + this.getSwipesDetails(); + } + } + + getScheduleShiftDetails() { + const GetShiftDetailRequestObject = new GetShiftDetailRequest(); + GetShiftDetailRequestObject.P_RTP_ID = this.selectedShift.RTP_ID; + GetShiftDetailRequestObject.P_PAGE_NUM = 1; + GetShiftDetailRequestObject.P_PAGE_LIMIT = 10; + console.log(GetShiftDetailRequestObject); + this.timeCardService.getShiftDetail(GetShiftDetailRequestObject).subscribe((result) => { + if (this.common.validResponse(result)) { + console.log(result); + this.shiftDetailsData = result.GetScheduleShiftsDetailsList; + } + }); + } + + getSwipesDetails() { + const GetSwipesRequestObject = new GetSwipesRequest(); + GetSwipesRequestObject.P_SELECTED_EMPLOYEE_NUMBER = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false); + GetSwipesRequestObject.P_SCHEDULE_DATE = this.common.convertISODateToJsonDate(this.selectedShift.SCHEDULE_DATE); + GetSwipesRequestObject.P_PAGE_NUM = 1; + GetSwipesRequestObject.P_PAGE_LIMIT = 10; + this.timeCardService.getSwipes(GetSwipesRequestObject).subscribe((result) => { + if (this.common.validResponse(result)) { + console.log(result); + // this.swipeDetailsData = result.GetDayHoursTypeDetailsList; + } + }); + } + +} diff --git a/Mohem/src/app/time-card/time-card-details/time-card-details.component.html b/Mohem/src/app/time-card/time-card-details/time-card-details.component.html index 3e2e30f9..cdc6e93c 100644 --- a/Mohem/src/app/time-card/time-card-details/time-card-details.component.html +++ b/Mohem/src/app/time-card/time-card-details/time-card-details.component.html @@ -1,11 +1,13 @@ - - My Time Card - - + + + + + My Time Card + + -
Time Card Summary - + -
- - -

Days

- - - - Period Days - - - 245 - - - - - Schedule Days - - - 156 - - - - - Off days - - - 79 - - - - - Attended Days - - - 163 - - - - - Absent Days - - - 0 - - - - - - Non Schedule Days - - - 0 - - - - - Not Analyzed Days - - - 3 - - - -
-
+
+ + +

Days

+ + + + Period Days + + + {{timeCardSummaryData.PERIOD_DAYS}} + + + + + Schedule Days + + + {{timeCardSummaryData.SCHEDULE_DAYS}} + + + + + Off days + + + {{timeCardSummaryData.OFF_DAYS}} + + + + + Attended Days + + + {{timeCardSummaryData.ATTENDED_DAYS}} + + + + + Absent Days + + + {{timeCardSummaryData.ABSENT_DAYS}} + + + + + Non Schedule Days + + + {{timeCardSummaryData.NON_SCHEDULE_DAYS}} + + + + + Not Analyzed Days + + + {{timeCardSummaryData.NOT_ANALYZED_DAYS}} + + + +
+
- - - - - - Hours - - - Actual - - - Schedule - - - - - Regular - - - 245 - - - 235 - - - - - Planned OT - - - 156 - - - 156 - - - - - On Call - - - 79 - - - 79 - - - - - Excess - - - 10 - - - 10 - - - - - Time Back - - - 163 - - - - - - - Approved Time Back - - - 0 - - - - - - - Time Back Balance - - - 0 - - - - - - - Late In - - - 00:06 - - - - - - - Early Out - - - 00:03 - - - - - - - - - - - - -

Leaves & Holidays

- - - - Half-Day Leave - - - 245 - - - - - Unauthorized Leave - - - 156 - - - - - Business Trip - - - 79 - - - - - Sick Leave - - - 163 - - - - - Paid Leave - - - 0 - - - - - Unpaid Leave - - - 0 - - - - - Puclic Holiday - - - 3 - - - -
-
- -
+ + + + + + Hours + + + Actual + + + Schedule + + + + + Regular + + + {{timeCardSummaryData.ACTUAL_HRS}} + + + {{timeCardSummaryData.SCHEDULED_HRS}} + + + + + Planned OT + + + {{timeCardSummaryData.PLANNED_OTHRS}} + + + {{timeCardSummaryData.SCHEDULED_PLANNED_OT_HRS}} + + + + + On Call + + + {{timeCardSummaryData.ON_CALL_HRS}} + + + {{timeCardSummaryData.SCHEDULED_ON_CALL_HRS}} + + + + + Excess + + + {{timeCardSummaryData.EXCESS_HRS}} + + + + + + + Time Back + + + {{timeCardSummaryData.TIMEBACK_HRS}} + + + + + + + Approved Time Back + + + {{timeCardSummaryData.TIMEBACK_HRS}} + + + + + + + Time Back Balance + + + {{timeCardSummaryData.TIME_BACK_BALANCE}} + + + + + + + Late In + + + {{timeCardSummaryData.LATE_IN_HRS}} + + + + + + + Early Out + + + {{timeCardSummaryData.EARLY_OUT_HRS}} + + + + + + + + + + +

Leaves & Holidays

+ + + + Half-Day Leave + + + {{timeCardSummaryData.HALF_DAY_LEAVE}} + + + + + Unauthorized Leave + + + {{timeCardSummaryData.UNAUTHORIZED_LEAVE}} + + + + + Business Trip + + + {{timeCardSummaryData.BUSINESS_TRIP}} + + + + + Sick Leave + + + {{timeCardSummaryData.SICK_LEAVE}} + + + + + Paid Leave + + + {{timeCardSummaryData.PAID_LEAVE}} + + + + + Unpaid Leave + + + {{timeCardSummaryData.UNPAID_LEAVE}} + + + + + Puclic Holiday + + + {{timeCardSummaryData.PUBLIC_HOLIDAY}} + + + +
+
+
-
+
+ + - +

Today's time card details

- - + - + - + Time Back: - - 03:39 + + {{dayHours.TIMEBACK_HRS}} - + - + Remarks: - - Off Shift + + {{dayHours.REMARKS}} - + - + Shift Hours: - - 09:00 + + {{dayHours.SCHEDULED_HRS}} - + - + Excess Time: - - 00:08 + + {{dayHours.EXCESS_HRS}} - + - + Planned OT: - - 03:00 + + {{dayHours.PLANNED_OT_HRS}} - + - + Late In: - - 00:00 + + {{dayHours.LATE_IN_HRS}} - + - + Early Out: - - 00:00 + + {{dayHours.EARLY_OUT_HRS}}
-
- More Details - -
-
+ + + +
+ + +
+
+
-