From 2a1ca91daace32c99c5a847a3fad81fcf567f71b Mon Sep 17 00:00:00 2001 From: Mohamed Mekawy Date: Mon, 9 Dec 2019 10:59:49 +0300 Subject: [PATCH] OpenPayslip from dashboard --- Mohem/package.json | 2 +- .../confirm-login/confirm-login.component.ts | 24 ++++---- .../sms-page/sms-page.page.html | 4 +- .../authentication/sms-page/sms-page.page.ts | 2 +- .../services/connector/connector.service.ts | 4 +- Mohem/src/app/hmg-common/ui/sms/sms.page.html | 4 +- Mohem/src/app/home/home.page.html | 2 +- Mohem/src/app/home/home.page.ts | 2 - .../app/notification/home/home.component.ts | 11 +++- Mohem/src/app/payslip/home/home.component.ts | 57 ++++++++++++------- .../app/payslip/service/payslip.service.ts | 6 +- 11 files changed, 70 insertions(+), 48 deletions(-) diff --git a/Mohem/package.json b/Mohem/package.json index a229f9f8..e048f67e 100755 --- a/Mohem/package.json +++ b/Mohem/package.json @@ -37,7 +37,7 @@ "@ionic-native/diagnostic": "^5.17.0", "@ionic-native/file": "^5.17.0", "@ionic-native/file-path": "^5.17.0", - "@ionic-native/fingerprint-aio": "^5.16.0", + "@ionic-native/fingerprint-aio": "^5.17.1", "@ionic-native/geolocation": "^5.10.0", "@ionic-native/globalization": "^5.17.0", "@ionic-native/health": "^5.4.0", diff --git a/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts b/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts index 673eb4a5..cd4cca35 100644 --- a/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts +++ b/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts @@ -568,31 +568,31 @@ export class ConfirmLoginComponent implements OnInit { - // title: 'Biometric Authetnciation', // (Android Only) | optional | Default: " Biometric Sign On" + title: 'Biometric Authetnciation', // (Android Only) | optional | Default: " Biometric Sign On" - // // subtitle: 'Coolest Plugin ever' ,// (Android Only) | optional | Default: null + subtitle: 'Coolest Plugin ever' ,// (Android Only) | optional | Default: null - // // description: this.ts.trPK("general", "auth-please"),// optional | Default: null + description: this.ts.trPK("general", "auth-please"),// optional | Default: null - // fallbackButtonTitle: this.ts.trPK("general", "use-pin"), // optional | When disableBackup is false defaults to "Use Pin". + fallbackButtonTitle: this.ts.trPK("general", "use-pin"), // optional | When disableBackup is false defaults to "Use Pin". - // // When disableBackup is true defaults to "Cancel" + // When disableBackup is true defaults to "Cancel" - // disableBackup:true, // optional | default: false + disableBackup:true, // optional | default: false - clientId: "Fingerprint Authetnciation", + // clientId: "Fingerprint Authetnciation", - clientSecret: "Ate343_9347lajF", // Only necessary for Android + // clientSecret: "Ate343_9347lajF", // Only necessary for Android - disableBackup: true, // Only for Android(optional) + // disableBackup: true, // Only for Android(optional) - localizedFallbackTitle: this.ts.trPK("general", "use-pin"), // Only for iOS + // localizedFallbackTitle: this.ts.trPK("general", "use-pin"), // Only for iOS - localizedReason: this.ts.trPK("general", "auth-please") // Only for iOS + // localizedReason: this.ts.trPK("general", "auth-please") // Only for iOS }) @@ -712,7 +712,7 @@ export class ConfirmLoginComponent implements OnInit { this.authService.setAuthenticatedUser(result).subscribe(() => { - if (this.platform.is("mobile")) { + if (this.platform.is("cordova")) { this.insertMobileLogin(); diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.html b/Mohem/src/app/authentication/sms-page/sms-page.page.html index a26b8d07..5eca319e 100644 --- a/Mohem/src/app/authentication/sms-page/sms-page.page.html +++ b/Mohem/src/app/authentication/sms-page/sms-page.page.html @@ -26,9 +26,9 @@

{{displayTime}}



- {{'verificationcode,verificationcode' | translate}} + - + diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.ts b/Mohem/src/app/authentication/sms-page/sms-page.page.ts index 2172f349..825f64fd 100644 --- a/Mohem/src/app/authentication/sms-page/sms-page.page.ts +++ b/Mohem/src/app/authentication/sms-page/sms-page.page.ts @@ -339,7 +339,7 @@ export class SmsPageComponent implements OnInit { - if (this.platform.is("mobile")) { + if (this.platform.is("cordova")) { this.insertMobileLogin(); diff --git a/Mohem/src/app/hmg-common/services/connector/connector.service.ts b/Mohem/src/app/hmg-common/services/connector/connector.service.ts index 958d91c0..1cecff37 100644 --- a/Mohem/src/app/hmg-common/services/connector/connector.service.ts +++ b/Mohem/src/app/hmg-common/services/connector/connector.service.ts @@ -24,8 +24,8 @@ export class ConnectorService { public static timeOut = 30 * 1000; // public static host = 'http://10.50.100.113:6060/'; // development service - public static host = "https://uat.hmgwebservices.com/"; - //public static host = 'https://hmgwebservices.com/'; + public static host = "https://uat.hmgwebservices.com/"; + // public static host = 'https://hmgwebservices.com/'; // public static host = 'http://10.50.100.198:6060/'; // public static host = 'http://10.50.100.113:6060/'; // development service /* public static host = 'http://10.50.100.198:6060/'; diff --git a/Mohem/src/app/hmg-common/ui/sms/sms.page.html b/Mohem/src/app/hmg-common/ui/sms/sms.page.html index c49cc795..a783455d 100644 --- a/Mohem/src/app/hmg-common/ui/sms/sms.page.html +++ b/Mohem/src/app/hmg-common/ui/sms/sms.page.html @@ -23,9 +23,9 @@

{{displayTime}}



- {{'verificationcode.verificationcode' | translate}} + - + diff --git a/Mohem/src/app/home/home.page.html b/Mohem/src/app/home/home.page.html index 7be21549..b72be1d4 100644 --- a/Mohem/src/app/home/home.page.html +++ b/Mohem/src/app/home/home.page.html @@ -78,7 +78,7 @@ - diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index cb09b009..c4f01a48 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -306,8 +306,6 @@ export class HomePage implements OnInit { this.common.openChangePassword(); } private openPayslip() { - - this.common.openPayslipPage(); } private attendance() { diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index ae011cbf..0832c437 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -234,9 +234,16 @@ export class HomeComponent implements OnInit { } } for (let i = 0; i < this.WorkListResObj.length; i++) { - if (reqType == this.WorkListResObj[i].REQUEST_TYPE) { - filterdType.push(this.WorkListResObj[i]); + if(reqType=="HR"){ + if ("EIT" == this.WorkListResObj[i].REQUEST_TYPE || "ABSENCE" == this.WorkListResObj[i].REQUEST_TYPE) { + filterdType.push(this.WorkListResObj[i]); + } + }else{ + if (reqType == this.WorkListResObj[i].REQUEST_TYPE) { + filterdType.push(this.WorkListResObj[i]); + } } + } this.filteredNotificationList = filterdType; diff --git a/Mohem/src/app/payslip/home/home.component.ts b/Mohem/src/app/payslip/home/home.component.ts index 2c11be94..769e7f6c 100644 --- a/Mohem/src/app/payslip/home/home.component.ts +++ b/Mohem/src/app/payslip/home/home.component.ts @@ -4,6 +4,7 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; + @Component({ selector: 'app-home', templateUrl: './home.component.html', @@ -25,38 +26,52 @@ export class HomeComponent implements OnInit { public ts: TranslatorService, public common: CommonService, public sharedData: SharedDataService, + public authService: AuthenticationService ) {} ngOnInit() { - console.log("test"); - - this.selEmp = this.common.sharedService.getSharedData( - MenuResponse.SHARED_SEL_EMP, - false - ); - console.log(" this.selEmp" + this.selEmp); - this.respID = this.common.sharedService.getSharedData( - MenuResponse.SHARED_SEL_RESP_ID, - false - ); - console.log(" this.respID" + this.respID); - - this.selMenu = new MenuResponse(); - this.selMenu = this.common.sharedService.getSharedData( - MenuResponse.SHARED_DATA, - false - ); - console.log(" this.selMenu" + this.selMenu); + // this.selEmp = this.common.sharedService.getSharedData( + // MenuResponse.SHARED_SEL_EMP, + // false + // ); + // if(this.selEmp){}else{ + // this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => { + // if (user) { + // this.selEmp = user.ASSIGNMENT_NUMBER; + + // } + // }); + // } + + // console.log(" this.selEmp" + this.selEmp); + // this.respID = this.common.sharedService.getSharedData( + // MenuResponse.SHARED_SEL_RESP_ID, + // false + // ); + // if(this.respID){}else{ + // this.respID=-999; + // } + // console.log(" this.respID" + this.respID); + + // this.selMenu = new MenuResponse(); + // this.selMenu = this.common.sharedService.getSharedData( + // MenuResponse.SHARED_DATA, + // false + // ); + // console.log(" this.selMenu" + this.selMenu); this.getPayslip(); } getPayslip(){ + // this.selEmp ="13777"; + console.log("this.selEmp????????"+this.selEmp) + this.respID=-999; const request = { P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,//'125346',//this.selEmp, - P_MENU_TYPE: this.selMenu.List_Menu.MENU_TYPE,// 'E',//this.selMenu.List_Menu.MENU_TYPE, - P_SELECTED_RESP_ID:this.respID//"-999" //this.respID, + P_MENU_TYPE:"E",// 'E',//this.selMenu.List_Menu.MENU_TYPE, + P_SELECTED_RESP_ID: this.respID//"-999" //this.respID, // P_PAGE_NUM: this.P_PAGE_NUM, // P_PAGE_LIMIT: this.P_PAGE_LIMIT }; diff --git a/Mohem/src/app/payslip/service/payslip.service.ts b/Mohem/src/app/payslip/service/payslip.service.ts index 0ef5274f..847438a3 100644 --- a/Mohem/src/app/payslip/service/payslip.service.ts +++ b/Mohem/src/app/payslip/service/payslip.service.ts @@ -3,6 +3,7 @@ import { ConnectorService } from '../../hmg-common/services/connector/connector. import { AuthenticationService } from '../../hmg-common/services/authentication/authentication.service'; import { Observable } from 'node_modules/@angular/cli/node_modules/rxjs'; + @Injectable({ providedIn: 'root' }) @@ -19,10 +20,11 @@ export class PayslipService { ) { } -public getPayslip(PayslipRequest: any, onError?: any,errorLabel?: string): Observable { +public getPayslip(PayslipRequest: any , onError?: any,errorLabel?: string): Observable { const request = PayslipRequest; this.authService.authenticateRequest(request); - return this.api.post(PayslipService.getPayslip,request,onError,errorLabel); + request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; + return this.api.post(PayslipService.getPayslip, request, onError, errorLabel); } public getSummeryOFPayment(PayslipRequest: any, onError?: any,errorLabel?: string): Observable { const request = PayslipRequest;