From 17246a58b86b786fdd6219285307d92ca01c9fb1 Mon Sep 17 00:00:00 2001 From: Mohamed Mekawy Date: Thu, 24 Oct 2019 11:06:34 +0300 Subject: [PATCH] add PO & MO & PR --- Mohem/config.xml | 6 +- Mohem/src/app/app.component.ts | 4 +- .../authentication/login/login.component.html | 2 +- .../sms-page/sms-page.page.html | 2 +- .../src/app/eit/add-eit/add-eit.component.ts | 2 +- .../authentication/authentication.service.ts | 8 +- .../services/common/common.service.ts | 14 +- .../services/connector/connector.service.ts | 265 ++++++++++-------- Mohem/src/app/hmg-common/ui/sms/sms.page.html | 2 +- Mohem/src/app/home/home.page.ts | 12 +- .../my-team/details/details.component.html | 4 +- .../app/my-team/details/details.component.ts | 2 +- Mohem/src/app/my-team/my-team.module.ts | 4 + .../notification/models/MOItemHistoryList.ts | 26 ++ .../notification/models/MOItemHistoryReq.ts | 9 + .../notification/models/MOItemHistoryRes.ts | 7 + .../models/MONotificationBodyItems.ts | 25 ++ .../models/MONotificationBodyRes.ts | 8 + .../models/NotificationBodyReq.ts | 15 +- .../notification/models/POItemHistoryList.ts | 24 ++ .../notification/models/POItemHistoryReq.ts | 8 + .../notification/models/POItemHistoryRes.ts | 6 + .../models/PONotificationBodyList.ts | 8 + .../models/PONotificationBodyRes.ts | 8 + .../models/PRHeaderNotificationBodyItems.ts | 4 + .../models/PRLinesNotificationBodyItems.ts | 15 + .../models/PRNotificationBodyList.ts | 9 + .../models/PRNotificationBodyRes.ts | 8 + .../models/PoHeaderNotificationBodyItems.ts | 25 ++ .../models/PoLinesNotificationBodyItems.ts | 14 + .../models/quotationAnalysisList.ts | 22 ++ .../models/quotationAnalysisReq.ts | 8 + .../models/quotationAnalysisRes.ts | 6 + .../service/work-list.main.service.ts | 89 ++++++ .../worklist-main/worklist-main.component.ts | 36 +++ .../.~lock.ESS API Integration V 0 34.doc# | 1 - 36 files changed, 559 insertions(+), 149 deletions(-) create mode 100644 Mohem/src/app/notification/models/MOItemHistoryList.ts create mode 100644 Mohem/src/app/notification/models/MOItemHistoryReq.ts create mode 100644 Mohem/src/app/notification/models/MOItemHistoryRes.ts create mode 100644 Mohem/src/app/notification/models/MONotificationBodyItems.ts create mode 100644 Mohem/src/app/notification/models/MONotificationBodyRes.ts create mode 100644 Mohem/src/app/notification/models/POItemHistoryList.ts create mode 100644 Mohem/src/app/notification/models/POItemHistoryReq.ts create mode 100644 Mohem/src/app/notification/models/POItemHistoryRes.ts create mode 100644 Mohem/src/app/notification/models/PONotificationBodyList.ts create mode 100644 Mohem/src/app/notification/models/PONotificationBodyRes.ts create mode 100644 Mohem/src/app/notification/models/PRHeaderNotificationBodyItems.ts create mode 100644 Mohem/src/app/notification/models/PRLinesNotificationBodyItems.ts create mode 100644 Mohem/src/app/notification/models/PRNotificationBodyList.ts create mode 100644 Mohem/src/app/notification/models/PRNotificationBodyRes.ts create mode 100644 Mohem/src/app/notification/models/PoHeaderNotificationBodyItems.ts create mode 100644 Mohem/src/app/notification/models/PoLinesNotificationBodyItems.ts create mode 100644 Mohem/src/app/notification/models/quotationAnalysisList.ts create mode 100644 Mohem/src/app/notification/models/quotationAnalysisReq.ts create mode 100644 Mohem/src/app/notification/models/quotationAnalysisRes.ts delete mode 100644 app document/phase 2 documents/.~lock.ESS API Integration V 0 34.doc# diff --git a/Mohem/config.xml b/Mohem/config.xml index 82930842..1c41295e 100644 --- a/Mohem/config.xml +++ b/Mohem/config.xml @@ -1,8 +1,8 @@ - - Al Habib MOHEMM + + MOHEMM an app created by cloud Solutions - HMG + HMG diff --git a/Mohem/src/app/app.component.ts b/Mohem/src/app/app.component.ts index 1ace6518..9040df11 100644 --- a/Mohem/src/app/app.component.ts +++ b/Mohem/src/app/app.component.ts @@ -24,7 +24,7 @@ export class AppComponent implements OnInit, AfterViewInit { user_image: string = "../assets/imgs/profile.png"; menuSide: string = "left"; notBadge: number; - companyUrl: string = "../assets/imgs/HMG.png"; + companyUrl: string = "../assets/imgs/CS.png"; companyDesc: string = "Powered By Cloud Solutions"; public direction = "ltr"; constructor( @@ -63,7 +63,7 @@ export class AppComponent implements OnInit, AfterViewInit { if (user) { this.companyUrl = user.CompanyImageURL ? user.CompanyImageURL - : "../assets/imgs/HMG.png"; + : "../assets/imgs/CS.png"; this.companyDesc = user.CompanyImageDescription ? user.CompanyImageDescription diff --git a/Mohem/src/app/authentication/login/login.component.html b/Mohem/src/app/authentication/login/login.component.html index 3fbb2177..e83cb05d 100644 --- a/Mohem/src/app/authentication/login/login.component.html +++ b/Mohem/src/app/authentication/login/login.component.html @@ -2,7 +2,7 @@ - + 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 6e7bb360..a26b8d07 100644 --- a/Mohem/src/app/authentication/sms-page/sms-page.page.html +++ b/Mohem/src/app/authentication/sms-page/sms-page.page.html @@ -11,7 +11,7 @@ - + diff --git a/Mohem/src/app/eit/add-eit/add-eit.component.ts b/Mohem/src/app/eit/add-eit/add-eit.component.ts index 94b724e0..aae9420a 100644 --- a/Mohem/src/app/eit/add-eit/add-eit.component.ts +++ b/Mohem/src/app/eit/add-eit/add-eit.component.ts @@ -520,7 +520,7 @@ export class AddEitComponent implements OnInit { } else { console.log('else - ' + elem.value); elem.value = val; - elem.innerText = val; + elem.innerText = text; elem.setAttribute('value', val); console.log('else - ' + elem.value); } diff --git a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts index ccebfc03..f5008881 100644 --- a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts +++ b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts @@ -115,8 +115,8 @@ export class AuthenticationService { } public setPublicFields(request: Request): Request { - request.VersionID = 1.3; - request.Channel = 33; + request.VersionID = 1.4; + request.Channel = 31; request.LanguageID = TranslatorService.getCurrentLanguageCode(); //request.IPAdress = '10.10.10.10'; //request.SessionID = "any thing"; // ??? required for not authorized login funny @@ -193,7 +193,7 @@ export class AuthenticationService { public login(request: LoginRequest, onError: any, errorLabel: string): Observable { this.setPublicFields(request); - request.P_APP_VERSION="HMG"; + request.P_APP_VERSION="CS"; return this.con.post(AuthenticationService.login, request, onError, errorLabel); } @@ -448,7 +448,7 @@ export class AuthenticationService { public checkUserAuthentication(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string) : Observable { this.setPublicFields(request); - request.P_APP_VERSION="HMG"; + request.P_APP_VERSION="CS"; return this.con.post(AuthenticationService.userChecking, request, onError, errorLabel); } 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 9a4e3ad6..6f917c85 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -102,10 +102,11 @@ export class CommonService { public back() { // this.nav.pop(); - this.nav.back({ - animated: true, - animationDirection: "back" - }); + // this.nav.back({ + // animated: true, + // animationDirection: "back" + // }); + this.nav.pop(); } public round(value: number, decimal: number): string { @@ -949,8 +950,10 @@ export class CommonService { public openMyTeamPage() { this.nav.navigateForward(["/my-team/home"]); } + public static myTeamDetailUrl =["/my-team/details","/my-team/details-2"] public openMyTeamDetails() { - this.nav.navigateForward(["/my-team/details"]); + this.alternateNavigate(CommonService.myTeamDetailUrl,"teamDetail-open",true); + // this.nav.navigateForward(["/my-team/details"]); } public openAbsencePage() { this.nav.navigateForward(["/absence/home"]); @@ -1020,6 +1023,7 @@ export class CommonService { this.nav.navigateBack([url]); } + private alternateNavigate(paths: string[], key: string, root = false) { let url: string; if (localStorage.getItem(key) === "yes") { 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 20e69db6..78b4f46e 100644 --- a/Mohem/src/app/hmg-common/services/connector/connector.service.ts +++ b/Mohem/src/app/hmg-common/services/connector/connector.service.ts @@ -1,101 +1,126 @@ -import { Injectable } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpErrorResponse } from '@angular/common/http'; -import { Observable, throwError, TimeoutError } from 'rxjs'; -import { catchError, retry, tap, timeout } from 'rxjs/operators'; -import { CommonService } from '../common/common.service'; -import { Response } from '../models/response'; +import { Injectable } from "@angular/core"; +import { + HttpClient, + HttpHeaders, + HttpErrorResponse +} from "@angular/common/http"; +import { Observable, throwError, TimeoutError } from "rxjs"; +import { catchError, retry, tap, timeout } from "rxjs/operators"; +import { CommonService } from "../common/common.service"; +import { Response } from "../models/response"; @Injectable({ - providedIn: 'root' + providedIn: "root" }) export class ConnectorService { - /* + /* connection configuration settings */ - static httpOptions = { - headers: new HttpHeaders({ 'Content-Type': 'application/json' }) - }; - public static retryTimes = 0; - public static timeOut = 30 * 1000; -// public static host = 'http://10.50.100.113:6060/'; // development service - - // public static host = 'https://uat.hmgwebservices.com/'; + static httpOptions = { + headers: new HttpHeaders({ "Content-Type": "application/json" }) + }; + public static retryTimes = 0; + 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 = '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/'; + // 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/'; public static host = 'http://10.50.100.198:6060/'; // development service public static host = 'http://10.50.100.198:4040/'; // UAT service public static host = 'http://10.50.100.198:4444/'; // production service public static host = 'http://10.50.100.113:4040/'; // UAT service public static host = 'http://10.50.100.113:4444/'; // production service */ - /* + /* end of connection configuration */ - constructor( - public httpClient: HttpClient, - public cs: CommonService - - ) { } - - - public post(service: string, data: any, onError: any, errorLabel?: string): Observable { + constructor(public httpClient: HttpClient, public cs: CommonService) {} - this.cs.startLoading(); - return this.httpClient.post(ConnectorService.host + service, data, ConnectorService.httpOptions) - .pipe( - timeout(ConnectorService.timeOut), - retry(ConnectorService.retryTimes), - tap( - res => this.handleResponse(res, onError, errorLabel), - error => this.handleError(error, onError, errorLabel) - ) - ); - } + public post( + service: string, + data: any, + onError: any, + errorLabel?: string + ): Observable { + this.cs.startLoading(); + return this.httpClient + .post( + ConnectorService.host + service, + data, + ConnectorService.httpOptions + ) + .pipe( + timeout(ConnectorService.timeOut), + retry(ConnectorService.retryTimes), + tap( + res => this.handleResponse(res, onError, errorLabel), + error => this.handleError(error, onError, errorLabel) + ) + ); + } - public postNoLoad(service: string, data: any, onError: any): Observable { - return this.httpClient.post(ConnectorService.host + service, data, ConnectorService.httpOptions) - .pipe( - retry(ConnectorService.retryTimes), - tap(() => { }, () => { }) - ); - } + public postNoLoad(service: string, data: any, onError: any): Observable { + return this.httpClient + .post( + ConnectorService.host + service, + data, + ConnectorService.httpOptions + ) + .pipe( + retry(ConnectorService.retryTimes), + tap(() => {}, () => {}) + ); + } - // absolute url connection - public postToken(service: string, data: any, onError: any, errorLabel?: string): Observable { - this.cs.startLoading(); - return this.httpClient.post(service, data, ConnectorService.httpOptions) - .pipe( - timeout(ConnectorService.timeOut), - retry(ConnectorService.retryTimes), - tap(res => this.handleResponse(res, onError, errorLabel), - error => this.handleError(error, onError, errorLabel) - ) - ); - } + // absolute url connection + public postToken( + service: string, + data: any, + onError: any, + errorLabel?: string + ): Observable { + this.cs.startLoading(); + return this.httpClient + .post(service, data, ConnectorService.httpOptions) + .pipe( + timeout(ConnectorService.timeOut), + retry(ConnectorService.retryTimes), + tap( + res => this.handleResponse(res, onError, errorLabel), + error => this.handleError(error, onError, errorLabel) + ) + ); + } - public get(service: string, data: any, onError: any, errorLabel?: string): Observable { - this.cs.startLoading(); - return this.httpClient.get(service, ConnectorService.httpOptions) - .pipe( - timeout(ConnectorService.timeOut), - retry(ConnectorService.retryTimes), - tap(res => this.handleResponse(res, onError, errorLabel), - error => this.handleError(error, onError, errorLabel) - ) - ); - } - /* + public get( + service: string, + data: any, + onError: any, + errorLabel?: string + ): Observable { + this.cs.startLoading(); + return this.httpClient.get(service, ConnectorService.httpOptions).pipe( + timeout(ConnectorService.timeOut), + retry(ConnectorService.retryTimes), + tap( + res => this.handleResponse(res, onError, errorLabel), + error => this.handleError(error, onError, errorLabel) + ) + ); + } + /* load local json data and convert it to corresponding model resourceURL such as 'assets/config.json' */ - public getLocalResrouce(resourceURL: string): Observable { - return this.httpClient.get(resourceURL); - } + public getLocalResrouce(resourceURL: string): Observable { + return this.httpClient.get(resourceURL); + } - /* + /* public validResponse(result: Response): boolean { // error type == 2 means you have error if (result.MessageStatus === 1) { @@ -107,51 +132,57 @@ export class ConnectorService { } */ - public handleError(error: any, onError: any, errorLabel: string) { - this.cs.stopLoading(); - if (error instanceof TimeoutError) { - this.cs.showConnectionTimeout(onError, errorLabel); - } else { - this.cs.showConnectionErrorDialog(onError, errorLabel); - } + public handleError(error: any, onError: any, errorLabel: string) { + this.cs.stopLoading(); + if (error instanceof TimeoutError) { + this.cs.showConnectionTimeout(onError, errorLabel); + } else { + this.cs.showConnectionErrorDialog(onError, errorLabel); } + } - public handleResponse(result: Response, onError: any, errorLabel: string) { - this.cs.stopLoading(); - if (!this.cs.validResponse(result)) { - // not authorized - console.log(result.MessageStatus); - console.log("erroe") - if(result.IsAuthenticated==false){ - this.cs.presentAcceptDialog(result.ErrorEndUserMessage,()=>{ - this.cs.sharedService.clearAll(); - this.cs.openLogin(); - }); - return false; - } - else if (result.ErrorType === 2||result.ErrorType === 4) { - //console.log("error expired"); - } else { - this.cs.showErrorMessageDialog(onError, errorLabel, result.ErrorEndUserMessage); - } - } + public handleResponse(result: Response, onError: any, errorLabel: string) { + this.cs.stopLoading(); + if (!this.cs.validResponse(result)) { + // not authorized + console.log(result.MessageStatus); + console.log("erroe"); + if (result.IsAuthenticated == false) { + this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => { + this.cs.sharedService.clearAll(); + this.cs.openLogin(); + }); + return false; + } else if (result.ErrorType === 2 || result.ErrorType === 4) { + //console.log("error expired"); + } else { + this.cs.showErrorMessageDialog( + onError, + errorLabel, + result.ErrorEndUserMessage + ); + } } + } - - public getURLText(url: string, onError: any, errorLabel?: string): Observable { - this.cs.startLoading(); - return this.httpClient.get(url) - .pipe( - timeout(ConnectorService.timeOut), - retry(ConnectorService.retryTimes), - tap(res => { - this.cs.stopLoading(); - if (!res) { - this.cs.showConnectionErrorDialog(onError, errorLabel); - } - }, - error => this.handleError(error, onError, errorLabel) - ) - ); - } + public getURLText( + url: string, + onError: any, + errorLabel?: string + ): Observable { + this.cs.startLoading(); + return this.httpClient.get(url).pipe( + timeout(ConnectorService.timeOut), + retry(ConnectorService.retryTimes), + tap( + res => { + this.cs.stopLoading(); + if (!res) { + this.cs.showConnectionErrorDialog(onError, errorLabel); + } + }, + error => this.handleError(error, onError, errorLabel) + ) + ); + } } 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 7560b6a0..c49cc795 100644 --- a/Mohem/src/app/hmg-common/ui/sms/sms.page.html +++ b/Mohem/src/app/hmg-common/ui/sms/sms.page.html @@ -8,7 +8,7 @@ - + diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index cfc620d2..d6ea2479 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -63,15 +63,21 @@ export class HomePage implements OnInit { getDeviceLocation() { - //console.log("mekaaaaaaaaaaaaa?????????"); + let isVirtual = this.device.isVirtual; + if(isVirtual==true){ + alert("emulater>>>>>>>"+isVirtual); + alert("You are using virtual device"); + return false; + } + this.permissions.requestLocationAutherization().then(granted => { this.location = granted as boolean; if (this.location) { this.geolocation .getCurrentPosition({ maximumAge: 3000, timeout: 10000, enableHighAccuracy: true }) .then(resp => { - console.log(resp.coords.latitude); - console.log(resp.coords.longitude); + // console.log(resp.coords.latitude); + // console.log(resp.coords.longitude); this.lat = resp.coords.latitude; this.longt = resp.coords.longitude; this.attendance(); diff --git a/Mohem/src/app/my-team/details/details.component.html b/Mohem/src/app/my-team/details/details.component.html index 0d7d2ea5..d15c22b6 100644 --- a/Mohem/src/app/my-team/details/details.component.html +++ b/Mohem/src/app/my-team/details/details.component.html @@ -6,11 +6,11 @@ {{headerTitle}} - + diff --git a/Mohem/src/app/my-team/details/details.component.ts b/Mohem/src/app/my-team/details/details.component.ts index 391c5377..e3c92fa9 100644 --- a/Mohem/src/app/my-team/details/details.component.ts +++ b/Mohem/src/app/my-team/details/details.component.ts @@ -84,7 +84,7 @@ export class DetailsComponent implements OnInit { goback() { //this.location.back(); const user = this.authService.getAuthenticatedUser(); - if(this.employee.SUPERVISOR_NUMBER==user.EMPLOYEE_NUMBER){ + if(this.employee.SUPERVISOR_NUMBER==user.EMPLOYEE_NUMBER || this.opendEmployees.length == 1){ this.opendEmployees=[]; this.common.openMyTeamPage(); }else{ diff --git a/Mohem/src/app/my-team/my-team.module.ts b/Mohem/src/app/my-team/my-team.module.ts index 96084068..784d9bbb 100644 --- a/Mohem/src/app/my-team/my-team.module.ts +++ b/Mohem/src/app/my-team/my-team.module.ts @@ -20,6 +20,10 @@ const routes: Routes = [ { path: 'details', component: DetailsComponent + }, + { + path: 'details-2', + component: DetailsComponent } ] } diff --git a/Mohem/src/app/notification/models/MOItemHistoryList.ts b/Mohem/src/app/notification/models/MOItemHistoryList.ts new file mode 100644 index 00000000..baec25ae --- /dev/null +++ b/Mohem/src/app/notification/models/MOItemHistoryList.ts @@ -0,0 +1,26 @@ +import { Response } from "./response"; + +export class GetMoItemHistoryList extends Response { + public REQUEST_NUMBER: string; + public ITEM_CODE: string; + public DESCRIPTION: string; + public UNIT_OF_MEASURE: string; + public QUANTITY: number; + public DATE_REQUIRED: Date; + public LINE_STATUS_DIS: string; + public STATUS_DATE: Date; + public TRANSACTION_TYPE_NAME: string; + public ORGANIZATION_ID: number; + public ORGANIZATION_CODE: string; + public ORGANIZATION_NAME: string; + public OPERATING_UNIT_NAM: string; + public FROM_SUBINVENTORY_CODE: string; + public FROM_LOCATOR: string; + public TO_SUBINVENTORY_CODE: string; + public TO_LOCATOR: string; + public SHIP_TO_LOCATION: string; + public ROW_NUM: number; + public NO_OF_ROWS: number; + public FROM_ROW_NUM: number; + public TO_ROW_NUM: number; +} diff --git a/Mohem/src/app/notification/models/MOItemHistoryReq.ts b/Mohem/src/app/notification/models/MOItemHistoryReq.ts new file mode 100644 index 00000000..33bb64d5 --- /dev/null +++ b/Mohem/src/app/notification/models/MOItemHistoryReq.ts @@ -0,0 +1,9 @@ +import { Request } from "./request"; + +export class MOItemHistoryReq extends Request { + //public static SHARED_DATA = ''; + public P_ORG_ID: number; + public P_ITEM_ID: number; + public P_PAGE_NUM: number; + public P_PAGE_LIMIT: number; +} diff --git a/Mohem/src/app/notification/models/MOItemHistoryRes.ts b/Mohem/src/app/notification/models/MOItemHistoryRes.ts new file mode 100644 index 00000000..e1de9002 --- /dev/null +++ b/Mohem/src/app/notification/models/MOItemHistoryRes.ts @@ -0,0 +1,7 @@ +import { Response } from "./response"; +import { GetMoItemHistoryList } from './MOItemHistoryList'; + +export class MOItemHistoryRes extends Response { + public GetMoItemHistoryList: GetMoItemHistoryList; + +} diff --git a/Mohem/src/app/notification/models/MONotificationBodyItems.ts b/Mohem/src/app/notification/models/MONotificationBodyItems.ts new file mode 100644 index 00000000..65f02817 --- /dev/null +++ b/Mohem/src/app/notification/models/MONotificationBodyItems.ts @@ -0,0 +1,25 @@ +export class MONotificationBodyItems { + public LINE_NUMBER: number; + public ITEM_CODE: string; + public DESCRIPTION: string; + public UOM: string; + public QUANTITY: number; + public DATE_REQUIRED: Date; + public LINE_STATUS: string; + public TATUS_DATE: Date; + public TRANSACTION_TYPE_NAME: string; + public OPERATING_UNIT: string; + public ORGANIZATION_CODE: string; + public ORGANIZATION_NAME: string; + public FROM_SUBINVENTORY: string; + public TO_SUBINVENTORY: string; + public FROM_LOCATOR: string; + public TO_LOCATOR: string; + public SHIP_TO_LOCATION: string; + public NO_OF_ROWS: number; + public ROW_NUM: number; + public FROM_ROW_NUM: number; + public TO_ROW_NUM: number; + public ITEM_ID: number; + public ORG_ID: number; +} diff --git a/Mohem/src/app/notification/models/MONotificationBodyRes.ts b/Mohem/src/app/notification/models/MONotificationBodyRes.ts new file mode 100644 index 00000000..39e9ff2f --- /dev/null +++ b/Mohem/src/app/notification/models/MONotificationBodyRes.ts @@ -0,0 +1,8 @@ +import { Response } from "./response"; +import { MONotificationBodyItems } from './MONotificationBodyItems'; + +export class MONotificatonBodyResponse extends Response { + //public static SHARED_DATA = "Abs_Notif_BODY_List"; + //public static NOT_WORKLIST = "Abs_Notif_WORK_LIST"; + public GetMoNotificationBodyList: MONotificationBodyItems; +} diff --git a/Mohem/src/app/notification/models/NotificationBodyReq.ts b/Mohem/src/app/notification/models/NotificationBodyReq.ts index 238bc49a..2105beec 100644 --- a/Mohem/src/app/notification/models/NotificationBodyReq.ts +++ b/Mohem/src/app/notification/models/NotificationBodyReq.ts @@ -1,8 +1,9 @@ -import { Request } from './request'; +import { Request } from "./request"; -export class WorkListBodyRequest extends Request{ - // public static SHARED_DATA = ''; - public P_NOTIFICATION_ID :any; - public P_TRANSACTION_ID :number; - -} \ No newline at end of file +export class WorkListBodyRequest extends Request { + // public static SHARED_DATA = ''; + public P_NOTIFICATION_ID: any; + public P_TRANSACTION_ID: number; + public P_PAGE_NUM: number; + public P_PAGE_LIMIT: number; +} diff --git a/Mohem/src/app/notification/models/POItemHistoryList.ts b/Mohem/src/app/notification/models/POItemHistoryList.ts new file mode 100644 index 00000000..8e5e5d37 --- /dev/null +++ b/Mohem/src/app/notification/models/POItemHistoryList.ts @@ -0,0 +1,24 @@ +import { Response } from "./response"; + +export class GetItemHistoryList extends Response { + public OU_NAME: string; + public REVISION_NUM: number; + public CREATION_DATE: string; + public BUYER: string; + public ITEM_ID: number; + public BONUS_QUANTITY: number; + public DISCOUNT_PERCENTAGE: number; + public CLOSED_CODE: string; + public ROW_NUM: number; + public FROM_ROW_NUM: number; + public PO_NUMBER: string; + public SUPPLIER: string; + public UOM: string; + public QUANTITY_ORDERED: number; + public QUANTITY_RECEIVED: number; + public PURCHASE_PRICE: number; + public NET_PRICE: number; + public BALANCE_QUANTITY: number; + public NO_OF_ROWS: number; + public TO_ROW_NUM: number; +} diff --git a/Mohem/src/app/notification/models/POItemHistoryReq.ts b/Mohem/src/app/notification/models/POItemHistoryReq.ts new file mode 100644 index 00000000..bc163477 --- /dev/null +++ b/Mohem/src/app/notification/models/POItemHistoryReq.ts @@ -0,0 +1,8 @@ +import { Request } from "./request"; + +export class POItemHistoryRequest extends Request { + //public static SHARED_DATA = ''; + public P_ITEM_ID: number; + public P_PAGE_NUM: number; + public P_PAGE_LIMIT: number; +} diff --git a/Mohem/src/app/notification/models/POItemHistoryRes.ts b/Mohem/src/app/notification/models/POItemHistoryRes.ts new file mode 100644 index 00000000..78e34cef --- /dev/null +++ b/Mohem/src/app/notification/models/POItemHistoryRes.ts @@ -0,0 +1,6 @@ +import { Response } from "./response"; +import { GetItemHistoryList } from "./POItemHistoryList"; + +export class POItemHistoryRes extends Response { + public GetItemHistoryList: GetItemHistoryList; +} diff --git a/Mohem/src/app/notification/models/PONotificationBodyList.ts b/Mohem/src/app/notification/models/PONotificationBodyList.ts new file mode 100644 index 00000000..2cbd0437 --- /dev/null +++ b/Mohem/src/app/notification/models/PONotificationBodyList.ts @@ -0,0 +1,8 @@ +import { Response } from "./response"; +import { PoHeaderNotificationBodyItems } from "./PoHeaderNotificationBodyItems"; +import { PoLinesNotificationBodyItems } from "./PoLinesNotificationBodyItems"; + +export class PONotificatonBodyList extends Response { + public POHeader: PoHeaderNotificationBodyItems[]; + public POLines: PoLinesNotificationBodyItems[]; +} diff --git a/Mohem/src/app/notification/models/PONotificationBodyRes.ts b/Mohem/src/app/notification/models/PONotificationBodyRes.ts new file mode 100644 index 00000000..7d9eb808 --- /dev/null +++ b/Mohem/src/app/notification/models/PONotificationBodyRes.ts @@ -0,0 +1,8 @@ +import { Response } from "./response"; +import { PONotificatonBodyList } from "./PONotificationBodyList"; + +export class PONotificatonBodyResponse extends Response { + //public static SHARED_DATA = "Abs_Notif_BODY_List"; + //public static NOT_WORKLIST = "Abs_Notif_WORK_LIST"; + public GetPoNotificationBodyList: PONotificatonBodyList; +} diff --git a/Mohem/src/app/notification/models/PRHeaderNotificationBodyItems.ts b/Mohem/src/app/notification/models/PRHeaderNotificationBodyItems.ts new file mode 100644 index 00000000..44c7e356 --- /dev/null +++ b/Mohem/src/app/notification/models/PRHeaderNotificationBodyItems.ts @@ -0,0 +1,4 @@ +export class PRHeaderNotificationBodyItems { + public HDR_ATTRIBUTE_NAME: string; + public HDR_ATTRIBUTE_VALUE: string; +} diff --git a/Mohem/src/app/notification/models/PRLinesNotificationBodyItems.ts b/Mohem/src/app/notification/models/PRLinesNotificationBodyItems.ts new file mode 100644 index 00000000..16d4285f --- /dev/null +++ b/Mohem/src/app/notification/models/PRLinesNotificationBodyItems.ts @@ -0,0 +1,15 @@ +export class PRLinesNotificationBodyItems { + public LINE_NUM: number; + public DESCRIPTION: string; + public UOM: string; + public UNIT_PRICE: number; + public ITEM_AMU: number; + public NO_OF_ROWS: number; + public FROM_ROW_NUM: number; + public ITEM_CODE: string; + public COST_CENTER: string; + public QUANTITY: number; + public LINE_AMOUNT: number; + public ROW_NUM: number; + public TO_ROW_NUM: number; +} diff --git a/Mohem/src/app/notification/models/PRNotificationBodyList.ts b/Mohem/src/app/notification/models/PRNotificationBodyList.ts new file mode 100644 index 00000000..fa53ecd3 --- /dev/null +++ b/Mohem/src/app/notification/models/PRNotificationBodyList.ts @@ -0,0 +1,9 @@ +import { Response } from "./response"; +import { PRLinesNotificationBodyItems } from "./PRLinesNotificationBodyItems"; +import { PRHeaderNotificationBodyItems } from "./PRHeaderNotificationBodyItems"; + +export class PRNotificatonBodyList extends Response { + public PRHeader: PRHeaderNotificationBodyItems[]; + public PRLines: PRLinesNotificationBodyItems[]; + public P_CURRENCY_CODE: string; +} diff --git a/Mohem/src/app/notification/models/PRNotificationBodyRes.ts b/Mohem/src/app/notification/models/PRNotificationBodyRes.ts new file mode 100644 index 00000000..e47db663 --- /dev/null +++ b/Mohem/src/app/notification/models/PRNotificationBodyRes.ts @@ -0,0 +1,8 @@ +import { Response } from "./response"; +import { PRNotificatonBodyList } from './PRNotificationBodyList'; + +export class PRNotificatonBodyResponse extends Response { + //public static SHARED_DATA = "Abs_Notif_BODY_List"; + //public static NOT_WORKLIST = "Abs_Notif_WORK_LIST"; + public GetPrNotificationBodyList: PRNotificatonBodyList; +} diff --git a/Mohem/src/app/notification/models/PoHeaderNotificationBodyItems.ts b/Mohem/src/app/notification/models/PoHeaderNotificationBodyItems.ts new file mode 100644 index 00000000..33ecbded --- /dev/null +++ b/Mohem/src/app/notification/models/PoHeaderNotificationBodyItems.ts @@ -0,0 +1,25 @@ +export class PoHeaderNotificationBodyItems { + public PO_NUMBER: string; + public VENDOR_SITE_CODE: string; + public BUYER: string; + public SHIP_TO_LOCATION_NAME: string; + public QUOTATION_DATE: string; + public COMMENTS: string; + public GROSS_AMOUNT: number; + public TOTAL_PO_DISCOUNT: number; + public CUSTOM_DUTY: number; + public THER_CHARGES: number; + public LOC_CUR: string; + public TOT_PO_AMT_WORD: string; + public VENDOR_NAME: string; + public PREPARER: string; + public CREATION_DATE: string; + public QUOTATION_NUMBER: string; + public PAYMENT_TERMS: string; + public CURRENCY_NAME: string; + public DISCOUNT_AMOUNT: number; + public SALES_TAX: number; + public SHIP_HANDLE: number; + public TOT_PO_AMT: number; + public LOC_CUR_TOT_PO_AMT: number; +} diff --git a/Mohem/src/app/notification/models/PoLinesNotificationBodyItems.ts b/Mohem/src/app/notification/models/PoLinesNotificationBodyItems.ts new file mode 100644 index 00000000..e7b7eb2f --- /dev/null +++ b/Mohem/src/app/notification/models/PoLinesNotificationBodyItems.ts @@ -0,0 +1,14 @@ +export class PoLinesNotificationBodyItems { + public LINE_NUM: number; + public ITEM_ID: number; + public ITEM_CODE: string; + public MFG: string; + public UOM: string; + public QUANTITY: number; + public PO_HEADER_ID: number; + public ITEM_DESCRIPTION: string; + public LINE_TYP: string; + public UNIT_PRICE: number; + public LINE_DISC_PERCENTAGE: number; + public PROMISED_DATE: string; +} diff --git a/Mohem/src/app/notification/models/quotationAnalysisList.ts b/Mohem/src/app/notification/models/quotationAnalysisList.ts new file mode 100644 index 00000000..17cfbb42 --- /dev/null +++ b/Mohem/src/app/notification/models/quotationAnalysisList.ts @@ -0,0 +1,22 @@ +import { Response } from './response'; + +export class QuotationAnalysisList extends Response { + public QUOT_NUM: string; + public ITEM_CODE: string; + public QUOT_QTY: number; + public QUOT_UNIT_PRICE: number; + public QUOT_BONUS_QTY: string; + public QUOT_MFG_PART_NUM: string; + public RFQ_QTY: number; + public ROW_NUM: number; + public FROM_ROW_NUM: number; + public VENDOR_NAME: string; + public ITEM_DESC: string; + public QUOT_UOM: string; + public QUOT_LINE_TOTAL: number; + public QUOT_DELIVERY_DATE: string; + public RFQ_NUM: string; + public RFQ_UOM: string; + public NO_OF_ROWS: number; + public TO_ROW_NUM: number; +} diff --git a/Mohem/src/app/notification/models/quotationAnalysisReq.ts b/Mohem/src/app/notification/models/quotationAnalysisReq.ts new file mode 100644 index 00000000..8556c5ca --- /dev/null +++ b/Mohem/src/app/notification/models/quotationAnalysisReq.ts @@ -0,0 +1,8 @@ +import { Request } from "./request"; + +export class QuotationAnalysisRequest extends Request { + public P_PO_HEADER_ID: number; + public P_ITEM_ID: number; + public P_PAGE_NUM: number; + public P_PAGE_LIMIT: number; +} diff --git a/Mohem/src/app/notification/models/quotationAnalysisRes.ts b/Mohem/src/app/notification/models/quotationAnalysisRes.ts new file mode 100644 index 00000000..c68ab63f --- /dev/null +++ b/Mohem/src/app/notification/models/quotationAnalysisRes.ts @@ -0,0 +1,6 @@ +import { Response } from "./response"; +import {QuotationAnalysisList } from "./quotationAnalysisList"; + +export class QuotationAnalysisResponse extends Response { + public GetQuotationAnalysisList: QuotationAnalysisList; +} 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 4a81e751..958925a5 100644 --- a/Mohem/src/app/notification/service/work-list.main.service.ts +++ b/Mohem/src/app/notification/service/work-list.main.service.ts @@ -10,6 +10,12 @@ import { NotificatonButtonResponse } from "../models/NotificationButtonRes"; import { WorklistsubmitterInfoResponse } from "../models/WorklistsubmitterInfoRes"; import { WorkListSubmitterInfoRequest } from "../models/WorklistsubmitterInfoReq"; import { WorkListActionRequest } from "../models/NotificationActionReq"; +import { PONotificatonBodyResponse } from "../models/PONotificationBodyRes"; +import { MONotificatonBodyResponse } from "../models/MONotificationBodyRes"; +import { PRNotificatonBodyResponse } from "../models/PRNotificationBodyRes"; +import { StaticInjector } from "@angular/core/src/di/injector"; +import { POItemHistoryRes } from "../models/POItemHistoryRes"; +import { MOItemHistoryRes } from "../models/MOItemHistoryRes"; @Injectable() export class WorklistMainService { @@ -17,6 +23,14 @@ export class WorklistMainService { "Services/ERP.svc/REST/GET_EIT_NOTIFICATION_BODY"; public static getAbsenceNotificationBody = "Services/ERP.svc/REST/GET_ABSENCE_NOTIFICATION_BODY"; + public static getPoNotificationBody = + "Services/ERP.svc/REST/GET_PO_NOTIFICATION_BODY"; + public static getMONotificationBody = + "Services/ERP.svc/REST/GET_MO_NOTIFICATION_BODY"; + public static getPRNotificationBody = + "Services/ERP.svc/REST/GET_PR_NOTIFICATION_BODY"; + public static getPOItemHistory = "Services/ERP.svc/REST/GET_PO_ITEM_HISTORY"; + public static getMOItemHistory = "GET_MO_ITEM_HISTORY"; public static getNotificationButtons = "Services/ERP.svc/REST/GET_NOTIFICATION_BUTTONS"; public static getUserInfo = "Services/ERP.svc/REST/Get_UserInformation"; @@ -59,6 +73,81 @@ export class WorklistMainService { ); } + public getMONotificationBody( + WorkListBodyRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = WorkListBodyRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getMONotificationBody, + request, + onError, + errorLabel + ); + } + + public getPRNotificationBody( + WorkListBodyRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = WorkListBodyRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getPRNotificationBody, + request, + onError, + errorLabel + ); + } + + public getPONotificationBody( + WorkListBodyRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = WorkListBodyRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getPoNotificationBody, + request, + onError, + errorLabel + ); + } + + public getPOItemHistory( + POItemHistoryReq: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = POItemHistoryReq; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getPOItemHistory, + request, + onError, + errorLabel + ); + } + + public getMOItemHistory( + MOItemHistoryReq: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = MOItemHistoryReq; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getMOItemHistory, + request, + onError, + errorLabel + ); + } + public getNotificationButtons( WorkListButtonRequest: any, onError?: any, 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 3276d731..fd491b15 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts @@ -16,6 +16,9 @@ import { TextInput } from 'src/app/uI-elements/text.input'; import { TextAreaInput } from 'src/app/uI-elements/text-area.input'; import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service'; import { Events } from '@ionic/angular'; +import { PONotificatonBodyResponse } from '../models/PONotificationBodyRes'; +import { MONotificatonBodyResponse } from '../models/MONotificationBodyRes'; +import { PRNotificatonBodyResponse } from '../models/PRNotificationBodyRes'; @Component({ selector: "app-worklist-main", templateUrl: "./worklist-main.component.html", @@ -83,6 +86,8 @@ export class WorklistMainComponent implements OnInit { this.WorkListBodyObj.P_TRANSACTION_ID = this.TransactionID; this.WorkListBodyObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; + this.WorkListBodyObj.P_PAGE_NUM = 1; + this.WorkListBodyObj.P_PAGE_LIMIT = 50; this.WorkListButtonsObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; @@ -98,9 +103,40 @@ export class WorklistMainComponent implements OnInit { this.getEITNotificationDetails(this.WorkListBodyObj); } else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { this.getAbsenceNotificationDetails(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PO"){ + this.getPONotificationDetails(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "MO"){ + this.getMONotificationDetails(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PR"){ + this.getPRNotificationDetails(this.WorkListBodyObj); } } + getPRNotificationDetails(notificationBodyObj){ + this.worklistMainService + .getPRNotificationBody(notificationBodyObj) + .subscribe((result: PRNotificatonBodyResponse) => { + //this.handleWorkListBodyResult(result, "MO"); + }); + } + + getMONotificationDetails(notificationBodyObj){ + this.worklistMainService + .getMONotificationBody(notificationBodyObj) + .subscribe((result: MONotificatonBodyResponse) => { + //this.handleWorkListBodyResult(result, "MO"); + }); + } + + getPONotificationDetails(notificationBodyObj){ + this.worklistMainService + .getPONotificationBody(notificationBodyObj) + .subscribe((result: PONotificatonBodyResponse) => { + // console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); + // this.handleWorkListBodyResult(result, "PO"); + }); + } + getEITNotificationDetails(notificationBodyObj) { this.worklistMainService .getEITNotificationBody(notificationBodyObj) diff --git a/app document/phase 2 documents/.~lock.ESS API Integration V 0 34.doc# b/app document/phase 2 documents/.~lock.ESS API Integration V 0 34.doc# deleted file mode 100644 index 007e0a67..00000000 --- a/app document/phase 2 documents/.~lock.ESS API Integration V 0 34.doc# +++ /dev/null @@ -1 +0,0 @@ -,HMG/Mohamed.Mekawy,CS-1F-MOHAMED,01.10.2019 15:25,file:///C:/Users/mohamed.mekawy/AppData/Roaming/LibreOffice/4; \ No newline at end of file