general enhancments
commit
c9e7e5a851
@ -1,31 +1,32 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
||||
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: '', redirectTo: 'authentication/login', pathMatch: 'full' },
|
||||
{
|
||||
path: 'authentication', loadChildren: './authentication/authentication.module#AuthenticationPageModule'},
|
||||
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
|
||||
{ path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' },
|
||||
{ path: 'vacation-rule', loadChildren: './vacation-rule/vacation-rule.module#VacationRulePageModule' },
|
||||
{ path: 'accrual-balances', loadChildren: './accrual-balances/accrual-balances.module#AccrualBalancesPageModule' },
|
||||
{ path: 'my-team', loadChildren: './my-team/my-team.module#MyTeamPageModule' },
|
||||
{ path: 'attendance', loadChildren: './attendance/attendance.module#AttendancePageModule' },
|
||||
{ path: 'eit', loadChildren: './eit/eit.module#EITPageModule' },
|
||||
{ path: 'absence', loadChildren: './absence/absence.module#AbsencePageModule' },
|
||||
{ path: 'notification', loadChildren: './notification/notification.module#NotificationPageModule' },
|
||||
{ path: 'my-specialist', loadChildren: './my-specialist/my-specialist.module#MySpecialistPageModule' },
|
||||
{ path: 'my-subordinate', loadChildren: './my-subordinate/my-subordinate.module#MySubordinatePageModule' },
{ path: 'time-card', loadChildren: './time-card/time-card.module#TimeCardPageModule' }
|
||||
import { NgModule } from '@angular/core';
|
||||
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
||||
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
/*RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules}),*/
|
||||
RouterModule.forRoot(routes),
|
||||
],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class AppRoutingModule { }
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: '', redirectTo: 'authentication/login', pathMatch: 'full' },
|
||||
{
|
||||
path: 'authentication', loadChildren: './authentication/authentication.module#AuthenticationPageModule'},
|
||||
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
|
||||
{ path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' },
|
||||
{ path: 'vacation-rule', loadChildren: './vacation-rule/vacation-rule.module#VacationRulePageModule' },
|
||||
{ path: 'accrual-balances', loadChildren: './accrual-balances/accrual-balances.module#AccrualBalancesPageModule' },
|
||||
{ path: 'my-team', loadChildren: './my-team/my-team.module#MyTeamPageModule' },
|
||||
{ path: 'attendance', loadChildren: './attendance/attendance.module#AttendancePageModule' },
|
||||
{ path: 'eit', loadChildren: './eit/eit.module#EITPageModule' },
|
||||
{ path: 'absence', loadChildren: './absence/absence.module#AbsencePageModule' },
|
||||
{ path: 'notification', loadChildren: './notification/notification.module#NotificationPageModule' },
|
||||
{ path: 'my-specialist', loadChildren: './my-specialist/my-specialist.module#MySpecialistPageModule' },
|
||||
{ path: 'my-subordinate', loadChildren: './my-subordinate/my-subordinate.module#MySubordinatePageModule' },
|
||||
{ path: 'time-card', loadChildren: './time-card/time-card.module#TimeCardPageModule' },
|
||||
{ path: 'payslip', loadChildren: './payslip/payslip.module#PayslipPageModule' }
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
/*RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules}),*/
|
||||
RouterModule.forRoot(routes),
|
||||
],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class AppRoutingModule { }
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
<ion-header>
|
||||
<ion-toolbar class="header-toolbar">
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button color="light" class="btnBack" defaultHref="/home"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title color="light" >{{ts.trPK('payslip','deductions')}}</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content padding>
|
||||
<ion-card *ngIf="GetDeductionsList !='' " >
|
||||
<ion-card-header class="boxHdr">
|
||||
<div class="hrTitle"> {{ts.trPK('payslip','deductions')}} </div>
|
||||
</ion-card-header>
|
||||
<ion-card-content>
|
||||
<div>
|
||||
<ion-grid>
|
||||
<ion-row *ngFor="let list of GetDeductionsList" >
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{list.ELEMENT_NAME}}</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{list.AMOUNT}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
|
||||
</ion-grid>
|
||||
|
||||
</div>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
</ion-content>
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DeductionsComponent } from './deductions.component';
|
||||
|
||||
describe('DeductionsComponent', () => {
|
||||
let component: DeductionsComponent;
|
||||
let fixture: ComponentFixture<DeductionsComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ DeductionsComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(DeductionsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,51 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
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 { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
|
||||
import { HomeComponent } from '../home/home.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-deductions',
|
||||
templateUrl: './deductions.component.html',
|
||||
styleUrls: ['./deductions.component.scss'],
|
||||
})
|
||||
export class DeductionsComponent implements OnInit {
|
||||
actionContextID:any;
|
||||
GetDeductionsList:any='';
|
||||
constructor(
|
||||
public payslipService:PayslipService,
|
||||
public ts: TranslatorService,
|
||||
public common: CommonService,
|
||||
public sharedData: SharedDataService,) {
|
||||
this.actionContextID = this.common.sharedService.getSharedData(
|
||||
HomeComponent.ACTION_CONTEXT_ID,
|
||||
false
|
||||
);
|
||||
}
|
||||
ngOnInit() {
|
||||
this.getDeduction(this.actionContextID );
|
||||
}
|
||||
|
||||
|
||||
getDeduction(ActionContextID){
|
||||
const request = {
|
||||
P_ACTION_CONTEXT_ID: ActionContextID,
|
||||
P_PAGE_NUM: 1,
|
||||
P_PAGE_LIMIT: 1000
|
||||
};
|
||||
|
||||
this.payslipService.getDeduction(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
|
||||
{
|
||||
this.handleGetDeductionResult(result);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
handleGetDeductionResult(result){
|
||||
if (result.GetDeductionsList != null) {
|
||||
this.GetDeductionsList = result.GetDeductionsList;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
<ion-header>
|
||||
<ion-toolbar class="header-toolbar">
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button color="light" class="btnBack" defaultHref="/home"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title color="light" >{{ts.trPK('payslip','earnings')}}</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content padding>
|
||||
|
||||
|
||||
<ion-card *ngIf="GetEarningsList !='' " >
|
||||
<ion-card-header class="boxHdr">
|
||||
<div class="hrTitle"> {{ts.trPK('payslip','earnings')}} </div>
|
||||
</ion-card-header>
|
||||
<ion-card-content>
|
||||
<div>
|
||||
<ion-grid>
|
||||
<ion-row *ngFor="let list of GetEarningsList" >
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{list.ELEMENT_NAME}}</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{list.AMOUNT}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
|
||||
</ion-grid>
|
||||
|
||||
</div>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
</ion-content>
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EarningsComponent } from './earnings.component';
|
||||
|
||||
describe('EarningsComponent', () => {
|
||||
let component: EarningsComponent;
|
||||
let fixture: ComponentFixture<EarningsComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EarningsComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EarningsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,51 @@
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
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 { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
|
||||
import { HomeComponent } from '../home/home.component';
|
||||
@Component({
|
||||
selector: 'app-earnings',
|
||||
templateUrl: './earnings.component.html',
|
||||
styleUrls: ['./earnings.component.scss'],
|
||||
})
|
||||
export class EarningsComponent implements OnInit {
|
||||
GetEarningsList:any='';
|
||||
actionContextID:any;
|
||||
constructor(
|
||||
public payslipService:PayslipService,
|
||||
public ts: TranslatorService,
|
||||
public common: CommonService,
|
||||
public sharedData: SharedDataService,) {
|
||||
this.actionContextID = this.common.sharedService.getSharedData(
|
||||
HomeComponent.ACTION_CONTEXT_ID,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getEarings(this.actionContextID)
|
||||
|
||||
}
|
||||
getEarings(ActionContextID){
|
||||
const request = {
|
||||
P_ACTION_CONTEXT_ID: ActionContextID,
|
||||
P_PAGE_NUM: 1,
|
||||
P_PAGE_LIMIT: 1000
|
||||
};
|
||||
|
||||
this.payslipService.getEarings(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
|
||||
{
|
||||
this.handleGetEaringsResult(result);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
handleGetEaringsResult(result){
|
||||
if (result.GetEarningsList != null) {
|
||||
this.GetEarningsList = result.GetEarningsList;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,221 @@
|
||||
<ion-header>
|
||||
<ion-toolbar class="header-toolbar">
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button color="light" class="btnBack" defaultHref="/home"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title color="light" >{{ts.trPK('payslip','title')}}</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content padding>
|
||||
|
||||
<ion-item>
|
||||
<ion-label>choose payslip</ion-label>
|
||||
<ion-select (ionChange)="showInfo($event)" okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="choosePayslip">
|
||||
<ion-select-option value="{{i}}" *ngFor="let options of GetPayslipList; let i=index">{{options.PAYSLIP_CHOICE}} </ion-select-option>
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
|
||||
|
||||
<!-- <ion-list *ngIf="showPaySlip !=''" >
|
||||
<ion-item>
|
||||
<ion-row><ion-label>PERIOD NAME</ion-label><ion-label>{{showPaySlip.PERIOD_NAME}}</ion-label></ion-row>
|
||||
<ion-row><ion-label>PERIOD START DATE</ion-label><ion-label>{{showPaySlip.PERIOD_START_DATE}}</ion-label> </ion-row>
|
||||
<ion-row> <ion-label>PERIOD END DATE</ion-label><ion-label>{{showPaySlip.PERIOD_END_DATE}}</ion-label> </ion-row>
|
||||
</ion-item>
|
||||
</ion-list> -->
|
||||
|
||||
|
||||
|
||||
<ion-card *ngIf="showPaySlip !=''">
|
||||
<ion-card-header class="boxHdr">
|
||||
<div class="hrTitle"> {{ts.trPK('payslip','payroll-info')}} </div>
|
||||
</ion-card-header>
|
||||
<ion-card-content>
|
||||
<div>
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for=""> {{ts.trPK('payslip','peroid-name')}}
|
||||
|
||||
</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{showPaySlip.PERIOD_NAME}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('payslip','start-date')}}
|
||||
</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{showPaySlip.PERIOD_START_DATE}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('payslip','end-date')}}
|
||||
</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{showPaySlip.PERIOD_END_DATE}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
</ion-grid>
|
||||
|
||||
</div>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
|
||||
<ion-card *ngIf="GetSummaryOfPaymentList !='' " >
|
||||
<ion-card-header class="boxHdr">
|
||||
<div class="hrTitle"> {{ts.trPK('payslip','summary-payment')}} </div>
|
||||
</ion-card-header>
|
||||
<ion-card-content>
|
||||
<div>
|
||||
<ion-grid>
|
||||
<ion-row >
|
||||
<ion-col class="colBold">
|
||||
<label for=""> {{ts.trPK('payslip','deductions-Amount')}}
|
||||
|
||||
</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{GetSummaryOfPaymentList.TOTAL_DEDUCTIONS_AMOUNT}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('payslip','deductions-percentage')}}
|
||||
</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{GetSummaryOfPaymentList.TOTAL_DEDUCTIONS_PERCENTAGE}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('payslip','earings-Amount')}}
|
||||
</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{GetSummaryOfPaymentList.TOTAL_EARNINGS_AMOUNT}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('payslip','earings-percentage')}}
|
||||
</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{GetSummaryOfPaymentList.TOTAL_EARNINGS_PERCENTAGE}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('payslip','pay-Amount')}}
|
||||
</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{GetSummaryOfPaymentList.TOTAL_PAY_AMOUNT}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('payslip','pay-percentage')}}
|
||||
</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{GetSummaryOfPaymentList.TOTAL_PAY_PERCENTAGE}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
</ion-grid>
|
||||
|
||||
</div>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
<ion-card *ngIf="GetPaymentInformationList !='' " >
|
||||
<ion-card-header class="boxHdr">
|
||||
<div class="hrTitle"> {{ts.trPK('payslip','payment-information')}} </div>
|
||||
</ion-card-header>
|
||||
<ion-card-content>
|
||||
<div>
|
||||
<ion-grid>
|
||||
<ion-row >
|
||||
<ion-col class="colBold">
|
||||
<label for=""> {{ts.trPK('payslip','payment-method')}}
|
||||
|
||||
</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{GetPaymentInformationList.PAYMENT_METHOD_NAME}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('payslip','bank-name')}}
|
||||
</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{GetPaymentInformationList.BANK_NAME}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('payslip','branch-name')}}
|
||||
</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{GetPaymentInformationList.BRANCH_NAME}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('payslip','account-no')}}
|
||||
</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{GetPaymentInformationList.ACCOUNT_NUMBER}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('payslip','amount')}}
|
||||
</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{GetPaymentInformationList.AMOUNT}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
|
||||
</ion-grid>
|
||||
|
||||
</div>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
|
||||
<ion-row *ngIf="showPaySlip !=''" style="text-align: center;">
|
||||
<ion-col class="greenTxt" col-6>
|
||||
<button ion-button block class="notColBtn" (click)="openEarings()">
|
||||
<p>{{ts.trPK('payslip','earnings')}}</p>
|
||||
<ion-img class="serviceItemImg" src="../assets/imgs/details.png"></ion-img>
|
||||
</button>
|
||||
</ion-col>
|
||||
<ion-col class="greenTxt" col-6>
|
||||
<button ion-button block class="notColBtn" (click)="openDeductions()">
|
||||
<p>{{ts.trPK('payslip','deductions')}}</p>
|
||||
<ion-img class="serviceItemImg" src="../assets/imgs/details.png"></ion-img>
|
||||
</button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
</ion-content>
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HomeComponent } from './home.component';
|
||||
|
||||
describe('HomeComponent', () => {
|
||||
let component: HomeComponent;
|
||||
let fixture: ComponentFixture<HomeComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ HomeComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(HomeComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,137 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
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';
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
templateUrl: './home.component.html',
|
||||
styleUrls: ['./home.component.scss'],
|
||||
})
|
||||
export class HomeComponent implements OnInit {
|
||||
selEmp: string;
|
||||
respID: number;
|
||||
selMenu: MenuResponse;
|
||||
GetPayslipList:any='';
|
||||
GetSummaryOfPaymentList:any='';
|
||||
GetPaymentInformationList:any='';
|
||||
showPaySlip:any=[];
|
||||
ActionContextID:any;
|
||||
public static ACTION_CONTEXT_ID = "passActionContectID";
|
||||
|
||||
constructor(
|
||||
public payslipService:PayslipService,
|
||||
public ts: TranslatorService,
|
||||
public common: CommonService,
|
||||
public sharedData: SharedDataService,
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
console.log("test");
|
||||
|
||||
this.selEmp = this.common.sharedService.getSharedData(
|
||||
MenuResponse.SHARED_SEL_EMP,
|
||||
false
|
||||
);
|
||||
console.log(" this.selEmp" + this.selEmp);
|
||||
this.respID = this.common.sharedService.getSharedData(
|
||||
MenuResponse.SHARED_SEL_RESP_ID,
|
||||
false
|
||||
);
|
||||
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.getPayslip();
|
||||
}
|
||||
|
||||
getPayslip(){
|
||||
const request = {
|
||||
P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,//'125346',//this.selEmp,
|
||||
P_MENU_TYPE: this.selMenu.List_Menu.MENU_TYPE,// '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);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
handleRespondGetPayslipResult(result){
|
||||
|
||||
if (result.GetPayslipList != null) {
|
||||
this.GetPayslipList = result.GetPayslipList;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// showPaymentInfo
|
||||
showInfo(event){
|
||||
console.log(event.detail.value);
|
||||
const index = parseInt(event.detail.value);
|
||||
this.showPaySlip =this.GetPayslipList[index];
|
||||
this.ActionContextID=this.GetPayslipList[index].ACTION_CONTEXT_ID;
|
||||
this.common.sharedService.setSharedData(this.ActionContextID,HomeComponent.ACTION_CONTEXT_ID);
|
||||
this.getSummeryOfPayment(this.ActionContextID);
|
||||
this.getPaymentInfo(this.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];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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[0];
|
||||
}
|
||||
}
|
||||
|
||||
openEarings(){
|
||||
this.common.openEarningsPage();
|
||||
|
||||
}
|
||||
openDeductions(){
|
||||
this.common.openDeductionsPage();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
// import { Request } from './request';
|
||||
// export class PayslipRequest extends Request{
|
||||
|
||||
// }
|
||||
@ -0,0 +1,47 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
import {EarningsComponent}from './earnings/earnings.component'
|
||||
import {DeductionsComponent} from './deductions/deductions.component'
|
||||
import { PayslipPage } from './payslip.page';
|
||||
import {HomeComponent} from './home/home.component'
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: PayslipPage,
|
||||
children: [
|
||||
{
|
||||
path: 'home',
|
||||
component: HomeComponent
|
||||
},
|
||||
{
|
||||
path: 'Deductions',
|
||||
component: DeductionsComponent
|
||||
},
|
||||
{
|
||||
path: 'Earnings',
|
||||
component: EarningsComponent
|
||||
},
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
RouterModule.forChild(routes)
|
||||
],
|
||||
providers:[
|
||||
HomeComponent,
|
||||
EarningsComponent,
|
||||
DeductionsComponent
|
||||
],
|
||||
declarations: [PayslipPage,HomeComponent,EarningsComponent,DeductionsComponent]
|
||||
})
|
||||
export class PayslipPageModule {}
|
||||
@ -0,0 +1,3 @@
|
||||
<ion-content>
|
||||
<ion-router-outlet></ion-router-outlet>
|
||||
</ion-content>
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { PayslipPage } from './payslip.page';
|
||||
|
||||
describe('PayslipPage', () => {
|
||||
let component: PayslipPage;
|
||||
let fixture: ComponentFixture<PayslipPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ PayslipPage ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(PayslipPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-payslip',
|
||||
templateUrl: './payslip.page.html',
|
||||
styleUrls: ['./payslip.page.scss'],
|
||||
})
|
||||
export class PayslipPage implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { PayslipService } from './payslip.service';
|
||||
|
||||
describe('PayslipService', () => {
|
||||
beforeEach(() => TestBed.configureTestingModule({}));
|
||||
|
||||
it('should be created', () => {
|
||||
const service: PayslipService = TestBed.get(PayslipService);
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,54 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ConnectorService } from '../../hmg-common/services/connector/connector.service';
|
||||
import { AuthenticationService } from '../../hmg-common/services/authentication/authentication.service';
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PayslipService {
|
||||
public static getPayslip ="Services/ERP.svc/REST/GET_PAYSLIP";
|
||||
public static getSummaryOFPayment ="Services/ERP.svc/REST/GET_SUMMARY_OF_PAYMENT";
|
||||
public static getPaymentInfo ="Services/ERP.svc/REST/GET_PAYMENT_INFORMATION";
|
||||
public static getEarnings ="Services/ERP.svc/REST/GET_EARNINGS";
|
||||
public static getDeduction ="Services/ERP.svc/REST/GET_DEDUCTIONS";
|
||||
|
||||
constructor(
|
||||
public api: ConnectorService,
|
||||
public authService: AuthenticationService,
|
||||
) { }
|
||||
|
||||
|
||||
public getPayslip(PayslipRequest: any, onError?: any,errorLabel?: string): Observable<any> {
|
||||
const request = PayslipRequest;
|
||||
this.authService.authenticateRequest(request);
|
||||
return this.api.post(PayslipService.getPayslip,request,onError,errorLabel);
|
||||
}
|
||||
public getSummeryOFPayment(PayslipRequest: any, onError?: any,errorLabel?: string): Observable<any> {
|
||||
const request = PayslipRequest;
|
||||
this.authService.authenticateRequest(request);
|
||||
return this.api.post(PayslipService.getSummaryOFPayment,request,onError,errorLabel);
|
||||
}
|
||||
|
||||
public getPaymentInfo(PayslipRequest: any, onError?: any,errorLabel?: string): Observable<any> {
|
||||
const request = PayslipRequest;
|
||||
this.authService.authenticateRequest(request);
|
||||
return this.api.post(PayslipService.getPaymentInfo,request,onError,errorLabel);
|
||||
}
|
||||
public getEarings(PayslipRequest: any, onError?: any,errorLabel?: string): Observable<any> {
|
||||
const request = PayslipRequest;
|
||||
this.authService.authenticateRequest(request);
|
||||
return this.api.post(PayslipService.getEarnings,request,onError,errorLabel);
|
||||
}
|
||||
|
||||
public getDeduction(PayslipRequest: any, onError?: any,errorLabel?: string): Observable<any> {
|
||||
const request = PayslipRequest;
|
||||
this.authService.authenticateRequest(request);
|
||||
return this.api.post(PayslipService.getDeduction,request,onError,errorLabel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1 +0,0 @@
|
||||
,HMG/Mohamed.Mekawy,CS-1F-MOHAMED,24.10.2019 14:24,file:///C:/Users/mohamed.mekawy/AppData/Roaming/LibreOffice/4;
|
||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue