|
|
|
|
@ -42,6 +42,8 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
sliderOne: any;
|
|
|
|
|
payslipIndex: any;
|
|
|
|
|
data: any;
|
|
|
|
|
public paySlipYearsData: any;
|
|
|
|
|
public paySlipMonthsData: any;
|
|
|
|
|
public direction: string;
|
|
|
|
|
@ViewChild('slides') slides: IonSlides;
|
|
|
|
|
@ViewChild('slideWithNav') slideWithNav: IonSlides;
|
|
|
|
|
@ -52,6 +54,9 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
autoplay: true
|
|
|
|
|
};
|
|
|
|
|
public userData: any;
|
|
|
|
|
public selectedYear: any;
|
|
|
|
|
public selectedMonth: any;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
|
|
|
|
|
public options = {
|
|
|
|
|
@ -61,8 +66,6 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
};
|
|
|
|
|
gaugeType = "full";
|
|
|
|
|
|
|
|
|
|
// gaugeValue = 11.200;
|
|
|
|
|
// gaugeLabel = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
@ -74,9 +77,7 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
public cs: CommonService,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
this.direction = TranslatorService.getCurrentDirection();
|
|
|
|
|
}
|
|
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
@ -84,128 +85,37 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
this.userData = this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA, false);
|
|
|
|
|
|
|
|
|
|
this.getPayslip();
|
|
|
|
|
// this.getProfile();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ngOnChanges(changes: SimpleChanges): void {
|
|
|
|
|
if (changes.inputData.currentValue) {
|
|
|
|
|
// update this.data here
|
|
|
|
|
|
|
|
|
|
// then chart is getting updated
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.chart.reinit();
|
|
|
|
|
}, 100);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
slideNext(object, slideView) {
|
|
|
|
|
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();
|
|
|
|
|
public callPayslipData() {
|
|
|
|
|
console.log(this.selectedYear);
|
|
|
|
|
console.log(this.selectedMonth);
|
|
|
|
|
if (this.selectedYear && this.selectedMonth) {
|
|
|
|
|
this.getDeduction();
|
|
|
|
|
this.getEarings();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_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);
|
|
|
|
|
const request = {};
|
|
|
|
|
this.payslipService.getPayslipPeriods(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
|
|
|
|
|
this.handleRespondGetPayslipResult(result.GetPayslipPeriodsList);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleRespondGetPayslipResult(result) {
|
|
|
|
|
|
|
|
|
|
if (result.GetPayslipList != null) {
|
|
|
|
|
this.GetPayslipList = result.GetPayslipList;
|
|
|
|
|
this.firstPayslip = this.GetPayslipList[0]
|
|
|
|
|
this.defultSelected = this.firstPayslip.PAYSLIP_CHOICE
|
|
|
|
|
}
|
|
|
|
|
this.showPaySlip = this.GetPayslipList[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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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) {
|
|
|
|
|
const request = {
|
|
|
|
|
P_ACTION_CONTEXT_ID: ActionContextID,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.payslipService.getSummeryOFPayment(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
|
|
|
|
|
this.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.data = {
|
|
|
|
|
|
|
|
|
|
labels: ['earingTotal', 'deductionTotal'],
|
|
|
|
|
datasets: [
|
|
|
|
|
{
|
|
|
|
|
data: [this.earingTotal, this.deductionTotal],
|
|
|
|
|
backgroundColor: [
|
|
|
|
|
'#43A6A0',
|
|
|
|
|
'#29B5BF',],
|
|
|
|
|
borderWidth: 2
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
if (result != null) {
|
|
|
|
|
this.paySlipYearsData = result.GetPayslipsYearList;
|
|
|
|
|
this.paySlipMonthsData = result.GetPayslipsMonthList
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getPaymentInfo(ActionContextID) {
|
|
|
|
|
const request = {
|
|
|
|
|
P_ACTION_CONTEXT_ID: ActionContextID,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.payslipService.getPaymentInfo(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
|
|
|
|
|
this.handleGetPaymentInfoResult(result);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleGetPaymentInfoResult(result) {
|
|
|
|
|
if (result.GetPaymentInformationList != null) {
|
|
|
|
|
this.GetPaymentInformationList = result.GetPaymentInformationList;
|
|
|
|
|
@ -214,22 +124,17 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
openEarings() {
|
|
|
|
|
this.common.openEarningsPage();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
openDeductions() {
|
|
|
|
|
this.common.openDeductionsPage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getEarings(ActionContextID) {
|
|
|
|
|
console.log("getEarings");
|
|
|
|
|
|
|
|
|
|
// this.deductionReq.P_ACTION_CONTEXT_ID=ActionContextID;
|
|
|
|
|
// this.deductionReq.P_PAGE_NUM=1;
|
|
|
|
|
// this.deductionReq.P_PAGE_LIMIT=100;
|
|
|
|
|
getEarings() {
|
|
|
|
|
const request = {
|
|
|
|
|
P_ACTION_CONTEXT_ID: ActionContextID,
|
|
|
|
|
P_PAGE_NUM: 1,
|
|
|
|
|
P_PAGE_LIMIT: 100
|
|
|
|
|
P_PAGE_LIMIT: 100,
|
|
|
|
|
P_MON: this.selectedMonth,
|
|
|
|
|
P_YEAR: this.selectedYear
|
|
|
|
|
}
|
|
|
|
|
this.doinfinitEarReq = request;
|
|
|
|
|
this.payslipService.getEarings(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
|
|
|
|
|
@ -242,22 +147,16 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
if (result.GetEarningsList != null) {
|
|
|
|
|
this.GetEarningsList = result.GetEarningsList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDeduction(ActionContextID) {
|
|
|
|
|
getDeduction() {
|
|
|
|
|
console.log("getDeduction");
|
|
|
|
|
const request = {
|
|
|
|
|
P_ACTION_CONTEXT_ID: ActionContextID,
|
|
|
|
|
P_PAGE_NUM: 1,
|
|
|
|
|
P_PAGE_LIMIT: 100
|
|
|
|
|
P_PAGE_LIMIT: 100,
|
|
|
|
|
P_MON: this.selectedMonth,
|
|
|
|
|
P_YEAR: this.selectedYear
|
|
|
|
|
}
|
|
|
|
|
// 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);
|
|
|
|
|
@ -271,68 +170,4 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
doInfiniteDeduction(infiniteScroll) {
|
|
|
|
|
//this.pageNum= this.pageNum + 1;
|
|
|
|
|
|
|
|
|
|
if (!this.IsReachEnd) {
|
|
|
|
|
this.payslipService.getDeduction(this.doinfiniteDedReq).subscribe(
|
|
|
|
|
(result: any) => {
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
this.doinfiniteDedReq.P_PAGE_NUM++;
|
|
|
|
|
if (this.common.hasData(result.GetDeductionsList)) {
|
|
|
|
|
result.GetDeductionsList.forEach(element => {
|
|
|
|
|
if (element.ROW_NUM == element.NO_OF_ROWS) {
|
|
|
|
|
this.IsReachEnd = true;
|
|
|
|
|
} else {
|
|
|
|
|
this.IsReachEnd = false;
|
|
|
|
|
}
|
|
|
|
|
this.GetDeductionsList.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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
doInfiniteEarning(infiniteScroll) {
|
|
|
|
|
//this.pageNum= this.pageNum + 1;
|
|
|
|
|
|
|
|
|
|
if (!this.IsReachEnd) {
|
|
|
|
|
this.payslipService.getEarings(this.doinfinitEarReq).subscribe(
|
|
|
|
|
(result: any) => {
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
this.doinfinitEarReq.P_PAGE_NUM++;
|
|
|
|
|
if (this.common.hasData(result.GetEarningsList)) {
|
|
|
|
|
result.GetEarningsList.forEach(element => {
|
|
|
|
|
if (element.ROW_NUM == element.NO_OF_ROWS) {
|
|
|
|
|
this.IsReachEnd = true;
|
|
|
|
|
} else {
|
|
|
|
|
this.IsReachEnd = false;
|
|
|
|
|
}
|
|
|
|
|
this.GetEarningsList.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();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|