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/package-lock.json b/Mohem/package-lock.json index 73fb0606..0908127d 100644 --- a/Mohem/package-lock.json +++ b/Mohem/package-lock.json @@ -797,6 +797,21 @@ "@types/cordova": "^0.0.34" } }, + "@ionic-native/base64": { + "version": "5.15.1", + "resolved": "https://registry.npmjs.org/@ionic-native/base64/-/base64-5.15.1.tgz", + "integrity": "sha512-VZs/n/5qJ1VwDQRvsJ4jWlWL6f+K21vFjX6EJJM6k2lZp6IbV9+N9oU5B/yjHX/SaVqJzAVge0tm0EIhLiWSHg==", + "requires": { + "@types/cordova": "^0.0.34" + }, + "dependencies": { + "@types/cordova": { + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", + "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" + } + } + }, "@ionic-native/ble": { "version": "5.8.0", "resolved": "https://registry.npmjs.org/@ionic-native/ble/-/ble-5.8.0.tgz", @@ -859,6 +874,36 @@ } } }, + "@ionic-native/file": { + "version": "5.15.1", + "resolved": "https://registry.npmjs.org/@ionic-native/file/-/file-5.15.1.tgz", + "integrity": "sha512-/wGAefEQroNR+n9t01+tu47lHFrwSwlN5fs+YaFSW2yAFax7nuG9y2l047CAHZd9/4+SRKQjCgvrc4dtAaFYow==", + "requires": { + "@types/cordova": "^0.0.34" + }, + "dependencies": { + "@types/cordova": { + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", + "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" + } + } + }, + "@ionic-native/file-path": { + "version": "5.15.1", + "resolved": "https://registry.npmjs.org/@ionic-native/file-path/-/file-path-5.15.1.tgz", + "integrity": "sha512-pAVUPzRzvghV53CZBwWd5ZOSkcFPBJLywgrnx6xX50tIsfXUG1oSwYPDM3ZLHPUefl1mIcjziXLbmlDyOjCg0A==", + "requires": { + "@types/cordova": "^0.0.34" + }, + "dependencies": { + "@types/cordova": { + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", + "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" + } + } + }, "@ionic-native/fingerprint-aio": { "version": "5.8.0", "resolved": "https://registry.npmjs.org/@ionic-native/fingerprint-aio/-/fingerprint-aio-5.8.0.tgz", @@ -2875,6 +2920,11 @@ "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=" }, + "com-badrit-base64": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/com-badrit-base64/-/com-badrit-base64-0.2.0.tgz", + "integrity": "sha1-u9hgM6oeGs/37kRqbIDIvUL03Tc=" + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -4259,6 +4309,16 @@ "resolved": "https://registry.npmjs.org/cordova-plugin-device/-/cordova-plugin-device-2.0.3.tgz", "integrity": "sha512-Jb3V72btxf3XHpkPQsGdyc8N6tVBYn1vsxSFj43fIz9vonJDUThYPCJJHqk6PX6N4dJw6I4FjxkpfCR4LDYMlw==" }, + "cordova-plugin-file": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/cordova-plugin-file/-/cordova-plugin-file-6.0.2.tgz", + "integrity": "sha512-m7cughw327CjONN/qjzsTpSesLaeybksQh420/gRuSXJX5Zt9NfgsSbqqKDon6jnQ9Mm7h7imgyO2uJ34XMBtA==" + }, + "cordova-plugin-filepath": { + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/cordova-plugin-filepath/-/cordova-plugin-filepath-1.5.6.tgz", + "integrity": "sha512-YvrnXfoq4hzruVXnKo2qAiWlJ6xqo9RWLycEOI13WAIb69pzVvvFHXLREv7otSXkTn2tugpHQWcopxnPPOvFtA==" + }, "cordova-plugin-geolocation": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/cordova-plugin-geolocation/-/cordova-plugin-geolocation-4.0.2.tgz", @@ -7114,12 +7174,12 @@ "dev": true }, "https-proxy-agent": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", - "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.3.tgz", + "integrity": "sha512-Ytgnz23gm2DVftnzqRRz2dOXZbGd2uiajSw/95bPp6v53zPRspQjLm/AfBgqbJ2qfeRXWIOMVLpp86+/5yX39Q==", "dev": true, "requires": { - "agent-base": "^4.1.0", + "agent-base": "^4.3.0", "debug": "^3.1.0" }, "dependencies": { diff --git a/Mohem/package.json b/Mohem/package.json index 3025b3b2..3674ed31 100755 --- a/Mohem/package.json +++ b/Mohem/package.json @@ -27,12 +27,15 @@ "@ionic-native/background-geolocation": "^5.4.0", "@ionic-native/badge": "^5.8.0", "@ionic-native/barcode-scanner": "^5.14.0", + "@ionic-native/base64": "^5.15.1", "@ionic-native/ble": "^5.8.0", "@ionic-native/camera": "^5.14.0", "@ionic-native/core": "^5.8.0", "@ionic-native/date-picker": "^5.10.0", "@ionic-native/device": "^5.8.0", "@ionic-native/diagnostic": "^5.14.0", + "@ionic-native/file": "^5.15.1", + "@ionic-native/file-path": "^5.15.1", "@ionic-native/fingerprint-aio": "^5.8.0", "@ionic-native/geolocation": "^5.10.0", "@ionic-native/globalization": "^5.8.0", @@ -54,6 +57,7 @@ "angular-calendar": "^0.26.11", "app": "0.1.0", "chart.js": "^2.8.0", + "com-badrit-base64": "^0.2.0", "cordova-android": "8.1.0", "cordova-android-support-gradle-release": "^3.0.1", "cordova-browser": "5.0.4", @@ -64,6 +68,8 @@ "cordova-plugin-camera": "^4.1.0", "cordova-plugin-datepicker": "^0.9.3", "cordova-plugin-device": "^2.0.3", + "cordova-plugin-file": "^6.0.2", + "cordova-plugin-filepath": "^1.5.6", "cordova-plugin-geolocation": "^4.0.2", "cordova-plugin-globalization": "^1.11.0", "cordova-plugin-ionic-keyboard": "^2.1.3", @@ -143,7 +149,10 @@ "cordova-open-native-settings": {}, "cordova-plugin-camera": { "ANDROID_SUPPORT_V4_VERSION": "27.+" - } + }, + "cordova-plugin-file": {}, + "cordova-plugin-filepath": {}, + "com-badrit-base64": {} }, "platforms": [ "browser", @@ -151,4 +160,4 @@ "android" ] } -} \ No newline at end of file +} 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 b526303b..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,9 +115,8 @@ export class AuthenticationService { } public setPublicFields(request: Request): Request { - console.log("setPublicFields :" + request); - request.VersionID = 1.4; //1.3 hmg - request.Channel = 31; //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 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 9f8940f1..68af6074 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -104,10 +104,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 { @@ -951,8 +952,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"]); @@ -1036,6 +1039,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 9c6ad778..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,103 +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 = 'http://10.50.100.198:4444/'; // production service + 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 = "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/'; // 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 + constructor(public httpClient: HttpClient, public cs: CommonService) {} - ) { } + 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 post(service: string, data: any, onError: any, errorLabel?: string): Observable { + // 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) + ) + ); + } - 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(() => { }, () => { }) - ); - } - - // 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) { @@ -109,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/home/home.page.ts b/Mohem/src/app/home/home.page.ts index 4badaa8e..cb09b009 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -94,15 +94,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