diff --git a/Mohem/src/app/absence/home/home.component.ts b/Mohem/src/app/absence/home/home.component.ts index f6abd335..50dd3494 100644 --- a/Mohem/src/app/absence/home/home.component.ts +++ b/Mohem/src/app/absence/home/home.component.ts @@ -121,7 +121,7 @@ export class HomeComponent implements OnInit { this.absService.getAbsenceList(request).subscribe( (result: any) => { if (this.common.validResponse(result)) { - if (this.common.hasData(result.GetWorkList)) { + if (this.common.hasData(result.GetAbsenceTransactionList)) { this.P_PAGE_NUM++; result.GetAbsenceTransactionList.forEach(vr => { if (vr.ROW_NUM == vr.NO_OF_ROWS) { diff --git a/Mohem/src/app/my-subordinate/home/home.component.ts b/Mohem/src/app/my-subordinate/home/home.component.ts index a90ba3aa..ed5b1869 100644 --- a/Mohem/src/app/my-subordinate/home/home.component.ts +++ b/Mohem/src/app/my-subordinate/home/home.component.ts @@ -103,7 +103,7 @@ export class HomeComponent implements OnInit { if (this.cs.validResponse(result)) { if (this.cs.hasData(result.GetEmployeeSubordinatesList)) { this.empSubordinate = result.GetEmployeeSubordinatesList; - this.pageNum++; + this.infiniteRequest.P_PAGE_NUM= this.pageNum++; let lastItemIndex = this.empSubordinate.length - 1; if (result.GetEmployeeSubordinatesList[lastItemIndex]) { let lastitem = result.GetEmployeeSubordinatesList[lastItemIndex]; @@ -121,12 +121,14 @@ export class HomeComponent implements OnInit { doInfinite(infiniteScroll) { if (!this.IsReachEnd && this.infiniteRequest) { - this.infiniteRequest.P_PAGE_NUM = this.pageNum; + // this.infiniteRequest.P_PAGE_NUM = this.pageNum; this.myTeamService.getEmployeeSubordinates(this.infiniteRequest). subscribe((result: any) => { if (this.cs.validResponse(result)) { - this.pageNum++; - if (this.cs.hasData(result.GetWorkList)) { + // this.pageNum++; + this.infiniteRequest.P_PAGE_NUM= this.pageNum++; + + if (this.cs.hasData(result.GetEmployeeSubordinatesList)) { result.GetEmployeeSubordinatesList.forEach(vr => { if (vr.ROW_NUM == vr.NO_OF_ROWS) { this.IsReachEnd = true; diff --git a/Mohem/src/app/my-team/details/details.component.ts b/Mohem/src/app/my-team/details/details.component.ts index e3c92fa9..25693833 100644 --- a/Mohem/src/app/my-team/details/details.component.ts +++ b/Mohem/src/app/my-team/details/details.component.ts @@ -168,7 +168,8 @@ export class DetailsComponent implements OnInit { if (this.common.validResponse(result)) { if (this.common.hasData(result.GetEmployeeSubordinatesList)) { this.empSubordinate = result.GetEmployeeSubordinatesList; - this.pageNum++; + // this.pageNum++; + this.infiniteRequest.P_PAGE_NUM= this.pageNum++; let lastItemIndex = this.empSubordinate.length - 1; if (result.GetEmployeeSubordinatesList[lastItemIndex]) { let lastitem = result.GetEmployeeSubordinatesList[lastItemIndex]; @@ -185,14 +186,15 @@ export class DetailsComponent implements OnInit { } doInfinite(infiniteScroll) { if (!this.IsReachEnd && this.infiniteRequest) { - this.infiniteRequest.P_PAGE_NUM = this.pageNum; + // this.infiniteRequest.P_PAGE_NUM = this.pageNum; this.myTeamService .getEmployeeSubordinates(this.infiniteRequest) .subscribe( (result: any) => { if (this.common.validResponse(result)) { - this.pageNum++; - if (this.common.hasData(result.GetWorkList)) { + this.infiniteRequest.P_PAGE_NUM= this.pageNum++; + + if (this.common.hasData(result.GetEmployeeSubordinatesList)) { result.GetEmployeeSubordinatesList.forEach(vr => { if (vr.ROW_NUM == vr.NO_OF_ROWS) { this.IsReachEnd = true; diff --git a/Mohem/src/app/my-team/home/home.component.html b/Mohem/src/app/my-team/home/home.component.html index c8c724bd..bb64c178 100644 --- a/Mohem/src/app/my-team/home/home.component.html +++ b/Mohem/src/app/my-team/home/home.component.html @@ -45,7 +45,7 @@ -
+ @@ -57,10 +57,17 @@ {{subordinate.NUM_OF_SUBORDINATES}} - + + + + + - -
+ + +
diff --git a/Mohem/src/app/my-team/home/home.component.ts b/Mohem/src/app/my-team/home/home.component.ts index 9c10846e..c0f8c7e8 100644 --- a/Mohem/src/app/my-team/home/home.component.ts +++ b/Mohem/src/app/my-team/home/home.component.ts @@ -1,11 +1,11 @@ -import { Component, OnInit } from "@angular/core"; +import { Component, OnInit, ViewChild } from "@angular/core"; import { Location } from "@angular/common"; import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response"; import { MyTeamService } from "../service/my-team.service"; -import { ModalController } from "@ionic/angular"; +import { ModalController, IonInfiniteScroll } from "@ionic/angular"; import { DetailsComponent } from '../details/details.component'; @Component({ selector: "app-home", @@ -13,6 +13,8 @@ import { DetailsComponent } from '../details/details.component'; styleUrls: ["./home.component.scss"] }) export class HomeComponent implements OnInit { + @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; + pageNum: number = 1; pageLimit: number = 50; empSubordinate: any; @@ -54,6 +56,7 @@ export class HomeComponent implements OnInit { if (!this.isSearch) this.getEmpSubordinate(); } getEmpSubordinate() { + console.log("getEmpSubordinate my team home"); this.pageNum = 1; this.IsReachEnd = false; let searchEmpNum = ""; @@ -115,8 +118,9 @@ export class HomeComponent implements OnInit { handleEmpResult(result) { if (this.common.validResponse(result)) { if (this.common.hasData(result.GetEmployeeSubordinatesList)) { + this.empSubordinate = result.GetEmployeeSubordinatesList; - this.pageNum++; + this.infiniteRequest.P_PAGE_NUM++; const lastItemIndex = this.empSubordinate.length - 1; if (result.GetEmployeeSubordinatesList[lastItemIndex]) { const lastitem = result.GetEmployeeSubordinatesList[lastItemIndex]; @@ -131,8 +135,18 @@ export class HomeComponent implements OnInit { } } } - doInfinite(infiniteScroll) { + + + + + + + + doInfinite1(infiniteScroll) { + console.log("test"); if (!this.IsReachEnd && this.infiniteRequest) { + console.log("not ReachEnd"); + this.infiniteRequest.P_PAGE_NUM = this.pageNum; this.myTeamService .getEmployeeSubordinates(this.infiniteRequest) @@ -140,7 +154,7 @@ export class HomeComponent implements OnInit { (result: any) => { if (this.common.validResponse(result)) { this.pageNum++; - if (this.common.hasData(result.GetWorkList)) { + if (this.common.hasData(result.GetEmployeeSubordinatesList)) { result.GetEmployeeSubordinatesList.forEach(vr => { if (vr.ROW_NUM == vr.NO_OF_ROWS) { this.IsReachEnd = true; @@ -169,6 +183,47 @@ export class HomeComponent implements OnInit { } } } + + + doInfinite(infiniteScroll) { + //this.pageNum= this.pageNum + 1; + console.log("test doInfinite"); + if (!this.IsReachEnd) { + console.log("test doInfinite not ReachEnd"); + + this.myTeamService + .getEmployeeSubordinates(this.infiniteRequest).subscribe( + (result: any) => { + if (this.common.validResponse(result)) { + this.infiniteRequest.P_PAGE_NUM++; + if (this.common.hasData(result.GetEmployeeSubordinatesList)) { + result.GetEmployeeSubordinatesList.forEach(element => { + if (element.ROW_NUM == element.NO_OF_ROWS) { + this.IsReachEnd = true; + } else { + this.IsReachEnd = false; + } + this.empSubordinate.push(element); + }); + } // if list length >0 + else { + this.IsReachEnd = true; + } + } // if response == 1 + //this.pageNum++; + this.infiniteScroll.complete(); + } + ); + } else { + if (this.infiniteScroll) + this.infiniteScroll.complete(); + } + } //end infiniteScroll + + + + + getDetails(index) { this.common.sharedService.setSharedData( this.empSubordinate[index], diff --git a/Mohem/src/app/notification/item-history/item-history.component.ts b/Mohem/src/app/notification/item-history/item-history.component.ts index 6c2c109b..fba66ff8 100644 --- a/Mohem/src/app/notification/item-history/item-history.component.ts +++ b/Mohem/src/app/notification/item-history/item-history.component.ts @@ -20,7 +20,7 @@ export class ItemHistoryComponent implements OnInit { itemHistoryRes: any; IsReachEnd: boolean = false; P_PAGE_NUM: number = 1; - P_PAGE_LIMIT: number = 100; + P_PAGE_LIMIT: number = 50; POItemHistoryReq:any; getPassItemHistoreyList: any; constructor( @@ -63,6 +63,7 @@ export class ItemHistoryComponent implements OnInit { if (this.cs.hasData(result.GetPoItemHistoryList)) { this.itemHistoryRes = result.GetPoItemHistoryList; this.P_PAGE_NUM++; + this.POItemHistoryReq.P_PAGE_NUM = this.P_PAGE_NUM; let lastItemIndex = this.itemHistoryRes.length - 1; if (result.GetPoItemHistoryList[lastItemIndex]) { let lastitem = result.GetPoItemHistoryList[lastItemIndex]; @@ -84,7 +85,7 @@ export class ItemHistoryComponent implements OnInit { subscribe((result: any) => { if (this.cs.validResponse(result)) { if (result.GetPoItemHistoryList != undefined) { - this.P_PAGE_NUM++; + this.POItemHistoryReq.P_PAGE_NUM=this.P_PAGE_NUM++; (result.GetPoItemHistoryList).forEach(element => { if (element.ROW_NUM == element.NO_OF_ROWS) { this.IsReachEnd = true; diff --git a/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.ts b/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.ts index 0f68605d..fe446349 100644 --- a/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.ts +++ b/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.ts @@ -25,6 +25,7 @@ export class QutationAnalysisComponent implements OnInit { getPassPOHeaderID: any; getPassItemHistoreyList: any; getQutationAnalysis:any; + doInfiniteReq: any; constructor(public worklistMainService: WorklistMainService, private cs: CommonService, private ts: TranslatorService, @@ -59,8 +60,9 @@ console.log("getPassPOItemID: "+this.getPassPOHeaderID); const request = new QuotationAnalysisRequest(); request.P_ITEM_ID=parseInt(itemID); request.P_PO_HEADER_ID=headerID; - request.P_PAGE_LIMIT=100; - request.P_PAGE_NUM=1; + request.P_PAGE_LIMIT=1; + request.P_PAGE_NUM=50; + this.doInfiniteReq=request; this.worklistMainService.getQutationAnalysis(request). subscribe((result: QuotationAnalysisResponse) => { this.handleQutationAnalysisResult(result); @@ -75,7 +77,7 @@ console.log("getPassPOItemID: "+this.getPassPOHeaderID); //set sheard data // this.getQutationAnalysis = result.GetQuotationAnalysisList; - this.P_PAGE_NUM++; + this.doInfiniteReq.P_PAGE_NUM++; let lastItemIndex = this.getQutationAnalysis.length - 1; if (result.GetQuotationAnalysisList[lastItemIndex]) { let lastitem = result.GetQuotationAnalysisList[lastItemIndex]; @@ -93,12 +95,13 @@ console.log("getPassPOItemID: "+this.getPassPOHeaderID); doInfinite(infiniteScroll) { if (!this.IsReachEnd) { - this.getQutationAnalysis.P_PAGE_NUM = this.P_PAGE_NUM; - this.worklistMainService.getQutationAnalysis(this.getQutationAnalysis). + // this.getQutationAnalysis.P_PAGE_NUM = this.P_PAGE_NUM; + this.worklistMainService.getQutationAnalysis(this.doInfiniteReq). subscribe((result: any) => { if (this.cs.validResponse(result)) { if (result.GetQuotationAnalysisList != undefined) { this.P_PAGE_NUM++; + this.doInfiniteReq.P_PAGE_NUM = this.P_PAGE_NUM; (result.GetQuotationAnalysisList).forEach(element => { if (element.ROW_NUM == element.NO_OF_ROWS) { this.IsReachEnd = true; diff --git a/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.ts b/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.ts index ef10dcf4..d0c25cc2 100644 --- a/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.ts +++ b/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.ts @@ -46,7 +46,8 @@ export class WorkListActionHistoryComponent implements OnInit { if (this.cs.validResponse(result)) { if (this.cs.hasData(result.GetActionHistoryList)) { this.actionHistoryRes = result.GetActionHistoryList; - this.P_PAGE_NUM++; + // this.P_PAGE_NUM++; + this.WorkListActionHistoryObj.P_PAGE_NUM++; let lastItemIndex = this.actionHistoryRes.length - 1; if (result.GetActionHistoryList[lastItemIndex]) { let lastitem = result.GetActionHistoryList[lastItemIndex]; @@ -75,12 +76,14 @@ export class WorkListActionHistoryComponent implements OnInit { doInfinite(infiniteScroll) { if (!this.IsReachEnd) { - this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; + // this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; this.worklistService.getActionHistory(this.WorkListActionHistoryObj). subscribe((result: any) => { if (this.cs.validResponse(result)) { if (result.GetActionHistoryList != undefined) { this.P_PAGE_NUM++; + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; + (result.GetActionHistoryList).forEach(element => { if (element.ROW_NUM == element.NO_OF_ROWS) { this.IsReachEnd = true; diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts index e142000d..54aca8b4 100644 --- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts @@ -665,6 +665,7 @@ export class WorklistMainMRComponent implements OnInit { if (this.common.hasData(result.GetActionHistoryList)) { this.actionHistoryRes = result.GetActionHistoryList; this.P_PAGE_NUM++; + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; let lastItemIndex = this.actionHistoryRes.length - 1; if (result.GetActionHistoryList[lastItemIndex]) { let lastitem = result.GetActionHistoryList[lastItemIndex]; @@ -700,12 +701,13 @@ export class WorklistMainMRComponent implements OnInit { console.log("doInfinite action history MR"); if (!this.IsReachEnd) { - this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; this.worklistService.getActionHistory(this.WorkListActionHistoryObj). subscribe((result: any) => { if (this.common.validResponse(result)) { if (result.GetActionHistoryList != undefined) { this.P_PAGE_NUM++; + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; + (result.GetActionHistoryList).forEach(element => { if (element.ROW_NUM == element.NO_OF_ROWS) { this.IsReachEnd = true; @@ -783,12 +785,12 @@ export class WorklistMainMRComponent implements OnInit { doInfiniteNotificationBody(infiniteScroll) { console.log("doInfiniteNotificationBody MR"); if (!this.IsReachEnd) { - this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM; this.worklistMainService.getMONotificationBody(this.WorkListActionHistoryObj). subscribe((result: any) => { if (this.common.validResponse(result)) { if (result.GetMoNotificationBodyList != undefined) { this.P_PAGE_NUM++; + this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM; (result.GetMoNotificationBodyList).forEach(element => { if (element.ROW_NUM == element.NO_OF_ROWS) { this.IsReachEnd = true; @@ -820,12 +822,13 @@ export class WorklistMainMRComponent implements OnInit { if (!this.IsReachEnd) { console.log("this.IsReachEnd"+ this.IsReachEnd); - this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM; this.worklistMainService.getMONotificationBody(this.WorkListBodyObj). subscribe((result: any) => { if (this.common.validResponse(result)) { if (result.GetMoNotificationBodyList != undefined) { this.P_PAGE_NUM++; + this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM; + (result.GetMoNotificationBodyList).forEach(element => { if (element.ROW_NUM == element.NO_OF_ROWS) { this.IsReachEnd = true; @@ -855,12 +858,13 @@ export class WorklistMainMRComponent implements OnInit { console.log("doInfinite action history MR"); if (!this.IsReachEnd) { - this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; this.worklistService.getActionHistory(this.WorkListActionHistoryObj). subscribe((result: any) => { if (this.common.validResponse(result)) { if (result.GetActionHistoryList != undefined) { this.P_PAGE_NUM++; + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; + (result.GetActionHistoryList).forEach(element => { if (element.ROW_NUM == element.NO_OF_ROWS) { this.IsReachEnd = true; diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts index fd803635..558f1976 100644 --- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts @@ -690,6 +690,7 @@ export class WorklistMainPoComponent implements OnInit { if (this.common.hasData(result.GetActionHistoryList)) { this.actionHistoryRes = result.GetActionHistoryList; this.P_PAGE_NUM++; + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; let lastItemIndex = this.actionHistoryRes.length - 1; if (result.GetActionHistoryList[lastItemIndex]) { let lastitem = result.GetActionHistoryList[lastItemIndex]; @@ -724,12 +725,13 @@ export class WorklistMainPoComponent implements OnInit { doInfinite(infiniteScroll) { console.log("doInfinite action history"); if (!this.IsReachEnd) { - this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; this.worklistService.getActionHistory(this.WorkListActionHistoryObj). subscribe((result: any) => { if (this.common.validResponse(result)) { if (result.GetActionHistoryList != undefined) { this.P_PAGE_NUM++; + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; + (result.GetActionHistoryList).forEach(element => { if (element.ROW_NUM == element.NO_OF_ROWS) { this.IsReachEnd = true; @@ -867,12 +869,12 @@ export class WorklistMainPoComponent implements OnInit { if (!this.IsReachEnd) { console.log("this.IsReachEnd"+ this.IsReachEnd); - this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM; this.worklistMainService.getPONotificationBody(this.WorkListBodyObj). subscribe((result: any) => { if (this.common.validResponse(result)) { if (result.GetPoNotificationBodyList != undefined) { this.P_PAGE_NUM++; + this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM; (result.GetPoNotificationBodyList).forEach(element => { if (element.ROW_NUM == element.NO_OF_ROWS) { this.IsReachEnd = true; @@ -898,17 +900,17 @@ export class WorklistMainPoComponent implements OnInit { // infiniteScroll.target.complete(); } }//end infiniteScroll - + loadMoreActionHistory() { console.log("doInfinite action history MR"); if (!this.IsReachEnd) { - this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; this.worklistService.getActionHistory(this.WorkListActionHistoryObj). subscribe((result: any) => { if (this.common.validResponse(result)) { if (result.GetActionHistoryList != undefined) { this.P_PAGE_NUM++; + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; (result.GetActionHistoryList).forEach(element => { if (element.ROW_NUM == element.NO_OF_ROWS) { this.IsReachEnd = true; diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts index 34ad0028..bfb8ab5f 100644 --- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts @@ -810,12 +810,13 @@ export class WorklistMainPRComponent implements OnInit { if (!this.IsReachEnd) { console.log("this.IsReachEnd" + this.IsReachEnd); - this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM; this.worklistMainService.getPRNotificationBody(this.WorkListBodyObj). subscribe((result: any) => { if (this.common.validResponse(result)) { if (result.GetPrNotificationBodyList != undefined) { this.P_PAGE_NUM++; + this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM; + (result.GetPrNotificationBodyList).forEach(element => { if (element.ROW_NUM == element.NO_OF_ROWS) { this.IsReachEnd = true; @@ -845,12 +846,12 @@ export class WorklistMainPRComponent implements OnInit { console.log("doInfinite action history MR"); if (!this.IsReachEnd) { - this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; this.worklistService.getActionHistory(this.WorkListActionHistoryObj). subscribe((result: any) => { if (this.common.validResponse(result)) { if (result.GetActionHistoryList != undefined) { this.P_PAGE_NUM++; + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; (result.GetActionHistoryList).forEach(element => { if (element.ROW_NUM == element.NO_OF_ROWS) { this.IsReachEnd = true; diff --git a/Mohem/src/app/payslip/home/home.component.ts b/Mohem/src/app/payslip/home/home.component.ts index 6b2ba6bb..1a387670 100644 --- a/Mohem/src/app/payslip/home/home.component.ts +++ b/Mohem/src/app/payslip/home/home.component.ts @@ -30,6 +30,9 @@ export class HomeComponent implements OnInit { defultSelected: any; IsReachEnd: any; private deductionReq: DeductionRequest; + doinfiniteDedReq:any; + doinfinitEarReq:any; + @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; constructor( @@ -85,7 +88,6 @@ export class HomeComponent implements OnInit { // P_PAGE_NUM: this.P_PAGE_NUM, // P_PAGE_LIMIT: this.P_PAGE_LIMIT }; - this.payslipService.getPayslip(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> { this.handleRespondGetPayslipResult(result); @@ -180,7 +182,7 @@ getEarings(ActionContextID){ P_PAGE_NUM:1, P_PAGE_LIMIT:100 } - + this.doinfinitEarReq=request; this.payslipService.getEarings(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> { this.handleGetEaringsResult(result); @@ -207,7 +209,7 @@ getDeduction(ActionContextID){ // this.deductionReq.P_ACTION_CONTEXT_ID=ActionContextID; // this.deductionReq.P_PAGE_NUM=1; // this.deductionReq.P_PAGE_LIMIT=100; - + this.doinfiniteDedReq=request; this.payslipService.getDeduction(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> { @@ -227,10 +229,10 @@ getDeduction(ActionContextID){ //this.pageNum= this.pageNum + 1; if (!this.IsReachEnd) { - this.payslipService.getDeduction(this.deductionReq).subscribe( + this.payslipService.getDeduction(this.doinfiniteDedReq).subscribe( (result: any) => { if (this.common.validResponse(result)) { - this.deductionReq.P_PAGE_NUM++; + this.doinfiniteDedReq.P_PAGE_NUM++; if (this.common.hasData(result.GetDeductionsList)) { result.GetDeductionsList.forEach(element => { if (element.ROW_NUM == element.NO_OF_ROWS) { @@ -259,10 +261,10 @@ getDeduction(ActionContextID){ //this.pageNum= this.pageNum + 1; if (!this.IsReachEnd) { - this.payslipService.getEarings(this.deductionReq).subscribe( + this.payslipService.getEarings(this.doinfinitEarReq).subscribe( (result: any) => { if (this.common.validResponse(result)) { - this.deductionReq.P_PAGE_NUM++; + this.doinfinitEarReq.P_PAGE_NUM++; if (this.common.hasData(result.GetEarningsList)) { result.GetEarningsList.forEach(element => { if (element.ROW_NUM == element.NO_OF_ROWS) { diff --git a/Mohem/src/app/vacation-rule/home/home.component.ts b/Mohem/src/app/vacation-rule/home/home.component.ts index 797e7a2a..7ba084bc 100644 --- a/Mohem/src/app/vacation-rule/home/home.component.ts +++ b/Mohem/src/app/vacation-rule/home/home.component.ts @@ -37,7 +37,7 @@ export class HomeComponent implements OnInit { constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService, private router: Router) { this.P_PAGE_NUM = 1; - this.P_PAGE_LIMIT = 100; + this.P_PAGE_LIMIT = 1; //this.button = new ButtonInput('btnSubmit', 'Submit', 'containerDiv', 'Y'); // this.dateTime = new DateTimeInput('Start Date', 'SDate', '', 'containerDiv', 'Y', 'Y', 'Y'); @@ -98,6 +98,7 @@ export class HomeComponent implements OnInit { }, this.ts.trPK('general', 'retry')).subscribe((result) => { if (this.cs.validResponse(result)) { this.GetVacationRulesList = result.GetVacationRulesList; + this.P_PAGE_NUM++; } else { this.cs.presentAlert(result.ErrorEndUserMessage); } @@ -168,13 +169,14 @@ export class HomeComponent implements OnInit { let request: VacationRuleRequest = new VacationRuleRequest(); request.P_PAGE_LIMIT = this.P_PAGE_LIMIT; request.P_PAGE_NUM = this.P_PAGE_NUM; - if (!this.IsReachEnd) { this.vacationRuleService.getVacationRule(request, () => { // this.getVacationRules(); }, this.ts.trPK('general', 'retry')).subscribe((result) => { if (this.cs.validResponse(result)) { - request.P_PAGE_NUM++; + this.P_PAGE_NUM++; + request.P_PAGE_NUM = this.P_PAGE_NUM; + if (this.cs.hasData(result.GetVacationRulesList)) { result.GetVacationRulesList.forEach(element => { if (element.ROW_NUM == element.NO_OF_ROWS) {