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 cfa380bf..b57a1330 100644 --- a/Mohem/src/app/eit/add-eit/add-eit.component.ts +++ b/Mohem/src/app/eit/add-eit/add-eit.component.ts @@ -1289,6 +1289,15 @@ export class AddEitComponent implements OnInit { ) as HTMLSelectElement; let val = x.dataset.colmText; textValue = x.value; + + // below code is to handle fields which are hidden and required and has to have default value. + // So if colmText is empty then get value from value attribute which is already been set initially + if (this.eitResponse[i].DISPLAY_FLAG == "N" && this.eitResponse[i].REQUIRED_FLAG == "Y" && !val) { + const attributeValue = x.getAttribute('value'); + val = attributeValue ? attributeValue : ''; + textValue = val; + } + if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !val) { x.classList.add("requiredClassElm"); //this.common.showRequiredMsg(); diff --git a/Mohem/src/app/payslip/home/home.component.ts b/Mohem/src/app/payslip/home/home.component.ts index 8be10fe1..3a53968f 100644 --- a/Mohem/src/app/payslip/home/home.component.ts +++ b/Mohem/src/app/payslip/home/home.component.ts @@ -51,6 +51,7 @@ export class HomeComponent implements OnInit { slidesPerView: 1, autoplay:true }; + public userData: any; @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; public options = { @@ -79,36 +80,7 @@ export class HomeComponent implements OnInit { ngOnInit() { this.direction = TranslatorService.getCurrentLanguageName() - // 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.userData =this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA,false); this.getPayslip(); // this.getProfile(); @@ -142,39 +114,13 @@ slidePrev(object, slideView) { } - // getProfile() { - // this.authService - // .loadAuthenticatedUser() - // .subscribe((user: AuthenticatedUser) => { - // if (user) { - // this.personalInfo = user; - // if(this.cs.getUpdateImage().status){ - // // this.imageSrc = this.sanitizer.bypassSecurityTrustUrl("data:Image/*;base64,"+this.cs.getUpdateImage().img); - // this.imageSrc = "data:image/png;base64,"+this.cs.getUpdateImage().img; - // // alert("this.imageSrc"+ this.imageSrc); - // }else{ - // this.imageSrc = user.EMPLOYEE_IMAGE - // ? "data:image/png;base64," + user.EMPLOYEE_IMAGE - // : this.imageSrc; - // console.log("2-"+user); - // } - // } - // else { - // console.log("3-"+user); - // } - // }); - // } - - 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_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER,//'125346',//this.selEmp, 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, diff --git a/Mohem/src/app/payslip/service/payslip.service.ts b/Mohem/src/app/payslip/service/payslip.service.ts index 2b3c6bbe..db3b0fa7 100644 --- a/Mohem/src/app/payslip/service/payslip.service.ts +++ b/Mohem/src/app/payslip/service/payslip.service.ts @@ -23,7 +23,6 @@ export class PayslipService { public getPayslip(PayslipRequest: any , onError?: any,errorLabel?: string): Observable { const request = PayslipRequest; this.authService.authenticateRequest(request); - 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 { diff --git a/Mohem/src/app/reports/concurrent-report/concurrent-report.component.ts b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.ts index c064e86b..85715324 100644 --- a/Mohem/src/app/reports/concurrent-report/concurrent-report.component.ts +++ b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.ts @@ -14,6 +14,7 @@ import { SelectInput } from 'src/app/uI-elements/select.input'; import { TextInput } from 'src/app/uI-elements/text.input'; import { TimeInput } from 'src/app/uI-elements/time.input'; import { ReportServiceService } from '../report-service.service'; +import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user"; @Component({ selector: 'app-concurrent-report', @@ -42,6 +43,8 @@ export class ConcurrentReportComponent implements OnInit { selMenu: MenuResponse; public functionName; + public userData: any; + public headerTitle; getPassdirfromNotifiPage: boolean = false; @@ -54,6 +57,7 @@ export class ConcurrentReportComponent implements OnInit { constructor(public cs: CommonService, private elementRef: ElementRef, public reports: ReportServiceService, public ts: TranslatorService, public eitService: EitService) { } ngOnInit() { + this.userData =this.cs.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA,false); this.getPassdirfromNotifiPage = this.cs.sharedService.getSharedData('dirfromNotificationPage'); this.selectedMenu = this.cs.sharedService.getSharedData(MenuResponse.SELECTED_MENU, false); this.getConcurrentProgram(); @@ -65,7 +69,8 @@ export class ConcurrentReportComponent implements OnInit { getConcurrentProgram() { this.cs.startLoading(); this.reports.getConcurrentProgram({ - P_REQUEST_GROUP_ID: this.selectedMenu.REQUEST_GROUP_ID + P_REQUEST_GROUP_ID: this.selectedMenu.REQUEST_GROUP_ID, + P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER }, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => { this.cs.stopLoading(); this.programList = response.GetConcurrentProgramsList; @@ -75,7 +80,8 @@ export class ConcurrentReportComponent implements OnInit { getCppDiffStructure(programList) { this.cs.startLoading(); this.reports.getCPPDiffStructure({ - P_DESC_FLEX_NAME: programList.CONCURRENT_PROGRAM_NAME + P_DESC_FLEX_NAME: programList.CONCURRENT_PROGRAM_NAME, + P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER }, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => { this.cs.stopLoading(); this.handleDiffStructure(response); @@ -923,7 +929,7 @@ export class ConcurrentReportComponent implements OnInit { this.eitRequest = new EitRequest(); const list: any = this.getElementsValues(); this.eitRequest.EITTransactionTBL = list; - this.eitRequest.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp; + this.eitRequest.P_SELECTED_EMPLOYEE_NUMBER = this.userData.EMPLOYEE_NUMBER; this.eitRequest.P_MENU_TYPE = this.selectedMenu.MENU_TYPE; this.eitRequest.P_SELECTED_RESP_ID = -999;// this.selectedMenu.RESP_ID; // this.selMenu.List_Menu.RESP_ID,//-999, this.eitRequest.P_FUNCTION_NAME = this.functionName; @@ -956,6 +962,8 @@ export class ConcurrentReportComponent implements OnInit { request.P_SELECTED_RESP_ID = -999; request.P_FUNCTION_NAME = this.functionName; request.P_DESC_FLEX_NAME = this.template.CONCURRENT_PROGRAM_NAME; + request.P_SELECTED_EMPLOYEE_NUMBER = this.userData.EMPLOYEE_NUMBER; + this.reports.getTransaction(this.eitRequest, {}, this.ts.trPK('general', 'retry')).subscribe((result: any) => { this.cs.stopLoading(); diff --git a/Mohem/src/app/reports/report-service.service.ts b/Mohem/src/app/reports/report-service.service.ts index 9196cb2c..d9157598 100644 --- a/Mohem/src/app/reports/report-service.service.ts +++ b/Mohem/src/app/reports/report-service.service.ts @@ -23,7 +23,7 @@ export class ReportServiceService { getConcurrentProgram(request, onError, errorLabel) { this.authService.authenticateRequest(request); - request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; + // request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; return this.con.postNoLoad( ReportServiceService.GET_CONCURRENT_PROGRAM, request, @@ -33,7 +33,7 @@ export class ReportServiceService { } getCPPDiffStructure(request, onError, errorLabel) { this.authService.authenticateRequest(request); - request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; + // request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; return this.con.postNoLoad( ReportServiceService.GET_CPP_DIFF_STRUCTURE, request, @@ -43,7 +43,7 @@ export class ReportServiceService { } submitTransaction(request, onError, errorLabel) { this.authService.authenticateRequest(request); - request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; + // request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; return this.con.postNoLoad( ReportServiceService.SUBMIT_CPP_REQUEST, request, @@ -53,7 +53,7 @@ export class ReportServiceService { } getTransaction(request, onError, errorLabel) { this.authService.authenticateRequest(request); - request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; + // request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; return this.con.postNoLoad( ReportServiceService.SUBMIT_CPP_TRANSACTION, request, @@ -64,7 +64,7 @@ export class ReportServiceService { getCppOutput(request, onError, errorLabel) { this.authService.authenticateRequest(request); - request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; + // request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; return this.con.postNoLoad( ReportServiceService.GET_CCP_OUTPUT, request, diff --git a/Mohem/src/app/reports/transaction-list/transaction-list.component.ts b/Mohem/src/app/reports/transaction-list/transaction-list.component.ts index 53449f9d..957f0b58 100644 --- a/Mohem/src/app/reports/transaction-list/transaction-list.component.ts +++ b/Mohem/src/app/reports/transaction-list/transaction-list.component.ts @@ -6,6 +6,8 @@ import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-respo import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { ReportServiceService } from '../report-service.service'; import { FileOpener } from '@ionic-native/file-opener/ngx'; +import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user"; + @Component({ selector: 'app-transaction-list', templateUrl: './transaction-list.component.html', @@ -16,10 +18,13 @@ export class TransactionListComponent implements OnInit { selectedMenu: any; template: any; direction: any; + public userData: any; + constructor(public cs: CommonService, private elementRef: ElementRef, public reports: ReportServiceService, public ts: TranslatorService, private platform: Platform, private file: File, private opener: FileOpener, ) { } ngOnInit() { + this.userData =this.cs.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA,false); this.selectedMenu = this.cs.sharedService.getSharedData(MenuResponse.SELECTED_MENU, false); this.transactionList = this.cs.sharedService.getSharedData(ReportServiceService.TRANSACTION_LIST, false); this.template = this.cs.sharedService.getSharedData(ReportServiceService.TEMPLATE, false); @@ -94,6 +99,7 @@ export class TransactionListComponent implements OnInit { request.P_SELECTED_RESP_ID = -999; request.P_FUNCTION_NAME = this.selectedMenu.FUNCTION_NAME; request.P_DESC_FLEX_NAME = this.template.CONCURRENT_PROGRAM_NAME; + request.P_SELECTED_EMPLOYEE_NUMBER = this.userData.EMPLOYEE_NUMBER; this.reports.getTransaction(request, {}, this.ts.trPK('general', 'retry')).subscribe((result: any) => { this.cs.stopLoading(); diff --git a/Mohem/src/app/reports/transactions/transactions.component.ts b/Mohem/src/app/reports/transactions/transactions.component.ts index 9755fb4a..42bb0d87 100644 --- a/Mohem/src/app/reports/transactions/transactions.component.ts +++ b/Mohem/src/app/reports/transactions/transactions.component.ts @@ -2,10 +2,12 @@ import { Component, ElementRef, OnInit } from '@angular/core'; import { FileOpener } from '@ionic-native/file-opener/ngx'; import { File } from '@ionic-native/file/ngx'; import { Platform } from '@ionic/angular'; +import { userInfo } from 'os'; import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { ReportServiceService } from '../report-service.service'; +import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user"; @Component({ selector: 'app-transactions', @@ -18,6 +20,7 @@ export class TransactionsComponent implements OnInit { template: any; direction: any; programList: any = []; + public userData: any; constructor(public cs: CommonService, private elementRef: ElementRef, public reports: ReportServiceService, public ts: TranslatorService, private platform: Platform, private file: File, private opener: FileOpener, ) { } @@ -25,10 +28,12 @@ export class TransactionsComponent implements OnInit { ngOnInit() { this.selectedMenu = this.cs.sharedService.getSharedData(MenuResponse.SELECTED_MENU, false); + this.userData =this.cs.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA,false); // this.transactionList = this.cs.sharedService.getSharedData(ReportServiceService.TRANSACTION_LIST, false); //this.template = this.cs.sharedService.getSharedData(ReportServiceService.TEMPLATE, false); this.direction = TranslatorService.getCurrentDirection(); this.getConcurrentProgram(); + } getDate(date) { return this.cs.evaluteDate(date); @@ -99,6 +104,7 @@ export class TransactionsComponent implements OnInit { request.P_SELECTED_RESP_ID = -999; request.P_FUNCTION_NAME = this.selectedMenu.FUNCTION_NAME; request.P_DESC_FLEX_NAME = this.template.CONCURRENT_PROGRAM_NAME; + request.P_SELECTED_EMPLOYEE_NUMBER = this.userData.EMPLOYEE_NUMBER; this.reports.getTransaction(request, {}, this.ts.trPK('general', 'retry')).subscribe((result: any) => { this.cs.stopLoading(); @@ -108,7 +114,8 @@ export class TransactionsComponent implements OnInit { getConcurrentProgram() { this.cs.startLoading(); this.reports.getConcurrentProgram({ - P_REQUEST_GROUP_ID: this.selectedMenu.REQUEST_GROUP_ID + P_REQUEST_GROUP_ID: this.selectedMenu.REQUEST_GROUP_ID, + P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER }, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => { this.cs.stopLoading(); this.programList = response.GetConcurrentProgramsList;