|
|
|
|
@ -1,11 +1,11 @@
|
|
|
|
|
import { Component, OnInit, ViewChild, SimpleChanges } from '@angular/core';
|
|
|
|
|
import {PayslipService} from '../service/payslip.service'
|
|
|
|
|
import { PayslipService } from '../service/payslip.service'
|
|
|
|
|
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
|
|
|
|
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
|
|
|
|
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
|
|
|
|
|
import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
|
|
|
|
|
import { DeductionRequest } from '../model/deductionReq';
|
|
|
|
|
import { IonInfiniteScroll,IonSlides} from '@ionic/angular';
|
|
|
|
|
import { IonInfiniteScroll, IonSlides } from '@ionic/angular';
|
|
|
|
|
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
|
|
|
|
|
import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user";
|
|
|
|
|
import { UIChart } from 'primeng/components/chart/chart';
|
|
|
|
|
@ -19,71 +19,72 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
selEmp: string;
|
|
|
|
|
respID: number;
|
|
|
|
|
selMenu: MenuResponse;
|
|
|
|
|
GetPayslipList:any='';
|
|
|
|
|
GetSummaryOfPaymentList:any='';
|
|
|
|
|
GetPaymentInformationList:any='';
|
|
|
|
|
showPaySlip:any=[];
|
|
|
|
|
ActionContextID:any;
|
|
|
|
|
GetPayslipList: any = '';
|
|
|
|
|
GetSummaryOfPaymentList: any = '';
|
|
|
|
|
GetPaymentInformationList: any = '';
|
|
|
|
|
showPaySlip: any = [];
|
|
|
|
|
ActionContextID: any;
|
|
|
|
|
public static ACTION_CONTEXT_ID = "passActionContectID";
|
|
|
|
|
GetEarningsList: any='';
|
|
|
|
|
GetDeductionsList: any='';
|
|
|
|
|
GetEarningsList: any = '';
|
|
|
|
|
GetDeductionsList: any = '';
|
|
|
|
|
earingTotal: any;
|
|
|
|
|
deductionTotal: any;
|
|
|
|
|
firstPayslip: any;
|
|
|
|
|
defultSelected: any;
|
|
|
|
|
IsReachEnd: any;
|
|
|
|
|
private deductionReq: DeductionRequest;
|
|
|
|
|
doinfiniteDedReq:any;
|
|
|
|
|
doinfinitEarReq:any;
|
|
|
|
|
doinfiniteDedReq: any;
|
|
|
|
|
doinfinitEarReq: any;
|
|
|
|
|
personalInfo: any;
|
|
|
|
|
setImage:any;
|
|
|
|
|
setImage: any;
|
|
|
|
|
imageSrc: any = "../assets/imgs/profile.png";
|
|
|
|
|
slideView: any;
|
|
|
|
|
sliderOne: any;
|
|
|
|
|
payslipIndex :any;
|
|
|
|
|
data:any;
|
|
|
|
|
payslipIndex: any;
|
|
|
|
|
data: any;
|
|
|
|
|
public direction: string;
|
|
|
|
|
@ViewChild('slides') slides: IonSlides;
|
|
|
|
|
@ViewChild('slideWithNav') slideWithNav: IonSlides;
|
|
|
|
|
@ViewChild('chart') chart: UIChart;
|
|
|
|
|
@ViewChild('chart') chart: UIChart;
|
|
|
|
|
slideOptsOne = {
|
|
|
|
|
initialSlide: 0,
|
|
|
|
|
slidesPerView: 1,
|
|
|
|
|
autoplay:true
|
|
|
|
|
autoplay: true
|
|
|
|
|
};
|
|
|
|
|
public userData: any;
|
|
|
|
|
|
|
|
|
|
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
|
|
|
|
|
public options = {
|
|
|
|
|
cutoutPercentage: 85,
|
|
|
|
|
tooltips: { enabled: false },
|
|
|
|
|
legend: { display: false }};
|
|
|
|
|
gaugeType = "full";
|
|
|
|
|
|
|
|
|
|
// gaugeValue = 11.200;
|
|
|
|
|
// gaugeLabel = "";
|
|
|
|
|
|
|
|
|
|
public options = {
|
|
|
|
|
cutoutPercentage: 85,
|
|
|
|
|
tooltips: { enabled: false },
|
|
|
|
|
legend: { display: false }
|
|
|
|
|
};
|
|
|
|
|
gaugeType = "full";
|
|
|
|
|
|
|
|
|
|
// gaugeValue = 11.200;
|
|
|
|
|
// gaugeLabel = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
public payslipService:PayslipService,
|
|
|
|
|
public payslipService: PayslipService,
|
|
|
|
|
public ts: TranslatorService,
|
|
|
|
|
public common: CommonService,
|
|
|
|
|
public sharedData: SharedDataService,
|
|
|
|
|
public authService: AuthenticationService,
|
|
|
|
|
public cs: CommonService,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
this.direction = TranslatorService.getCurrentDirection();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
this.direction = TranslatorService.getCurrentDirection();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
this.direction = TranslatorService.getCurrentLanguageName()
|
|
|
|
|
this.userData =this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA,false);
|
|
|
|
|
|
|
|
|
|
this.userData = this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA, false);
|
|
|
|
|
|
|
|
|
|
this.getPayslip();
|
|
|
|
|
// this.getProfile();
|
|
|
|
|
// this.getProfile();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -91,7 +92,7 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
if (changes.inputData.currentValue) {
|
|
|
|
|
// update this.data here
|
|
|
|
|
|
|
|
|
|
// then chart is getting updated
|
|
|
|
|
// then chart is getting updated
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.chart.reinit();
|
|
|
|
|
}, 100);
|
|
|
|
|
@ -99,175 +100,172 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
slideNext(object, slideView) {
|
|
|
|
|
if(this.payslipIndex!=0){
|
|
|
|
|
this.payslipIndex=this.payslipIndex-1;
|
|
|
|
|
this.showInfo();
|
|
|
|
|
if (this.payslipIndex != 0) {
|
|
|
|
|
this.payslipIndex = this.payslipIndex - 1;
|
|
|
|
|
this.showInfo();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
slidePrev(object, slideView) {
|
|
|
|
|
if(this.payslipIndex<this.GetPayslipList.length-1){
|
|
|
|
|
// console.log(this.payslipIndex);
|
|
|
|
|
this.payslipIndex=this.payslipIndex+1;
|
|
|
|
|
this.showInfo();
|
|
|
|
|
slidePrev(object, slideView) {
|
|
|
|
|
if (this.payslipIndex < this.GetPayslipList.length - 1) {
|
|
|
|
|
// console.log(this.payslipIndex);
|
|
|
|
|
this.payslipIndex = this.payslipIndex + 1;
|
|
|
|
|
this.showInfo();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getPayslip(){
|
|
|
|
|
this.respID=-999;
|
|
|
|
|
|
|
|
|
|
getPayslip() {
|
|
|
|
|
this.respID = -999;
|
|
|
|
|
const request = {
|
|
|
|
|
P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER,//'125346',//this.selEmp,
|
|
|
|
|
P_MENU_TYPE:"E",// 'E',//this.selMenu.List_Menu.MENU_TYPE,
|
|
|
|
|
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,
|
|
|
|
|
// P_PAGE_LIMIT: this.P_PAGE_LIMIT
|
|
|
|
|
};
|
|
|
|
|
this.payslipService.getPayslip(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
|
|
|
|
|
{
|
|
|
|
|
this.handleRespondGetPayslipResult(result);
|
|
|
|
|
this.payslipService.getPayslip(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
|
|
|
|
|
this.handleRespondGetPayslipResult(result);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleRespondGetPayslipResult(result){
|
|
|
|
|
|
|
|
|
|
handleRespondGetPayslipResult(result) {
|
|
|
|
|
|
|
|
|
|
if (result.GetPayslipList != null) {
|
|
|
|
|
this.GetPayslipList = result.GetPayslipList;
|
|
|
|
|
this.firstPayslip= this.GetPayslipList[0]
|
|
|
|
|
this.defultSelected=this.firstPayslip.PAYSLIP_CHOICE
|
|
|
|
|
this.firstPayslip = this.GetPayslipList[0]
|
|
|
|
|
this.defultSelected = this.firstPayslip.PAYSLIP_CHOICE
|
|
|
|
|
}
|
|
|
|
|
this.showPaySlip = this.GetPayslipList[0];
|
|
|
|
|
this.payslipIndex=0;
|
|
|
|
|
this.payslipIndex = 0;
|
|
|
|
|
this.getAllPayslipData(this.GetPayslipList[0].ACTION_CONTEXT_ID);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showInfo(){
|
|
|
|
|
|
|
|
|
|
//console.log(event.detail.value);
|
|
|
|
|
//const index = parseInt(event.detail.value);
|
|
|
|
|
this.showPaySlip =this.GetPayslipList[this.payslipIndex];
|
|
|
|
|
this.ActionContextID=this.GetPayslipList[this.payslipIndex].ACTION_CONTEXT_ID;
|
|
|
|
|
this.getAllPayslipData(this.ActionContextID);
|
|
|
|
|
showInfo() {
|
|
|
|
|
|
|
|
|
|
//console.log(event.detail.value);
|
|
|
|
|
//const index = parseInt(event.detail.value);
|
|
|
|
|
this.showPaySlip = this.GetPayslipList[this.payslipIndex];
|
|
|
|
|
this.ActionContextID = this.GetPayslipList[this.payslipIndex].ACTION_CONTEXT_ID;
|
|
|
|
|
this.getAllPayslipData(this.ActionContextID);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getAllPayslipData(ActionContextID){
|
|
|
|
|
this.common.sharedService.setSharedData(ActionContextID,HomeComponent.ACTION_CONTEXT_ID);
|
|
|
|
|
getAllPayslipData(ActionContextID) {
|
|
|
|
|
this.common.sharedService.setSharedData(ActionContextID, HomeComponent.ACTION_CONTEXT_ID);
|
|
|
|
|
this.getSummeryOfPayment(ActionContextID);
|
|
|
|
|
this.getPaymentInfo(ActionContextID);
|
|
|
|
|
this.getDeduction(ActionContextID);
|
|
|
|
|
this.getEarings(ActionContextID);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getSummeryOfPayment(ActionContextID){
|
|
|
|
|
getSummeryOfPayment(ActionContextID) {
|
|
|
|
|
const request = {
|
|
|
|
|
P_ACTION_CONTEXT_ID: ActionContextID,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.payslipService.getSummeryOFPayment(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
|
|
|
|
|
{
|
|
|
|
|
this.handleSummeryOfPaymentResult(result);
|
|
|
|
|
|
|
|
|
|
this.payslipService.getSummeryOFPayment(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
|
|
|
|
|
this.handleSummeryOfPaymentResult(result);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleSummeryOfPaymentResult(result){
|
|
|
|
|
handleSummeryOfPaymentResult(result) {
|
|
|
|
|
if (result.GetSummaryOfPaymentList != null) {
|
|
|
|
|
this.GetSummaryOfPaymentList = result.GetSummaryOfPaymentList[0];
|
|
|
|
|
this.earingTotal = this.GetSummaryOfPaymentList.TOTAL_EARNINGS_AMOUNT;
|
|
|
|
|
this.deductionTotal = this.GetSummaryOfPaymentList.TOTAL_DEDUCTIONS_AMOUNT;
|
|
|
|
|
this.earingTotal = this.GetSummaryOfPaymentList.TOTAL_EARNINGS_AMOUNT;
|
|
|
|
|
this.deductionTotal = this.GetSummaryOfPaymentList.TOTAL_DEDUCTIONS_AMOUNT;
|
|
|
|
|
this.data = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
labels: ['earingTotal', 'deductionTotal'],
|
|
|
|
|
datasets: [
|
|
|
|
|
{ data: [this.earingTotal,this.deductionTotal],
|
|
|
|
|
backgroundColor: [
|
|
|
|
|
'#024d71',
|
|
|
|
|
'#024d71', ],
|
|
|
|
|
borderWidth: 2
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}; }
|
|
|
|
|
{
|
|
|
|
|
data: [this.earingTotal, this.deductionTotal],
|
|
|
|
|
backgroundColor: [
|
|
|
|
|
'#43A6A0',
|
|
|
|
|
'#024d71',],
|
|
|
|
|
borderWidth: 2
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getPaymentInfo(ActionContextID){
|
|
|
|
|
const request = {
|
|
|
|
|
P_ACTION_CONTEXT_ID: ActionContextID,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.payslipService.getPaymentInfo(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
|
|
|
|
|
{
|
|
|
|
|
this.handleGetPaymentInfoResult(result);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
getPaymentInfo(ActionContextID) {
|
|
|
|
|
const request = {
|
|
|
|
|
P_ACTION_CONTEXT_ID: ActionContextID,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handleGetPaymentInfoResult(result){
|
|
|
|
|
if (result.GetPaymentInformationList != null) {
|
|
|
|
|
this.GetPaymentInformationList = result.GetPaymentInformationList;
|
|
|
|
|
this.payslipService.getPaymentInfo(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
|
|
|
|
|
this.handleGetPaymentInfoResult(result);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openEarings(){
|
|
|
|
|
this.common.openEarningsPage();
|
|
|
|
|
handleGetPaymentInfoResult(result) {
|
|
|
|
|
if (result.GetPaymentInformationList != null) {
|
|
|
|
|
this.GetPaymentInformationList = result.GetPaymentInformationList;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
openDeductions(){
|
|
|
|
|
this.common.openDeductionsPage();
|
|
|
|
|
}
|
|
|
|
|
openEarings() {
|
|
|
|
|
this.common.openEarningsPage();
|
|
|
|
|
|
|
|
|
|
getEarings(ActionContextID){
|
|
|
|
|
console.log("getEarings");
|
|
|
|
|
|
|
|
|
|
// this.deductionReq.P_ACTION_CONTEXT_ID=ActionContextID;
|
|
|
|
|
// this.deductionReq.P_PAGE_NUM=1;
|
|
|
|
|
// this.deductionReq.P_PAGE_LIMIT=100;
|
|
|
|
|
const request ={
|
|
|
|
|
P_ACTION_CONTEXT_ID: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);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
openDeductions() {
|
|
|
|
|
this.common.openDeductionsPage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleGetEaringsResult(result){
|
|
|
|
|
if (result.GetEarningsList != null) {
|
|
|
|
|
this.GetEarningsList = result.GetEarningsList;
|
|
|
|
|
getEarings(ActionContextID) {
|
|
|
|
|
console.log("getEarings");
|
|
|
|
|
|
|
|
|
|
// this.deductionReq.P_ACTION_CONTEXT_ID=ActionContextID;
|
|
|
|
|
// this.deductionReq.P_PAGE_NUM=1;
|
|
|
|
|
// this.deductionReq.P_PAGE_LIMIT=100;
|
|
|
|
|
const request = {
|
|
|
|
|
P_ACTION_CONTEXT_ID: 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);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleGetEaringsResult(result) {
|
|
|
|
|
if (result.GetEarningsList != null) {
|
|
|
|
|
this.GetEarningsList = result.GetEarningsList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDeduction(ActionContextID){
|
|
|
|
|
console.log("getDeduction");
|
|
|
|
|
const request ={
|
|
|
|
|
P_ACTION_CONTEXT_ID:ActionContextID,
|
|
|
|
|
P_PAGE_NUM:1,
|
|
|
|
|
P_PAGE_LIMIT:100
|
|
|
|
|
}
|
|
|
|
|
// 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)=>
|
|
|
|
|
{
|
|
|
|
|
this.handleGetDeductionResult(result);
|
|
|
|
|
|
|
|
|
|
getDeduction(ActionContextID) {
|
|
|
|
|
console.log("getDeduction");
|
|
|
|
|
const request = {
|
|
|
|
|
P_ACTION_CONTEXT_ID: ActionContextID,
|
|
|
|
|
P_PAGE_NUM: 1,
|
|
|
|
|
P_PAGE_LIMIT: 100
|
|
|
|
|
}
|
|
|
|
|
// 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) => {
|
|
|
|
|
this.handleGetDeductionResult(result);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleGetDeductionResult(result){
|
|
|
|
|
handleGetDeductionResult(result) {
|
|
|
|
|
if (result.GetDeductionsList != null) {
|
|
|
|
|
this.GetDeductionsList = result.GetDeductionsList;
|
|
|
|
|
}
|
|
|
|
|
@ -335,6 +333,6 @@ getDeduction(ActionContextID){
|
|
|
|
|
} else {
|
|
|
|
|
if (this.infiniteScroll) this.infiniteScroll.complete();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|