|
|
|
|
@ -9,6 +9,9 @@ import { EitService } from '../services/eit.service';
|
|
|
|
|
import { EIT_ACTION } from '../models/submit.eit.action';
|
|
|
|
|
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
|
|
|
|
import { AddEitResponse } from '../models/add.eit.response';
|
|
|
|
|
import { AccrualService } from 'src/app/accrual-balances/services/accrual.service';
|
|
|
|
|
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
|
|
|
|
|
import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user';
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-eit-list',
|
|
|
|
|
@ -16,7 +19,10 @@ import { AddEitResponse } from '../models/add.eit.response';
|
|
|
|
|
styleUrls: ['./eit-list.component.scss'],
|
|
|
|
|
})
|
|
|
|
|
export class EitListComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
Sdate: any;
|
|
|
|
|
emp_no: any;
|
|
|
|
|
balance:any;
|
|
|
|
|
//////////////up
|
|
|
|
|
P_PAGE_NUM: number;
|
|
|
|
|
P_PAGE_LIMIT: number;
|
|
|
|
|
IsReachEnd = false;
|
|
|
|
|
@ -56,7 +62,8 @@ export class EitListComponent implements OnInit {
|
|
|
|
|
// gaugeLabel = "";
|
|
|
|
|
|
|
|
|
|
// tslint:disable-next-line: max-line-length
|
|
|
|
|
constructor(private cs: CommonService, private EITService: EitService, public ts: TranslatorService, private modalCtrl: ModalController) {
|
|
|
|
|
constructor(private cs: CommonService, private EITService: EitService, public ts: TranslatorService,
|
|
|
|
|
private modalCtrl: ModalController, public accrualService: AccrualService, public authService:AuthenticationService,) {
|
|
|
|
|
this.direction = TranslatorService.getCurrentLanguageName();
|
|
|
|
|
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
|
|
|
|
|
this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
|
|
|
|
|
@ -72,6 +79,10 @@ export class EitListComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
/////////////
|
|
|
|
|
this.Sdate = new Date().toISOString();
|
|
|
|
|
this.getUserDetails();
|
|
|
|
|
////////////////up
|
|
|
|
|
this.getEITTransactions();
|
|
|
|
|
|
|
|
|
|
this.accrualBalancesList = this.cs.sharedService.getSharedData('tickitsbalance', false);
|
|
|
|
|
@ -96,8 +107,44 @@ export class EitListComponent implements OnInit {
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getUserDetails(){
|
|
|
|
|
this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
|
|
|
|
|
if (user) {
|
|
|
|
|
this.emp_no=user.EMPLOYEE_NUMBER;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
public getAccrualBalance() {
|
|
|
|
|
if (this.Sdate) {
|
|
|
|
|
let today = new Date(this.Sdate);
|
|
|
|
|
let day = today.getDate();
|
|
|
|
|
let month = today.getMonth() + 1;
|
|
|
|
|
let year = today.getFullYear();
|
|
|
|
|
let todayDate = month + '/' + day + '/' + year;
|
|
|
|
|
let effectiveDate = todayDate;
|
|
|
|
|
const request = {
|
|
|
|
|
P_SELECTED_EMPLOYEE_NUMBER: this.emp_no,
|
|
|
|
|
P_EFFECTIVE_DATE: effectiveDate
|
|
|
|
|
};
|
|
|
|
|
this.accrualService
|
|
|
|
|
.getAccrualBalances(request)
|
|
|
|
|
.subscribe((result: any) => {
|
|
|
|
|
this.handleAccrualResult(result);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
handleAccrualResult(result) {
|
|
|
|
|
if (this.cs.validResponse(result)) {
|
|
|
|
|
this.balance=result.GetAccrualBalancesList;
|
|
|
|
|
this.accrualNetAdult = this.balance[1].ACCRUAL_NET_ENTITLEMENT;
|
|
|
|
|
this.accrualUNetChild = this.balance[2].ACCRUAL_NET_ENTITLEMENT;
|
|
|
|
|
this. accrualNetInfants = this.balance[3].ACCRUAL_NET_ENTITLEMENT;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
///////////////////////////////////
|
|
|
|
|
|
|
|
|
|
getEITTransactions() {
|
|
|
|
|
console.log('jkfdjkdfsffjhfsdahffg');
|
|
|
|
|
this.IsReachEnd = false;
|
|
|
|
|
this.EITTransactionsListObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
|
|
|
|
|
this.EITTransactionsListObj.P_PAGE_NUM = this.P_PAGE_NUM;
|
|
|
|
|
@ -520,5 +567,42 @@ export class EitListComponent implements OnInit {
|
|
|
|
|
this.removeItems(item.Collection_Transaction[0].TRANSACTION_NUMBER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
// getUserDetails(){
|
|
|
|
|
// this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
|
|
|
|
|
// if (user) {
|
|
|
|
|
// this.emp_no=user.EMPLOYEE_NUMBER;
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// public getAccrualBalance() {
|
|
|
|
|
// if (this.Sdate) {
|
|
|
|
|
// let today = new Date(this.Sdate);
|
|
|
|
|
// let day = today.getDate();
|
|
|
|
|
// let month = today.getMonth() + 1;
|
|
|
|
|
// let year = today.getFullYear();
|
|
|
|
|
// let todayDate = month + '/' + day + '/' + year;
|
|
|
|
|
// let effectiveDate = todayDate;
|
|
|
|
|
// const request = {
|
|
|
|
|
// P_SELECTED_EMPLOYEE_NUMBER: this.emp_no,
|
|
|
|
|
// P_EFFECTIVE_DATE: effectiveDate
|
|
|
|
|
// };
|
|
|
|
|
// this.accrualService
|
|
|
|
|
// .getAccrualBalances(request)
|
|
|
|
|
// .subscribe((result: any) => {
|
|
|
|
|
// this.handleAccrualResult(result);
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// handleAccrualResult(result) {
|
|
|
|
|
// if (this.cs.validResponse(result)) {
|
|
|
|
|
// this.balance=result.GetAccrualBalancesList;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
////////////////////////////////up
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|