Merge branch 'master' of https://hmg.git.cloudforge.com/mohemmionic5
commit
6b4e95bbe1
@ -0,0 +1,33 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
import {AccrualService} from './services/accrual.service';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { AccrualBalancesPage } from './accrual-balances.page';
|
||||||
|
import { HomeComponent } from './home/home.component';
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: AccrualBalancesPage,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'home',
|
||||||
|
component: HomeComponent
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
RouterModule.forChild(routes)
|
||||||
|
],
|
||||||
|
declarations: [AccrualBalancesPage, HomeComponent],
|
||||||
|
providers:[AccrualService]
|
||||||
|
})
|
||||||
|
export class AccrualBalancesPageModule {}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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 { AccrualBalancesPage } from './accrual-balances.page';
|
||||||
|
|
||||||
|
describe('AccrualBalancesPage', () => {
|
||||||
|
let component: AccrualBalancesPage;
|
||||||
|
let fixture: ComponentFixture<AccrualBalancesPage>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ AccrualBalancesPage ],
|
||||||
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(AccrualBalancesPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-accrual-balances',
|
||||||
|
templateUrl: './accrual-balances.page.html',
|
||||||
|
styleUrls: ['./accrual-balances.page.scss'],
|
||||||
|
})
|
||||||
|
export class AccrualBalancesPage implements OnInit {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
<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('accrualBalances','accrualBalances')}}</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
<ion-content padding>
|
||||||
|
<div class="tipsPadding" [innerHTML]="ts.trPK('accrualBalances','tip')"></div>
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>{{ts.trPK('accrualBalances','selectDate')}}</ion-label>
|
||||||
|
<ion-datetime [(ngModel)]="Sdate" min="1900" max="2100" displayFormat="MMM/DD/YYYY " placeholder="MM/DD/YYYY"
|
||||||
|
(ionChange)="getAccrualBalance()"></ion-datetime>
|
||||||
|
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li *ngFor="let data of balance; let i=index">
|
||||||
|
<ion-card no-shadow text-center >
|
||||||
|
<div class="content-line accuralBox">
|
||||||
|
<div class="accuralImage"><img src="../assets/imgs/accrual.png" /></div>
|
||||||
|
<div class="accuralTxt"> <p class="balanceVal boldTxt"> {{data.ACCRUAL_NET_ENTITLEMENT}} </p>
|
||||||
|
|
||||||
|
<p class="balanceTxt">{{data.ACCURAL_PLAN_NAME}}</p></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</ion-card>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</ion-content>
|
||||||
@ -0,0 +1,89 @@
|
|||||||
|
ul{
|
||||||
|
padding: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
li{
|
||||||
|
|
||||||
|
|
||||||
|
ion-card ,.card-md,.card-ios{
|
||||||
|
position: relative;
|
||||||
|
box-shadow: none;
|
||||||
|
-webkit-box-shadow:none;
|
||||||
|
-moz-box-shadow: none;
|
||||||
|
border: 2px solid var(--gray);
|
||||||
|
margin: auto !important;
|
||||||
|
color: var(--darkgray);
|
||||||
|
border-radius: 10px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
li:nth-child(3n-1),
|
||||||
|
li:nth-child(3n){
|
||||||
|
|
||||||
|
display: inline-block;
|
||||||
|
width: calc(50% - 0px);
|
||||||
|
|
||||||
|
div {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
p.balanceVal{
|
||||||
|
color:var(--secondary);
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
width: 90px;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
.accuralImage{
|
||||||
|
|
||||||
|
min-height: auto;
|
||||||
|
margin-top:60px;
|
||||||
|
}
|
||||||
|
.boldTxt{position:absolute; left:0px;top:20px; width:100%;}
|
||||||
|
p.balanceTxt{
|
||||||
|
font-size: 16px;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
li:nth-child(3n+1){
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 140px;
|
||||||
|
overflow: visible;
|
||||||
|
div.content-line {
|
||||||
|
p.balanceVal{
|
||||||
|
color:var(--secondary);
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
width: 100px;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
.accuralImage{
|
||||||
|
|
||||||
|
float:left;
|
||||||
|
width:50%;
|
||||||
|
}
|
||||||
|
.accuralTxt{
|
||||||
|
|
||||||
|
float:left;
|
||||||
|
width:50%;
|
||||||
|
}
|
||||||
|
p.balanceTxt{
|
||||||
|
font-size: 16px;
|
||||||
|
padding: 5px;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.content-line.accuralBox {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
@ -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,60 @@
|
|||||||
|
import { Component, OnInit } from "@angular/core";
|
||||||
|
import { CommonService } from "src/app/hmg-common/services/common/common.service";
|
||||||
|
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
|
||||||
|
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
|
||||||
|
import { AccrualService } from "../services/accrual.service";
|
||||||
|
import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user";
|
||||||
|
@Component({
|
||||||
|
selector: "app-home",
|
||||||
|
templateUrl: "./home.component.html",
|
||||||
|
styleUrls: ["./home.component.scss"]
|
||||||
|
})
|
||||||
|
export class HomeComponent implements OnInit {
|
||||||
|
Sdate: any;
|
||||||
|
emp_no: any;
|
||||||
|
balance:any;
|
||||||
|
constructor(
|
||||||
|
public ts: TranslatorService,
|
||||||
|
public cs: CommonService,
|
||||||
|
public accrualService: AccrualService,
|
||||||
|
public authService:AuthenticationService
|
||||||
|
) {}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.Sdate = new Date().toISOString();
|
||||||
|
|
||||||
|
this.getUserDetails();
|
||||||
|
}
|
||||||
|
private getUserDetails(){
|
||||||
|
this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
|
||||||
|
if (user) {
|
||||||
|
this.emp_no=user.EMPLOYEE_NUMBER;
|
||||||
|
this.getAccrualBalance();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
private 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
import { Injectable } from "@angular/core";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
|
import { ConnectorService } from "src/app/hmg-common/services/connector/connector.service";
|
||||||
|
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
|
||||||
|
@Injectable({
|
||||||
|
providedIn: "root"
|
||||||
|
})
|
||||||
|
export class AccrualService {
|
||||||
|
public static GET_ACCRUAL_BALANCE =
|
||||||
|
"Services/ERP.svc/REST/GET_ACCRUAL_BALANCES";
|
||||||
|
constructor(
|
||||||
|
public con: ConnectorService,
|
||||||
|
public authService: AuthenticationService
|
||||||
|
) {}
|
||||||
|
public getAccrualBalances(balance: any, onError?: any, errorLabel?: string) {
|
||||||
|
const request = balance;
|
||||||
|
this.authService.authenticateRequest(request);
|
||||||
|
return this.con.post(
|
||||||
|
AccrualService.GET_ACCRUAL_BALANCE,
|
||||||
|
request,
|
||||||
|
onError,
|
||||||
|
errorLabel
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { ServiceService } from './service.service';
|
||||||
|
|
||||||
|
describe('ServiceService', () => {
|
||||||
|
beforeEach(() => TestBed.configureTestingModule({}));
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
const service: ServiceService = TestBed.get(ServiceService);
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -1,25 +1,26 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{ path: '', redirectTo: 'authentication/login', pathMatch: 'full' },
|
||||||
|
{
|
||||||
|
path: 'authentication', loadChildren: './authentication/authentication.module#AuthenticationPageModule',
|
||||||
|
data: { preload: true, delay: 1000 }
|
||||||
|
},
|
||||||
|
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
|
||||||
|
{ path: 'sms-page', loadChildren: './authentication/sms-page/sms-page.module#SmsPagePageModule' },
|
||||||
|
{ 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' }
|
||||||
|
|
||||||
const routes: Routes = [
|
|
||||||
{ path: '', redirectTo: 'authentication/login', pathMatch: 'full' },
|
|
||||||
{
|
|
||||||
path: 'authentication', loadChildren: './authentication/authentication.module#AuthenticationPageModule',
|
];
|
||||||
data: { preload: true, delay: 1000 }
|
|
||||||
},
|
@NgModule({
|
||||||
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
|
imports: [
|
||||||
{ path: 'sms-page', loadChildren: './authentication/sms-page/sms-page.module#SmsPagePageModule' },
|
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
|
||||||
{ path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' },
|
],
|
||||||
{ path: 'vacation-rule', loadChildren: './vacation-rule/vacation-rule.module#VacationRulePageModule' }
|
exports: [RouterModule]
|
||||||
|
})
|
||||||
|
export class AppRoutingModule { }
|
||||||
|
|
||||||
];
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [
|
|
||||||
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
|
|
||||||
],
|
|
||||||
exports: [RouterModule]
|
|
||||||
})
|
|
||||||
export class AppRoutingModule { }
|
|
||||||
|
|||||||
@ -1,64 +1,63 @@
|
|||||||
|
|
||||||
<!-- <ion-nav [root]="rootPage" #mycontent swipeBackEnabled="false"></ion-nav> -->
|
<!-- <ion-nav [root]="rootPage" #mycontent swipeBackEnabled="false"></ion-nav> -->
|
||||||
<!-- (ionWillOpen)="menuOpened(true)" -->
|
<!-- (ionWillOpen)="menuOpened(true)" -->
|
||||||
<ion-app [dir]="direction">
|
<ion-app [dir]="direction">
|
||||||
<ion-split-pane>
|
<ion-split-pane>
|
||||||
<ion-menu [side]=" direction === 'rtl' ? 'end' : 'start'" [swipeGesture]="false" >
|
<ion-menu [side]=" direction === 'rtl' ? 'end' : 'start'" [swipeGesture]="false">
|
||||||
<ion-content class="sidebar-menu" >
|
<ion-content class="sidebar-menu">
|
||||||
<div class="header-div">
|
<div class="header-div">
|
||||||
<div class="centerDiv">
|
<div class="centerDiv">
|
||||||
<p class="TxtPlace">{{ts.trPK('home','hello')}}, {{User_name_Emp}}</p>
|
<p class="TxtPlace">{{ts.trPK('home','hello')}}, {{User_name_Emp}}</p>
|
||||||
<div> <img src="{{user_image}}" class="profileImg" ></div>
|
<div> <img src="{{user_image}}" class="profileImg"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-thumbnail slot="start" class="menu-thumb">
|
<ion-thumbnail slot="start" class="menu-thumb">
|
||||||
<img width="30" src="../assets/imgs/bell.png" item-left >
|
<img width="30" src="../assets/imgs/bell.png" item-left>
|
||||||
</ion-thumbnail>
|
</ion-thumbnail>
|
||||||
<ion-label>
|
<ion-label>
|
||||||
{{ts.trPK('home','worklist')}}
|
{{ts.trPK('home','worklist')}}
|
||||||
|
|
||||||
<ion-badge item-end>{{notBadge}}</ion-badge>
|
<ion-badge item-end>{{notBadge}}</ion-badge>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
<!-- <button class="menu-item" ion-item menuClose ion-item (click)="goToWorkListPage()" >
|
<!-- <button class="menu-item" ion-item menuClose ion-item (click)="goToWorkListPage()" >
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</button> -->
|
</button> -->
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item (click)="profile()">
|
<ion-item (click)="profile()">
|
||||||
<ion-thumbnail slot="start" class="menu-thumb">
|
<ion-thumbnail slot="start" class="menu-thumb">
|
||||||
<img width="30" src="../assets/imgs/username.png" item-left >
|
<img width="30" src="../assets/imgs/username.png" item-left>
|
||||||
</ion-thumbnail>
|
</ion-thumbnail>
|
||||||
<ion-label>
|
<ion-label>
|
||||||
{{ts.trPK('userProfile','title')}}
|
{{ts.trPK('userProfile','title')}}
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item (click)="logout();">
|
<ion-item (click)="logout();">
|
||||||
|
|
||||||
|
|
||||||
<ion-thumbnail slot="start" class="menu-thumb">
|
<ion-thumbnail slot="start" class="menu-thumb">
|
||||||
<img width="30" src="../assets/imgs/signout.png" item-left >
|
<img width="30" src="../assets/imgs/signout.png" item-left>
|
||||||
</ion-thumbnail>
|
</ion-thumbnail>
|
||||||
<ion-label>
|
<ion-label>
|
||||||
{{ts.trPK('home','logout')}}
|
{{ts.trPK('home','logout')}}
|
||||||
</ion-label>
|
</ion-label>
|
||||||
|
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
|
|
||||||
|
|
||||||
<div class="menuFooter">
|
<div class="menuFooter">
|
||||||
<div> <img src="{{companyUrl}}" class="CompanyImg" ></div>
|
<div> <img src="{{companyUrl}}" class="CompanyImg"></div>
|
||||||
<p class="companyTxt">{{companyDesc}}</p>
|
<p class="companyTxt">{{companyDesc}}</p>
|
||||||
</div>
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
||||||
</ion-menu>
|
</ion-menu>
|
||||||
|
|
||||||
<ion-router-outlet main></ion-router-outlet>
|
<ion-router-outlet main></ion-router-outlet>
|
||||||
|
|
||||||
</ion-split-pane>
|
</ion-split-pane>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue