From 138f75a9afcd39f9838b42122fef6d197028b34a Mon Sep 17 00:00:00 2001 From: enadhilal Date: Wed, 13 Oct 2021 09:25:24 +0300 Subject: [PATCH] PO Total amount with Tax, baisc info and addres request to show in work list and business card to use local storage --- Mohem/src/app/app.component.ts | 6 ++- .../authentication/sms-page/sms-page.page.ts | 2 - .../service/work-list.main.service.ts | 36 +++++++++++++- .../worklist-main-po.component.html | 2 +- .../worklist-main.component.html | 48 +++++++++++++++++-- .../worklist-main/worklist-main.component.ts | 33 ++++++++++++- 6 files changed, 116 insertions(+), 11 deletions(-) diff --git a/Mohem/src/app/app.component.ts b/Mohem/src/app/app.component.ts index 82c9c5ca..47934fec 100644 --- a/Mohem/src/app/app.component.ts +++ b/Mohem/src/app/app.component.ts @@ -150,7 +150,9 @@ export class AppComponent implements OnInit { const user = this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => { if (user) { console.log(user); - + this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info')); + console.log('ENAD TEST') + console.log(this.userInfo) localStorage.setItem("digitalIDUser", JSON.stringify(user)); this.digitalIDUser = user//JSON.stringify(user); this.companyUrl = user.CompanyImageURL ? user.CompanyImageURL : '../assets/imgs/CSLogo.png'; @@ -287,7 +289,7 @@ export class AppComponent implements OnInit { return await modal.present(); } async openBusinessCard() { - this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info')); + // this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info')); console.log(this.userInfo); //this.userInfo = this.cs.sharedService.getSharedData('bussiness-card-info', false); const modal = await this.modalController.create({ 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 9a3ee766..0bc5507f 100644 --- a/Mohem/src/app/authentication/sms-page/sms-page.page.ts +++ b/Mohem/src/app/authentication/sms-page/sms-page.page.ts @@ -215,8 +215,6 @@ export class SmsPageComponent implements OnInit { // Wifi Credientials CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID; CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password; - console.log('ENAD'); - console.log(JSON.stringify(this.businessInfo)); localStorage.setItem('bussiness-card-info', JSON.stringify(this.businessInfo)); // this.common.sharedService.setSharedData(this.businessInfo,'bussiness-card-info'); diff --git a/Mohem/src/app/notification/service/work-list.main.service.ts b/Mohem/src/app/notification/service/work-list.main.service.ts index dec72b70..a68047d4 100644 --- a/Mohem/src/app/notification/service/work-list.main.service.ts +++ b/Mohem/src/app/notification/service/work-list.main.service.ts @@ -29,6 +29,8 @@ export class WorklistMainService { public static getMONotificationBody = "Services/ERP.svc/REST/GET_MO_NOTIFICATION_BODY"; public static getPRNotificationBody = "Services/ERP.svc/REST/GET_PR_NOTIFICATION_BODY"; public static getICNotificationBody = "Services/ERP.svc/REST/GET_ITEM_CREATION_NTF_BODY"; + public static getBasicDetailNotificationBody = "Services/ERP.svc/REST/GET_BASIC_DET_NTF_BODY"; + public static getAddressNotificationBody = "Services/ERP.svc/REST/GET_ADDRESS_NOTIFICATION_BODY"; public static getPOItemHistory = "Services/ERP.svc/REST/GET_PO_ITEM_HISTORY"; public static getMOItemHistory = "Services/ERP.svc/REST/GET_MO_ITEM_HISTORY"; public static getNotificationButtons = "Services/ERP.svc/REST/GET_NOTIFICATION_BUTTONS"; @@ -107,7 +109,7 @@ export class WorklistMainService { ); } - public getICNotificationBody( + public getBasicDetailNotificationBody( WorkListBodyRequest: any, onError?: any, errorLabel?: string @@ -115,7 +117,22 @@ export class WorklistMainService { const request = WorkListBodyRequest; this.authService.authenticateRequest(request); return this.api.post( - WorklistMainService.getICNotificationBody, + WorklistMainService.getBasicDetailNotificationBody, + request, + onError, + errorLabel + ); + } + + public getAddressNotificationBody( + WorkListBodyRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = WorkListBodyRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getAddressNotificationBody, request, onError, errorLabel @@ -169,6 +186,21 @@ export class WorklistMainService { ); } + public getICNotificationBody( + WorkListBodyRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = WorkListBodyRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getICNotificationBody, + request, + onError, + errorLabel + ); + } + public getQutationAnalysis( qutationAnalysis: any, onError?: any, diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html index 37ba1670..0c4f4e38 100644 --- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html @@ -542,7 +542,7 @@ for="">{{ts.trPK('worklistMain','TotalPOAmountWithVAT')}}
- + diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.html b/Mohem/src/app/notification/worklist-main/worklist-main.component.html index 08aff5a2..4b5e4f0b 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.html +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.html @@ -46,10 +46,10 @@ - + +
- +
@@ -117,6 +117,48 @@ + + + +
+ + +
+ + + +
+ +
+
+
+
+
+
+
+ + + +
+ + +
+ + + +
+ +
+
+
+
+
+
+
diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts index 09c18a12..b95dd404 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts @@ -273,9 +273,28 @@ export class WorklistMainComponent implements OnInit { this.getMONotificationDetails(this.WorkListBodyObj); } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PR") { this.getPRNotificationDetails(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE === 'ADDRESS') { + this.getBasicDetailsNotification(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE === 'BASIC_DETAILS') { + this.getAddressNotification(this.WorkListBodyObj); } } + getBasicDetailsNotification(notificationBodyObj) { + this.worklistMainService + .getBasicDetailNotificationBody(notificationBodyObj) + .subscribe((result: PRNotificatonBodyResponse) => { + this.handleWorkListBodyResult(result, "BASIC_DETAILS"); + }); + } + getAddressNotification(notificationBodyObj) { + this.worklistMainService + .getAddressNotificationBody(notificationBodyObj) + .subscribe((result: PRNotificatonBodyResponse) => { + this.handleWorkListBodyResult(result, "ADDRESS"); + }); + } + getPRNotificationDetails(notificationBodyObj) { this.worklistMainService .getPRNotificationBody(notificationBodyObj) @@ -343,11 +362,23 @@ export class WorklistMainComponent implements OnInit { this.getSubordinatesleave(obj) } - } else if (Type == "PR") { + } else if (Type === "PR") { if (result.GetAbsenceCollectionNotificationBodyList) { this.notificationBodyRes = result.GetAbsenceCollectionNotificationBodyList; } + } else if (Type === "ADDRESS"){ + if (result.GetAddressNotificationBodyList) { + this.notificationBodyRes = + result.GetAddressNotificationBodyList; + console.log(result); + } + } else if (Type === "BASIC_DETAILS"){ + if (result.GetBasicDetNtfBodyList) { + this.notificationBodyRes = + result.GetBasicDetNtfBodyList; + console.log(result); + } } } } //End handleWorkListBodyResult