diff --git a/Mohem/src/app/absence/submit-absence/submit-absence.component.ts b/Mohem/src/app/absence/submit-absence/submit-absence.component.ts
index 360a5175..4f331f9f 100644
--- a/Mohem/src/app/absence/submit-absence/submit-absence.component.ts
+++ b/Mohem/src/app/absence/submit-absence/submit-absence.component.ts
@@ -3,7 +3,7 @@ import { CommonService } from "src/app/hmg-common/services/common/common.service
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service";
import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response";
-import { ModalController ,IonSelectOption ,IonSelect } from "@ionic/angular";
+import { ModalController, IonSelectOption, IonSelect } from "@ionic/angular";
import { SubmitAbsenceService } from "../service/submit.absence.service";
import { AbsenceAttahcmentResponse } from "../models/abs.attach.response";
import { AbsenceListService } from "../service/service.service";
@@ -23,8 +23,8 @@ import { DatePicker } from "@ionic-native/date-picker/ngx";
import { Request } from '../../hmg-common/services/models/request';
// import { Request } from "../models/request";
import * as moment from "moment";
-import {ReplacementListComponent} from "../../vacation-rule/replacement-list/replacement-list.component";
-import {ReplacmentResponse} from "../models/replacment-response";
+import { ReplacementListComponent } from "../../vacation-rule/replacement-list/replacement-list.component";
+import { ReplacmentResponse } from "../models/replacment-response";
import { AbsenceResponse } from '../models/absence.response';
import { AbsenceReplacementListComponent } from '../absence-replacement-list/absence-replacement-list.component';
import { AbsenceNotificatonBodyResponse } from 'src/app/notification/models/AbsenceNotificationBodyRes';
@@ -99,8 +99,8 @@ export class SubmitAbsenceComponent implements OnInit {
this.direction = TranslatorService.getCurrentLanguageName();
////*new add*/////
/**********resubmit************ */
- this.getPassNotificationDetails = this.common.sharedService.getSharedData(AbsenceNotificatonBodyResponse.NOT_WORKLIST, true);
- this.getPassdirfromNotifiPage = this.common.sharedService.getSharedData('dirfromNotificationPage');
+ this.getPassNotificationDetails = this.common.sharedService.getSharedData(AbsenceNotificatonBodyResponse.NOT_WORKLIST, true);
+ this.getPassdirfromNotifiPage = this.common.sharedService.getSharedData('dirfromNotificationPage');
//this.getPassNotificationDetails = this.common.sharedService.getSharedData(AbsenceNotificatonBodyResponse.NOT_WORKLIST, true);
// this.getPassdirfromNotifiPage = this.navParams.get('dirfromNotificationPage');
if (this.getPassdirfromNotifiPage) {
@@ -110,8 +110,8 @@ export class SubmitAbsenceComponent implements OnInit {
this.notificationId = this.getPassNotificationDetails.NOTIFICATION_ID;
this.selEmp = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER;
this.respID = -999;
- this.submitAbsObjList = this.common.sharedService.getSharedData('submitAbsObjList');
- console.log()
+ this.submitAbsObjList = this.common.sharedService.getSharedData('submitAbsObjList');
+ console.log()
} else {
this.action = "CREATE";
this.selEmp = this.common.sharedService.getSharedData(
@@ -185,7 +185,7 @@ export class SubmitAbsenceComponent implements OnInit {
}
}
calcDay() {
- console.log("calcDay" );
+ console.log("calcDay");
let msg: string = "";
if (
this.startDate == undefined ||
@@ -233,7 +233,7 @@ export class SubmitAbsenceComponent implements OnInit {
this.totalDays = result.CalculateAbsenceDuration.P_ABSENCE_DAYS;
}
}
- async openSearch(){
+ async openSearch() {
const modal = await this.modalCtrl.create({
component: ReplacementListComponent,
keyboardClose: true,
@@ -259,7 +259,7 @@ export class SubmitAbsenceComponent implements OnInit {
console.log(data)
console.log(user);
if (data) {
- this.employeeName = user.EMPLOYEE_DISPLAY_NAME;
+ this.employeeName = user.EMPLOYEE_DISPLAY_NAME;
this.employeeID = user.USER_NAME;
this.employeeSel = this.employeeName + "," + this.employeeID;
}
@@ -278,12 +278,12 @@ export class SubmitAbsenceComponent implements OnInit {
}
public onTypeAbsenceChange() {
-
+
if (this.absenceType) {
let obj: any = this.absenceTypeList.find(
s => s.ABSENCE_ATTENDANCE_TYPE_ID == this.absenceType
);
-
+
if (obj) this.absenceTypeName = obj.DESC_FLEX_CONTEXT_CODE;
else this.absenceTypeName = null;
@@ -443,7 +443,7 @@ export class SubmitAbsenceComponent implements OnInit {
this.textInput = new TextInput(
feildsList[i].SEGMENT_PROMPT,
feildsList[i].APPLICATION_COLUMN_NAME,
- defaultVal,
+ defaultVal,
containerId,
defaultValText,
feildsList[i].MOBILE_ENABLED,
@@ -492,9 +492,9 @@ export class SubmitAbsenceComponent implements OnInit {
this.fillAbsStructure();
}
}
-
+
bindHtmlElemEvents(id, obj) {
-
+
const elem = document.getElementById(id);
elem.addEventListener("change", e => {
elem.classList.remove("requiredClassElm");
@@ -1039,20 +1039,20 @@ export class SubmitAbsenceComponent implements OnInit {
let elem = document.getElementById(
this.absenceDffresponse[i].APPLICATION_COLUMN_NAME
) as HTMLInputElement;
- let elemVal="";
+ let elemVal = "";
if (elem.classList.contains('onic-date')) {
- elemVal = (document.getElementById(
+ elemVal = (document.getElementById(
this.absenceDffresponse[i].APPLICATION_COLUMN_NAME
) as HTMLInputElement).value;
- if(elemVal){
+ if (elemVal) {
elemVal = moment(elemVal).format("YYYY/MM/DD hh:mm:ss");
}
-
- }else{
- elemVal = (document.getElementById(
- this.absenceDffresponse[i].APPLICATION_COLUMN_NAME
- ) as HTMLInputElement).value;
- }
+
+ } else {
+ elemVal = (document.getElementById(
+ this.absenceDffresponse[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement).value;
+ }
textValue = elemVal;
if (
@@ -1060,7 +1060,7 @@ export class SubmitAbsenceComponent implements OnInit {
this.absenceDffresponse[i].DISPLAY_FLAG != "N"
) {
//date
- elemVal = this.common.formatDate(elemVal);
+ elemVal = this.common.formatDate(elemVal);
} else if (
this.absenceDffresponse[i].FORMAT_TYPE == "Y" &&
this.absenceDffresponse[i].DISPLAY_FLAG != "N"
@@ -1323,6 +1323,7 @@ export class SubmitAbsenceComponent implements OnInit {
}
return isSt;
}
+
validateAbcenseTransaction() {
(this.elementRef.nativeElement.querySelectorAll(
"ion-item"
@@ -1447,9 +1448,9 @@ export class SubmitAbsenceComponent implements OnInit {
private handleSubmitAbsence(result) {
if (this.common.validResponse(result)) {
if (this.getPassdirfromNotifiPage) {
- this.common.sharedService.setSharedData(result.ResubmitAbsenceTransactionList.P_TRANSACTION_ID, AbsenceResponse.SHARED_DATA);
- this.common.openConfirmAbsece();
- // this.navCtrl.push("SubmitAbsenceConfirmPage", { isResubmit: true });
+ this.common.sharedService.setSharedData(result.ResubmitAbsenceTransactionList.P_TRANSACTION_ID, AbsenceResponse.SHARED_DATA);
+ this.common.openConfirmAbsece();
+ // this.navCtrl.push("SubmitAbsenceConfirmPage", { isResubmit: true });
} else {
this.common.sharedService.setSharedData(result.SumbitAbsenceTransactionList.P_TRANSACTION_ID, AbsenceResponse.SHARED_DATA);
this.common.openConfirmAbsece();
diff --git a/Mohem/src/app/app-routing.module.ts b/Mohem/src/app/app-routing.module.ts
index b4b5da86..ce2095cd 100644
--- a/Mohem/src/app/app-routing.module.ts
+++ b/Mohem/src/app/app-routing.module.ts
@@ -1,42 +1,46 @@
-import { NgModule } from '@angular/core';
-import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
+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' },
+ { path: 'payslip', loadChildren: './payslip/payslip.module#PayslipPageModule' },
+ { path: 'attendance-tracking', loadChildren: './attendance-tracking/attendance-tracking.module#AttendanceTrackingPageModule' },
+ { path: 'itemforsale', loadChildren: './itemforsale/itemforsale.module#ItemforsalePageModule' },
+ { path: 'offersdiscount', loadChildren: './offersdiscount/offersdiscount.module#OffersdiscountPageModule' },
+ { path: 'mowadhafi', loadChildren: './mowadhafi/mowadhafi.module#MowadhafiPageModule' },
+ { path: 'erm-channel', loadChildren: './erm-channel/erm-channel.module#ErmChannelPageModule' },
+ { path: 'backend-integrations', loadChildren: './backend-integrations/backend-integrations.module#BackendIntegrationsPageModule' },
{ path: 'reports', loadChildren: './reports/reports.module#ReportsPageModule' },
+ { path: 'concurrent-report', loadChildren: './reports/concurrent-report/concurrent-report.module#ConcurrentReportPageModule' },
+ { path: 'termination', loadChildren: './termination/termination.module#TerminationPageModule' },
+ { path: 'pending-transaction', loadChildren: './pending-transaction/pending-transaction.module#PendingTransactionPageModule' }
-
-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' },
- { path: 'attendance-tracking', loadChildren: './attendance-tracking/attendance-tracking.module#AttendanceTrackingPageModule' },
- { path: 'itemforsale', loadChildren: './itemforsale/itemforsale.module#ItemforsalePageModule' },
- { path: 'offersdiscount', loadChildren: './offersdiscount/offersdiscount.module#OffersdiscountPageModule' },
- { path: 'mowadhafi', loadChildren: './mowadhafi/mowadhafi.module#MowadhafiPageModule' },
- { path: 'erm-channel', loadChildren: './erm-channel/erm-channel.module#ErmChannelPageModule' },
- { path: 'backend-integrations', loadChildren: './backend-integrations/backend-integrations.module#BackendIntegrationsPageModule' }
-
-
-
-
-];
-
-@NgModule({
- imports: [
- /*RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules}),*/
- RouterModule.forRoot(routes),
- ],
- exports: [RouterModule]
-})
-export class AppRoutingModule { }
+
+
+
+
+];
+
+@NgModule({
+ imports: [
+ /*RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules}),*/
+ RouterModule.forRoot(routes),
+ ],
+ exports: [RouterModule]
+})
+export class AppRoutingModule { }
diff --git a/Mohem/src/app/app.component.html b/Mohem/src/app/app.component.html
index 5b40ba6e..78c03ae2 100644
--- a/Mohem/src/app/app.component.html
+++ b/Mohem/src/app/app.component.html
@@ -53,7 +53,26 @@
{{ts.trPK('userProfile','HR-Request')}}
+
+
+
+
+
+ {{menu.MENU_NAME}}
+
+
+
+
+
+
+ {{ts.trPK('general','pending-transaction')}}
+
+
diff --git a/Mohem/src/app/app.component.ts b/Mohem/src/app/app.component.ts
index 47934fec..1648f9ec 100644
--- a/Mohem/src/app/app.component.ts
+++ b/Mohem/src/app/app.component.ts
@@ -14,6 +14,7 @@ import { DigitalIdComponent } from './authentication/digital-id/digital-id.compo
import { checkAndUpdatePureExpressionInline } from '@angular/core/src/view/pure_expression';
import { FirebaseX } from '@ionic-native/firebase-x/ngx';
import { BusinessCardComponent } from './authentication/business-card/business-card.component';
+import { MenuResponse } from './hmg-common/services/menu/models/menu-response';
@Component({
selector: 'app-root',
@@ -122,7 +123,7 @@ export class AppComponent implements OnInit {
public setScreenNameAnalytics(currentPageName: string) {
try {
- this.firebasex.setScreenName(currentPageName).then((result)=>{
+ this.firebasex.setScreenName(currentPageName).then((result) => {
console.log(result);
});
} catch (Error) { }
@@ -208,7 +209,7 @@ export class AppComponent implements OnInit {
let jobTitle = user.POSITION_NAME.split('.');
if (jobTitle && jobTitle.length > 1) {
this.User_Job_name = jobTitle[0] + " " + jobTitle[1];
- }
+ }
//erm channel
// if (!CommonService.SKIP)
// this.cs.navigateForward('/erm-channel/survey');
@@ -218,7 +219,10 @@ export class AppComponent implements OnInit {
});
});
this.events.subscribe('getNotCount', badge => { this.notBadge = badge; });
- this.events.subscribe('myTeamFlag', myTeamFlag => { this.TeamFlag = myTeamFlag; });
+ this.events.subscribe('myTeamFlag', myTeamFlag => {
+ this.TeamFlag = myTeamFlag;
+ this.menuList = this.cs.sharedService.getSharedData(MenuResponse.MENU_LIST, false);
+ });
}
private initializeDirection() {
@@ -348,4 +352,13 @@ export class AppComponent implements OnInit {
} else { }
});
}
+ oepnMyRequest(menu) {
+ this.cs.sharedService.setSharedData(menu, MenuResponse.SELECTED_MENU);
+ this.cs.openConcurrentReport();
+ this.menu.toggle();
+ }
+ oepnTransaction() {
+ this.cs.openTransactions();
+ this.menu.toggle();
+ }
}
diff --git a/Mohem/src/app/eit/home/home.component.ts b/Mohem/src/app/eit/home/home.component.ts
index 7402a672..d145686f 100644
--- a/Mohem/src/app/eit/home/home.component.ts
+++ b/Mohem/src/app/eit/home/home.component.ts
@@ -2,6 +2,7 @@ import { CommonService } from 'src/app/hmg-common/services/common/common.service
import { Component, OnInit } from '@angular/core';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
+import { TerminationServiceService } from 'src/app/termination/service/termination-service.service';
@Component({
selector: 'app-home',
@@ -19,7 +20,7 @@ export class HomeComponent implements OnInit {
direction: string;
pageType: string;
- constructor(private cs: CommonService, private ts: TranslatorService) {
+ constructor(private cs: CommonService, private ts: TranslatorService, public terminationService: TerminationServiceService) {
this.direction = TranslatorService.getCurrentLanguageName();
this.menu = this.cs.sharedService.getSharedData('menuEntries', false);
this.pageType = this.cs.sharedService.getSharedData('homemenuentries', false);
@@ -45,6 +46,11 @@ export class HomeComponent implements OnInit {
this.selectedMenu = index;
}
}
+ if (page['FUNCTION_NAME'] == 'HR_TERM_EMP_SS') {
+ this.cs.sharedService.setSharedData(page, TerminationServiceService.TERMINATION_PAGE);
+
+ this.cs.openTermination();
+ }
console.log('selected>>>>>>>' + this.selectedMenu);
}
diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts
index cac80b88..c3ca3b8a 100644
--- a/Mohem/src/app/hmg-common/services/common/common.service.ts
+++ b/Mohem/src/app/hmg-common/services/common/common.service.ts
@@ -1302,9 +1302,18 @@ export class CommonService {
public openAnnouncement() {
this.nav.navigateForward(['/backend-integrations/announcement']);
}
+ public openConcurrentReport() {
+ this.nav.navigateForward(['/reports/concurrent-report']);
+ }
+ public openTermination() {
+ this.nav.navigateForward(['/termination/termination-form']);
+ }
+ public openTransactions() {
+ this.nav.navigateForward(['/pending-transaction/home']);
+ }
public navigatePage(path) {
this.nav.navigateForward([path]);
}
diff --git a/Mohem/src/app/hmg-common/services/connector/connector.service.ts b/Mohem/src/app/hmg-common/services/connector/connector.service.ts
index dc119ce4..62631565 100644
--- a/Mohem/src/app/hmg-common/services/connector/connector.service.ts
+++ b/Mohem/src/app/hmg-common/services/connector/connector.service.ts
@@ -27,8 +27,8 @@ export class ConnectorService {
public static retryTimes = 0;
public static timeOut = 120 * 1000;
- // public static host = 'https://uat.hmgwebservices.com/';
- public static host = 'https://hmgwebservices.com/';
+ public static host = 'https://uat.hmgwebservices.com/';
+ // public static host = 'https://hmgwebservices.com/';
constructor(public httpClient: HttpClient,
public cs: CommonService,
@@ -235,7 +235,7 @@ export class ConnectorService {
}
return false;
} else if (result.ErrorType === 2 || result.ErrorType === 4) {
- this.cs.stopLoading();
+ this.cs.stopLoading();
} else {
this.cs.stopLoading();
if (!fromSMS) {
diff --git a/Mohem/src/app/hmg-common/services/menu/models/menu-response.ts b/Mohem/src/app/hmg-common/services/menu/models/menu-response.ts
index 1c7a2e1d..07db1f07 100644
--- a/Mohem/src/app/hmg-common/services/menu/models/menu-response.ts
+++ b/Mohem/src/app/hmg-common/services/menu/models/menu-response.ts
@@ -2,10 +2,12 @@ import { ListMenu } from './list.menu';
import { MenuEntry } from './menu.entry';
export class MenuResponse {
public static SHARED_DATA = 'menu_response';
- public static SHARED_SEL_EMP= 'sel_empolyee';
- public static SHARED_SEL_RESP_ID= 'sel_resp_id';
- public userid:string;
- public search:boolean;
- public List_Menu:ListMenu;
- public GetMenuEntriesList:MenuEntry;
+ public static MENU_LIST = 'menu_list';
+ public static SELECTED_MENU = 'selected_menu';
+ public static SHARED_SEL_EMP = 'sel_empolyee';
+ public static SHARED_SEL_RESP_ID = 'sel_resp_id';
+ public userid: string;
+ public search: boolean;
+ public List_Menu: ListMenu;
+ public GetMenuEntriesList: MenuEntry;
}
\ No newline at end of file
diff --git a/Mohem/src/app/hmg-common/services/rate/rate.service.ts b/Mohem/src/app/hmg-common/services/rate/rate.service.ts
index f9fef5d7..9176bf13 100644
--- a/Mohem/src/app/hmg-common/services/rate/rate.service.ts
+++ b/Mohem/src/app/hmg-common/services/rate/rate.service.ts
@@ -20,13 +20,13 @@ export class RateService {
}
- public rateFeature(ratedFeedBack?: any , featureKey: string = RateService.app , delay: number = 2000) {
+ public rateFeature(ratedFeedBack?: any, featureKey: string = RateService.app, delay: number = 2000) {
if (this.isRated(featureKey)) {
if (ratedFeedBack) {
ratedFeedBack(true);
}
} else {
- setTimeout( () => {
+ setTimeout(() => {
this.startRating(featureKey, ratedFeedBack);
}, delay);
}
@@ -38,7 +38,7 @@ export class RateService {
this.appRate.preferences = {
displayAppName: this.ts.trPK('general', 'app-name'),
promptAgainForEachNewVersion: true,
- inAppReview: true,
+ // inAppReview: true,
storeAppURL: {
ios: 'com.ejada.hmg',
android: 'market://details?id=com.ejada.hmg',
@@ -47,7 +47,7 @@ export class RateService {
callbacks: {
handleNegativeFeedback: () => {
this.setAsRated(featureKey);
- //this.cs.openFeedback();
+ //this.cs.openFeedback();
},
onButtonClicked: (buttonIndex) => {
// when user click rate
diff --git a/Mohem/src/app/home/home.page.html b/Mohem/src/app/home/home.page.html
index b323351c..00f2cdef 100644
--- a/Mohem/src/app/home/home.page.html
+++ b/Mohem/src/app/home/home.page.html
@@ -63,7 +63,7 @@
{{'general,other-services' | translate}}
-
+
diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts
index 0a882f0f..ed15653a 100644
--- a/Mohem/src/app/home/home.page.ts
+++ b/Mohem/src/app/home/home.page.ts
@@ -192,11 +192,11 @@ export class HomePage implements OnInit {
spaceBetween: 10
};
this.slideOptsTwo = {
- slidesPerView: width > 320 ? 3.2 : 2.5,
- spaceBetween: width > 320 ? 10 : 5
+ slidesPerView: width > 320 ? 3.2 : 2.5,
+ spaceBetween: width > 320 ? 10 : 5
};
this.showStaticServices = true;
-}
+ }
ionViewWillEnter() {
this.common.startLoading();
this.slideSettingsTwo();
@@ -408,6 +408,7 @@ export class HomePage implements OnInit {
selMenu.List_Menu = item;
selMenu.userid = this.userData.EMPLOYEE_NUMBER;
this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA);
+ this.common.sharedService.setSharedData(this.menuList, MenuResponse.MENU_LIST);
this.getMenuEntries(item);
// tslint:disable-next-line: prefer-for-of
for (let i = 0; i < this.menuList.length; i++) {
@@ -749,7 +750,7 @@ export class HomePage implements OnInit {
totalTicketsLeft = totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT;
}
}
- this.statsButtons[4].statsValue = Number(totalTicketsLeft.toFixed(2));
+ this.statsButtons[4].statsValue = Number(totalTicketsLeft.toFixed(2));
}
});
}
diff --git a/Mohem/src/app/itemforsale/home/home.component.ts b/Mohem/src/app/itemforsale/home/home.component.ts
index ace51a36..7ddeddbe 100644
--- a/Mohem/src/app/itemforsale/home/home.component.ts
+++ b/Mohem/src/app/itemforsale/home/home.component.ts
@@ -1,6 +1,7 @@
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 { ItemForSaleService } from '../services/service.service';
@Component({
selector: 'app-home',
@@ -9,9 +10,12 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
})
export class HomeComponent implements OnInit {
step: any = 1;
- constructor(public ts: TranslatorService, public cs: CommonService,) { }
+ constructor(public ts: TranslatorService, public cs: CommonService, private itemService: ItemForSaleService) { }
- ngOnInit() { }
+ ngOnInit() {
+
+
+ }
openItem() {
diff --git a/Mohem/src/app/itemforsale/item-details/item-details.component.html b/Mohem/src/app/itemforsale/item-details/item-details.component.html
index add7aca6..a6f466e6 100644
--- a/Mohem/src/app/itemforsale/item-details/item-details.component.html
+++ b/Mohem/src/app/itemforsale/item-details/item-details.component.html
@@ -12,18 +12,21 @@
-
+
+
-
- Furniture Table
+ {{itemDetails.title}}
+ {{itemDetails.title_Ar}}
- Keep close to Nature's heart... and break clear away, once in awhile,
- and climb a mountain or spend a week in the woods. Wash your spirit clean.
+ {{itemDetails.description}}
+ {{itemDetails.description_Ar}}
New
-
500 SAR
+
+ {{itemDetails.quotePrice}} {{itemDetails.currencyCode}}
+
@@ -33,9 +36,9 @@
- Mohammed Imran
- Posted on 22 April 2020
- View Profile
+ {{itemDetails.fullName}}
+ {{getDate(itemDetails.created) }}
+
@@ -50,14 +53,15 @@
\ No newline at end of file
diff --git a/Mohem/src/app/itemforsale/item-details/item-details.component.ts b/Mohem/src/app/itemforsale/item-details/item-details.component.ts
index cae7ea97..f326a1ad 100644
--- a/Mohem/src/app/itemforsale/item-details/item-details.component.ts
+++ b/Mohem/src/app/itemforsale/item-details/item-details.component.ts
@@ -1,15 +1,26 @@
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 { ItemForSaleService } from '../services/service.service';
+import * as moment from 'moment';
@Component({
selector: 'app-item-details',
templateUrl: './item-details.component.html',
styleUrls: ['./item-details.component.scss'],
})
export class ItemDetailsComponent implements OnInit {
+ itemDetails: any = {};
+ direction: any;
+
constructor(public ts: TranslatorService, public cs: CommonService,) { }
- ngOnInit() { }
+ ngOnInit() {
+ this.direction = TranslatorService.getCurrentDirection();
+ this.itemDetails = this.cs.sharedService.getSharedData(ItemForSaleService.ITEMS_SELECTED, false);
+ console.log(this.itemDetails);
+ }
+ getDate(date) {
+ return moment(date, "YYYY-MM-DD HH:mm:ss").format("DD-MMM-YYYY");
+ }
}
diff --git a/Mohem/src/app/itemforsale/itemforsale.module.ts b/Mohem/src/app/itemforsale/itemforsale.module.ts
index 6a7aea24..e8833935 100644
--- a/Mohem/src/app/itemforsale/itemforsale.module.ts
+++ b/Mohem/src/app/itemforsale/itemforsale.module.ts
@@ -11,6 +11,8 @@ import { ItemsComponent } from './items/items.component';
import { ItemDetailsComponent } from './item-details/item-details.component';
import { MyAdsComponent } from './my-ads/my-ads.component';
import { HmgCommonModule } from '../hmg-common/hmg-common.module';
+import { ItemForSaleService } from './services/service.service';
+import { SanitizeHtmlPipe } from './services/domsafe';
const routes: Routes = [
{
@@ -45,6 +47,8 @@ const routes: Routes = [
HmgCommonModule,
RouterModule.forChild(routes)
],
- declarations: [ItemforsalePage, HomeComponent, ItemsComponent, ItemDetailsComponent, MyAdsComponent]
+ declarations: [ItemforsalePage, HomeComponent, ItemsComponent, ItemDetailsComponent, MyAdsComponent, SanitizeHtmlPipe],
+ providers: [ItemForSaleService],
+ exports: [SanitizeHtmlPipe]
})
export class ItemforsalePageModule { }
diff --git a/Mohem/src/app/itemforsale/items/items.component.html b/Mohem/src/app/itemforsale/items/items.component.html
index bab28e0c..3334792c 100644
--- a/Mohem/src/app/itemforsale/items/items.component.html
+++ b/Mohem/src/app/itemforsale/items/items.component.html
@@ -28,7 +28,7 @@
-
+
@@ -43,67 +43,42 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
Fashion & Beauty
+
{{category.title}}
+
{{category.title_Ar}}
+
-
+
-
+
+
- Furniture Table
-
- Posted on 24 April 2021
-
- good condition only 6th month used
+ {{item.title}}
+ {{item.title_Ar}}
+
+ {{getDate(item.created) }}
+
+ {{getDotted(item.description, 30)}}
+ {{getDotted(item.description_Ar, 30)}}
- Pending Review
+ {{isApproved ? "Appoved" :"Pending"}}
+
@@ -170,6 +129,7 @@
+
diff --git a/Mohem/src/app/itemforsale/items/items.component.scss b/Mohem/src/app/itemforsale/items/items.component.scss
index bcba7e10..d83c0aa4 100644
--- a/Mohem/src/app/itemforsale/items/items.component.scss
+++ b/Mohem/src/app/itemforsale/items/items.component.scss
@@ -10,6 +10,9 @@
.header-toolbar{
--background: #259CB8 !important;
}
+.top{
+ position: relative;
+}
.bottom{
height: 100%;
width: 100%;
@@ -51,7 +54,10 @@
margin-top: 5px;
margin-bottom: 5px;
margin-left: 5px;
- font-size: 14px;
+ font-size: 12px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
}
.bottom-icon{
text-overflow: clip;
@@ -69,7 +75,8 @@ ion-card-title{
font-weight: bold;
font-size: 14px;
- padding: 5px
+ padding: 5px;
+ height: 40px;
}
.orange{
color: #CC9B14;
@@ -112,9 +119,10 @@ ion-segment-button{
}
ion-segment-button ion-label{
padding: 0;
- font-size: 16px;
+ font-size: 14px;
white-space: normal;
font-weight: bold;
+ line-height: 1.1;
}
.segment-button-checked ion-label{
color: #fff !important;
@@ -132,6 +140,7 @@ ion-item h3{
color: #000;
font-weight: bold;
font-size: 14px;
+ margin-top:10px;
}
.yellow{
color:#CC9B14;
@@ -155,7 +164,7 @@ ion-item .icon{
--background: #259CB8;
}
ion-footer{
- position: absolute;
+ position: fixed;
bottom: 0;
}
ion-footer .footer-button{
@@ -219,4 +228,23 @@ ion-fab-button{
}
.grid-row{
margin:10px;
+}
+
+.active .top::before{
+ position: absolute;
+ right: 0px;
+ top: 2px;
+ padding: 0px;
+ background: #3cc353;
+ padding: 2px 3px 4px 3px;
+ border-radius: 60%;
+ font-size: 10px;
+ color: #fff;
+ content: '✓';
+ width: 12px;
+ height: 12px;
+ text-align: center;
+}
+.space{
+ height:100px;
}
\ No newline at end of file
diff --git a/Mohem/src/app/itemforsale/items/items.component.ts b/Mohem/src/app/itemforsale/items/items.component.ts
index 73fc2398..a8ddc4a3 100644
--- a/Mohem/src/app/itemforsale/items/items.component.ts
+++ b/Mohem/src/app/itemforsale/items/items.component.ts
@@ -1,6 +1,9 @@
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 { ItemForSaleService } from '../services/service.service';
+import { deepCopy } from '@angular-devkit/core/src/utils/object';
+import * as moment from 'moment';
@Component({
selector: 'app-items',
@@ -9,10 +12,33 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
})
export class ItemsComponent implements OnInit {
segment: any = '1';
- constructor(public ts: TranslatorService, public cs: CommonService,) { }
+ items: any = [];
+ categories: any = [];
+ direction: string;
+ activeClass: any;
+ pageNo: number = 1;
+ tempSearch: any = [];
+ itemsByEmployee: any = [];
+ constructor(public ts: TranslatorService, public cs: CommonService, private itemService: ItemForSaleService) { }
- ngOnInit() { }
- openDetails() {
+
+ ngOnInit() {
+ this.direction = TranslatorService.getCurrentDirection();
+ this.getItemsCategories();
+ this.getItemsByEmployee();
+ }
+ getItemsCategories() {
+ this.itemService.getCategories({}, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
+ this.categories = this.itemService.parser(result);
+ console.log(this.categories);
+ })
+ this.itemService.getItems({ pageNo: this.pageNo }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
+ this.items = this.itemService.parser(result);
+ this.tempSearch = deepCopy(this.items);
+ })
+ }
+ openDetails(selected) {
+ this.cs.sharedService.setSharedData(selected, ItemForSaleService.ITEMS_SELECTED);
this.cs.navigateForward('/itemforsale/items-details');
}
segmentChanged(value) {
@@ -21,5 +47,53 @@ export class ItemsComponent implements OnInit {
openSale() {
this.cs.navigateForward('/itemforsale/home');
}
+ selectCategory(item) {
+ this.activeClass = item.categoryID
+
+ }
+ getDotted(temp: string, valueCount: number) {
+ temp = this.stripHtml(temp);
+ return temp.substring(0, valueCount) + " ...";
+ }
+ stripHtml(html) {
+ var temporalDivElement = document.createElement("div");
+
+ temporalDivElement.innerHTML = html;
+
+ return temporalDivElement.textContent || temporalDivElement.innerText || "";
+ }
+ loadData(event) {
+ this.pageNo = this.pageNo + 1;
+ this.itemService.getItems({ pageNo: this.pageNo }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
+ this.items.concat(this.itemService.parser(result));
+ this.tempSearch = deepCopy(this.items);
+ event.target.complete();
+
+ })
+ }
+ search(t) {
+ if (t === '') {
+ this.items = this.tempSearch;
+ } else {
+ this.items = this.tempSearch.filter((post) => {
+ if (this.direction == 'ltr')
+ return (post.title.toLowerCase().indexOf(t.toLowerCase()) > -1);
+ else
+ return (post.title_Ar.indexOf(t) > -1);
+ });
+ }
+
+ }
+ getItemsByEmployee() {
+
+
+ this.itemService.getItemsByEmployee({}, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
+ this.itemsByEmployee = this.itemService.parser(result);
+ console.log(this.itemsByEmployee);
+ })
+ }
+ getDate(date) {
+ return moment(date, "YYYY-MM-DD HH:mm:ss").format("DD-MMM-YYYY");
+ }
}
diff --git a/Mohem/src/app/itemforsale/services/domsafe.ts b/Mohem/src/app/itemforsale/services/domsafe.ts
new file mode 100644
index 00000000..79b677ac
--- /dev/null
+++ b/Mohem/src/app/itemforsale/services/domsafe.ts
@@ -0,0 +1,15 @@
+import { Pipe, PipeTransform } from "@angular/core";
+import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
+
+@Pipe({
+ name: 'sanitizeHTMLPipe'
+})
+export class SanitizeHtmlPipe implements PipeTransform {
+
+ constructor(private _sanitizer: DomSanitizer) {
+ }
+
+ transform(v: string): SafeHtml {
+ return this._sanitizer.bypassSecurityTrustHtml(v);
+ }
+}
\ No newline at end of file
diff --git a/Mohem/src/app/itemforsale/services/service.service.spec.ts b/Mohem/src/app/itemforsale/services/service.service.spec.ts
new file mode 100644
index 00000000..99221043
--- /dev/null
+++ b/Mohem/src/app/itemforsale/services/service.service.spec.ts
@@ -0,0 +1,12 @@
+import { TestBed } from '@angular/core/testing';
+
+import { ItemForSaleService } from './service.service';
+
+describe('ServiceService', () => {
+ beforeEach(() => TestBed.configureTestingModule({}));
+
+ it('should be created', () => {
+ const service: ItemForSaleService = TestBed.get(ItemForSaleService);
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/itemforsale/services/service.service.ts b/Mohem/src/app/itemforsale/services/service.service.ts
new file mode 100644
index 00000000..14b246c1
--- /dev/null
+++ b/Mohem/src/app/itemforsale/services/service.service.ts
@@ -0,0 +1,51 @@
+import { Injectable } from '@angular/core';
+import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
+import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class ItemForSaleService {
+ public static getItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemForSale';
+ public static getItemForSaleByEmployee = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemForSaleByEmployee';
+ public static getCategories = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemSaleCategory';
+ public static ITEMS_SELECTED = 'item-selected';
+
+ constructor(
+ public con: ConnectorService,
+ private authService: AuthenticationService
+ ) { }
+ public getItems(request: any, onError?: any, errorLabel?: string) {
+ this.authService.authenticateRequest(request);
+ request.EmployeeNumber = request.UserName;
+ request.ItgPageNo = request.pageNo;
+ request.ItgPageSize = 10;
+ request.ItgStatus = "Approved";
+ return this.con.post(ItemForSaleService.getItemForSale, request, onError, errorLabel);
+ }
+
+ public getCategories(request: any, onError?: any, errorLabel?: string) {
+ this.authService.authenticateRequest(request);
+ request.EmployeeNumber = request.UserName;
+
+ return this.con.post(ItemForSaleService.getCategories, request, onError, errorLabel);
+ }
+ parser(response: any) {
+ try {
+ var result = JSON.parse(response.Mohemm_ITG_ResponseItem);
+ if (result.result)
+ return result.result.data
+ else
+ return {}
+ } catch (res) {
+ console.log(res);
+ }
+ }
+
+ getItemsByEmployee(request: any, onError?: any, errorLabel?: string) {
+ this.authService.authenticateRequest(request);
+ request.EmployeeNumber = request.UserName;
+ request.ItgEmployeeNumber = 111209;
+ return this.con.post(ItemForSaleService.getItemForSaleByEmployee, request, onError, errorLabel);
+ }
+}
diff --git a/Mohem/src/app/pending-transaction/home/home.component.html b/Mohem/src/app/pending-transaction/home/home.component.html
new file mode 100644
index 00000000..5169ef68
--- /dev/null
+++ b/Mohem/src/app/pending-transaction/home/home.component.html
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+ {{ 'general,select' | translate}}
+
+
+ {{ transaction.FUNCTION_PROMPT}}
+
+
+
+
+
+
+
+
+
+ {{ 'general,from-date' | translate}}
+
+
+
+
+
+
+ {{ 'general,to-date' | translate}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{'general, noData' | translate}}
+
+
+
0" class="transaction-list">
+
+ {{transaction.CREATION_DATE}}
+
+
+ {{'transaction, created-for' | translate}}
+ {{transaction.TRANSACTION_CREATED_FOR}}
+
+
+
+ {{'transaction, request-type' | translate}}
+ {{transaction.REQUEST_TYPE}}
+
+
+
+
+
+
+
+
+
+
+
+ {{'general, submit' | translate}}
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/pending-transaction/home/home.component.scss b/Mohem/src/app/pending-transaction/home/home.component.scss
new file mode 100644
index 00000000..17285bed
--- /dev/null
+++ b/Mohem/src/app/pending-transaction/home/home.component.scss
@@ -0,0 +1,25 @@
+.display-created{
+ display: inline-block;
+
+ color:#000;
+}
+.padding{
+ padding-left:5px;
+ padding-right: 5px;
+}
+.bold{
+ font-weight: bold;
+}
+.color-black{
+ color:#000;
+}
+.date{
+ position: absolute;
+ font-size: 12px;
+ padding: 10px;
+ right:0;
+
+}
+.transaction-list{
+ margin-top:20px;
+}
\ No newline at end of file
diff --git a/Mohem/src/app/pending-transaction/home/home.component.spec.ts b/Mohem/src/app/pending-transaction/home/home.component.spec.ts
new file mode 100644
index 00000000..5ec1377b
--- /dev/null
+++ b/Mohem/src/app/pending-transaction/home/home.component.spec.ts
@@ -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
;
+
+ 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();
+ });
+});
diff --git a/Mohem/src/app/pending-transaction/home/home.component.ts b/Mohem/src/app/pending-transaction/home/home.component.ts
new file mode 100644
index 00000000..51d218e8
--- /dev/null
+++ b/Mohem/src/app/pending-transaction/home/home.component.ts
@@ -0,0 +1,56 @@
+import { Component, ElementRef, OnInit } from '@angular/core';
+import { EitService } from 'src/app/eit/services/eit.service';
+import { CommonService } from 'src/app/hmg-common/services/common/common.service';
+import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
+import { ServiceService } from '../service/service.service';
+
+@Component({
+ selector: 'app-home',
+ templateUrl: './home.component.html',
+ styleUrls: ['./home.component.scss'],
+})
+export class HomeComponent implements OnInit {
+ public direction: any;
+ public transactions: any = [];
+ public selectedTransaction: any;
+ public dateTo: any;
+ public dateFrom: any;
+ public transactionDetails;
+ constructor(public cs: CommonService, private elementRef: ElementRef, public trServcice: ServiceService, public ts: TranslatorService, public eitService: EitService) { }
+
+
+ ngOnInit() {
+
+
+ this.getPendingTransaction();
+ this.direction = TranslatorService.getCurrentLanguageName();
+
+ }
+ getPendingTransaction() {
+ this.cs.startLoading();
+ this.trServcice.getPendingRequests({
+ }, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => {
+ this.cs.stopLoading();
+ this.transactions = response['GetPendingReqFunctionsList'];
+ })
+ }
+ getPendingRequestDetails() {
+ this.cs.startLoading();
+ this.trServcice.getPendingRequestDetails({
+ 'P_FUNCTION_ID': this.selectedTransaction.FUNCTION_ID,
+ 'P_CREATION_DATE_FROM': "/Date(" + Date.parse(this.dateFrom) + '+0300' + ")/",
+ 'P_CREATION_DATE_TO': "/Date(" + Date.parse(this.dateTo) + '+0300' + ")/",
+ 'P_PAGE_NUM': 1,
+ 'P_PAGE_LIMIT': 20,
+
+ }, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => {
+ this.cs.stopLoading();
+ this.transactionDetails = response['GetPendingReqDetailsList'];
+ })
+ }
+ isValid() {
+ if (this.selectedTransaction && this.dateFrom && this.dateTo)
+ return true;
+ else return false
+ }
+}
diff --git a/Mohem/src/app/pending-transaction/pending-transaction.module.ts b/Mohem/src/app/pending-transaction/pending-transaction.module.ts
new file mode 100644
index 00000000..1d95ebc2
--- /dev/null
+++ b/Mohem/src/app/pending-transaction/pending-transaction.module.ts
@@ -0,0 +1,36 @@
+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 { PendingTransactionPage } from './pending-transaction.page';
+import { HomeComponent } from './home/home.component';
+import { ServiceService } from './service/service.service';
+import { HmgCommonModule } from '../hmg-common/hmg-common.module';
+const routes: Routes = [
+ {
+ path: '',
+ component: PendingTransactionPage,
+ children: [
+ {
+ path: 'home',
+ component: HomeComponent
+ },
+ ]
+ }
+];
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ IonicModule,
+ RouterModule.forChild(routes),
+ HmgCommonModule
+ ],
+ declarations: [PendingTransactionPage, HomeComponent],
+ providers: [ServiceService]
+})
+export class PendingTransactionPageModule { }
diff --git a/Mohem/src/app/pending-transaction/pending-transaction.page.html b/Mohem/src/app/pending-transaction/pending-transaction.page.html
new file mode 100644
index 00000000..d26b79fd
--- /dev/null
+++ b/Mohem/src/app/pending-transaction/pending-transaction.page.html
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/pending-transaction/pending-transaction.page.scss b/Mohem/src/app/pending-transaction/pending-transaction.page.scss
new file mode 100644
index 00000000..e69de29b
diff --git a/Mohem/src/app/pending-transaction/pending-transaction.page.spec.ts b/Mohem/src/app/pending-transaction/pending-transaction.page.spec.ts
new file mode 100644
index 00000000..b6a16ed9
--- /dev/null
+++ b/Mohem/src/app/pending-transaction/pending-transaction.page.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { PendingTransactionPage } from './pending-transaction.page';
+
+describe('PendingTransactionPage', () => {
+ let component: PendingTransactionPage;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ PendingTransactionPage ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(PendingTransactionPage);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/pending-transaction/pending-transaction.page.ts b/Mohem/src/app/pending-transaction/pending-transaction.page.ts
new file mode 100644
index 00000000..1377c463
--- /dev/null
+++ b/Mohem/src/app/pending-transaction/pending-transaction.page.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-pending-transaction',
+ templateUrl: './pending-transaction.page.html',
+ styleUrls: ['./pending-transaction.page.scss'],
+})
+export class PendingTransactionPage implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+}
diff --git a/Mohem/src/app/pending-transaction/service/service.service.spec.ts b/Mohem/src/app/pending-transaction/service/service.service.spec.ts
new file mode 100644
index 00000000..d2923aa3
--- /dev/null
+++ b/Mohem/src/app/pending-transaction/service/service.service.spec.ts
@@ -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();
+ });
+});
diff --git a/Mohem/src/app/pending-transaction/service/service.service.ts b/Mohem/src/app/pending-transaction/service/service.service.ts
new file mode 100644
index 00000000..f5521403
--- /dev/null
+++ b/Mohem/src/app/pending-transaction/service/service.service.ts
@@ -0,0 +1,44 @@
+import { Injectable } from '@angular/core';
+import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
+import { CommonService } from 'src/app/hmg-common/services/common/common.service';
+import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class ServiceService {
+
+
+ public static GET_PENDING_REQ_FUNCTIONS = 'Services/ERP.svc/REST/GET_PENDING_REQ_FUNCTIONS';
+ public static GET_PENDING_REQ_DETAILS = 'Services/ERP.svc/REST/GET_PENDING_REQ_DETAILS';
+ constructor(
+ public con: ConnectorService,
+ private authService: AuthenticationService,
+ public cs: CommonService
+ ) { }
+
+ getPendingRequests(request, onError, errorLabel) {
+ this.authService.authenticateRequest(request);
+ request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName;
+ return this.con.postNoLoad(
+ ServiceService.GET_PENDING_REQ_FUNCTIONS,
+ request,
+ onError,
+ errorLabel
+ );
+ }
+ getPendingRequestDetails(request, onError, errorLabel) {
+ this.authService.authenticateRequest(request);
+ request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName;
+ return this.con.postNoLoad(
+ ServiceService.GET_PENDING_REQ_DETAILS,
+ request,
+ onError,
+ errorLabel
+ );
+ }
+
+
+
+
+}
diff --git a/Mohem/src/app/profile/edit-profile/edit-profile.component.html b/Mohem/src/app/profile/edit-profile/edit-profile.component.html
index 86ee5a08..ff85343c 100644
--- a/Mohem/src/app/profile/edit-profile/edit-profile.component.html
+++ b/Mohem/src/app/profile/edit-profile/edit-profile.component.html
@@ -74,6 +74,7 @@
{{personalInfo.EMPLOYEE_MOBILE_NUMBER}}
+
diff --git a/Mohem/src/app/profile/home/home.component.html b/Mohem/src/app/profile/home/home.component.html
index 96b8ea1b..8e0f701f 100644
--- a/Mohem/src/app/profile/home/home.component.html
+++ b/Mohem/src/app/profile/home/home.component.html
@@ -123,10 +123,19 @@
{{personalInfo.EMPLOYMENT_CATEGORY_MEANING}}
+
{{ts.trPK('userProfile','phone-no')}}
+
+
{{personalInfo.EMPLOYEE_MOBILE_NUMBER}}
+
+
+
+
+
+
{{ts.trPK('userProfile','busG')}}
diff --git a/Mohem/src/app/profile/home/home.component.scss b/Mohem/src/app/profile/home/home.component.scss
index 97bbfbb6..07c79412 100644
--- a/Mohem/src/app/profile/home/home.component.scss
+++ b/Mohem/src/app/profile/home/home.component.scss
@@ -1352,4 +1352,7 @@ $actionBtnSize: 36px;
letter-spacing: -0.64px;
color: #2B353E;
opacity: 1;
+}
+.create-edit{
+ font-size: 20px;
}
\ No newline at end of file
diff --git a/Mohem/src/app/profile/home/home.component.ts b/Mohem/src/app/profile/home/home.component.ts
index 6c05dd04..4b4c45de 100644
--- a/Mohem/src/app/profile/home/home.component.ts
+++ b/Mohem/src/app/profile/home/home.component.ts
@@ -149,7 +149,7 @@ export class HomeComponent implements OnInit {
let jobTitle = user.POSITION_NAME.split('.');
if (jobTitle && jobTitle.length > 1) {
this.jobName = jobTitle[0] + " " + jobTitle[1];
- }
+ }
if (this.cs.getUpdateImage().status) {
this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + this.cs.getUpdateImage().img);
@@ -311,7 +311,7 @@ export class HomeComponent implements OnInit {
const modal = await this.modalController.create({
component: EditDetailProfileComponent,
cssClass: 'my-custom-modal-css',
- componentProps:{ sourceName: source}
+ componentProps: { sourceName: source }
});
modal.onDidDismiss()
@@ -323,7 +323,7 @@ export class HomeComponent implements OnInit {
this.cs.sharedService.setSharedData(this.addressSubMenu, ProfileService.ADRESS_ENTRIES);
this.cs.sharedService.setSharedData(this.employeeAdress, ProfileService.EMP_ADDRESS);
this.cs.sharedService.setSharedData(this.country, ProfileService.COUNTRY);
-
+
this.cs.openAddAddress();
} else if (data.data && data.data.data == 2 && source === 'address') {
this.cs.openAddAddress();
@@ -356,5 +356,21 @@ export class HomeComponent implements OnInit {
this.cs.openAddBasicDetails('correct');
}
}
+ public editPhone() {
+ this.getObjectValues();
+ }
+
+ public createPhone() {
+
+ }
+ getObjectValues() {
+ this.profileService.getObjectValue({
+ P_OBJECT_TYPE: 'LOOKUP',
+ P_OBJECT_NAME: 'PHONE_TYPE'
+
+ }, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => {
+ console.log(response);
+ })
+ }
}
diff --git a/Mohem/src/app/profile/service/profile.service.ts b/Mohem/src/app/profile/service/profile.service.ts
index 0feb9512..a16ccf89 100644
--- a/Mohem/src/app/profile/service/profile.service.ts
+++ b/Mohem/src/app/profile/service/profile.service.ts
@@ -32,7 +32,7 @@ export class ProfileService {
public static getDiffStructure = "Services/ERP.svc/REST/GET_ADDRESS_DFF_STRUCTURE";
public static submitAddressTransactions = "Services/ERP.svc/REST/SUBMIT_ADDRESS_TRANSACTION";
public static submitBasicDetailsTransaction = "Services/ERP.svc/REST/SUBMIT_BASIC_DET_TRANSACTION";
-
+ public static getObjectValues = "Services/ERP.svc/REST/GET_OBJECT_VALUES";
public static ADRESS_ENTRIES = 'address-entries';
public static EMP_ADDRESS = 'emp-address';
public static COUNTRY = 'country';
@@ -127,4 +127,12 @@ export class ProfileService {
this.authService.authenticateRequest(request);
return this.con.post(ProfileService.startBasicProcess, request, onError, errorLabel);
}
+
+ public getObjectValue(request: any, onError?: any, errorLabel?: string): Observable {
+
+ this.authService.authenticateRequest(request);
+ request.P_SELECTED_EMPLOYEE_NUMBER = request.P_USER_NAME;
+ return this.con.post(ProfileService.getObjectValues, request, onError, errorLabel);
+
+ }
}
\ No newline at end of file
diff --git a/Mohem/src/app/reports/concurrent-report/concurrent-report.component.html b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.html
new file mode 100644
index 00000000..c622715f
--- /dev/null
+++ b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+ {{ 'worklist,template-name' | translate}}
+
+
+ {{ program.CONCURRENT_PROGRAM_NAME}}
+
+
+
+
+
+
+
+
+
+
+
+ {{'vacation-rule, next-label' | translate}}
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/reports/concurrent-report/concurrent-report.component.scss b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.scss
new file mode 100644
index 00000000..71cba989
--- /dev/null
+++ b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.scss
@@ -0,0 +1,6 @@
+.main-container{
+ padding: 10px;
+}
+.divider{
+ height:20px
+}
\ No newline at end of file
diff --git a/Mohem/src/app/reports/concurrent-report/concurrent-report.component.spec.ts b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.spec.ts
new file mode 100644
index 00000000..102199fe
--- /dev/null
+++ b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ConcurrentReportComponent } from './concurrent-report.component';
+
+describe('ConcurrentReportComponent', () => {
+ let component: ConcurrentReportComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ConcurrentReportComponent ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ConcurrentReportComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/reports/concurrent-report/concurrent-report.component.ts b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.ts
new file mode 100644
index 00000000..1c583432
--- /dev/null
+++ b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.ts
@@ -0,0 +1,1278 @@
+import { Component, ElementRef, OnInit } from '@angular/core';
+import * as moment from 'moment';
+import { EitRequest } from 'src/app/eit/models/eit.request';
+import { EIT_ACTION } from 'src/app/eit/models/submit.eit.action';
+import { EitService } from 'src/app/eit/services/eit.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 { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
+import { DateTimeInput } from 'src/app/uI-elements/date-time.input';
+import { DateInput } from 'src/app/uI-elements/date.input';
+import { HiddenInput } from 'src/app/uI-elements/hidden.input';
+import { NumberInput } from 'src/app/uI-elements/number.input';
+import { SelectInput } from 'src/app/uI-elements/select.input';
+import { TextInput } from 'src/app/uI-elements/text.input';
+import { TimeInput } from 'src/app/uI-elements/time.input';
+import { ReportServiceService } from '../report-service.service';
+
+@Component({
+ selector: 'app-concurrent-report',
+ templateUrl: './concurrent-report.component.html',
+ styleUrls: ['./concurrent-report.component.scss'],
+})
+export class ConcurrentReportComponent implements OnInit {
+ public selectedMenu;
+ public diffStructure = [];
+ public isUpdate: boolean;
+ private eitVALSettoCall: any = [];
+ private textInput;
+ private numberInput;
+ private dateInput;
+ public direction: string;
+ private datetimeInput;
+ private timeInput;
+ private selectInput;
+ private hiddenInput;
+ private validateEitObj: any = [];
+ public menuType: any;
+ public respID;
+ public selEmp;
+ public eitRequest;
+ public ExtraObj;
+ selMenu: MenuResponse;
+ public functionName;
+
+ public headerTitle;
+ getPassdirfromNotifiPage: boolean = false;
+ private validEitTransactionTbl: any = [];
+ eitSubmitAction: number = 0;
+ updatedValues: any = [];
+ comtransNo: any = 0;
+ programList: any = [];
+ public template: any;
+ constructor(public cs: CommonService, private elementRef: ElementRef, public reports: ReportServiceService, public ts: TranslatorService, public eitService: EitService) { }
+
+ ngOnInit() {
+ this.getPassdirfromNotifiPage = this.cs.sharedService.getSharedData('dirfromNotificationPage');
+ this.selectedMenu = this.cs.sharedService.getSharedData(MenuResponse.SELECTED_MENU, false);
+ this.getConcurrentProgram();
+ this.direction = TranslatorService.getCurrentLanguageName();
+ // this.effectiveDate = new Date();
+ this.functionName = this.selectedMenu.FUNCTION_NAME;
+ // this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT;
+ }
+ getConcurrentProgram() {
+ this.reports.getConcurrentProgram({
+ P_REQUEST_GROUP_ID: this.selectedMenu.REQUEST_GROUP_ID
+ }, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => {
+ console.log(response);
+ this.programList = response.GetConcurrentProgramsList;
+
+ })
+ }
+ getCppDiffStructure(programList) {
+ this.cs.startLoading();
+ this.reports.getCPPDiffStructure({
+ P_DESC_FLEX_NAME: programList.CONCURRENT_PROGRAM_NAME
+ }, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => {
+ this.cs.stopLoading();
+ this.handleDiffStructure(response);
+ })
+ }
+ handleDiffStructure(result) {
+ if (result.GetCcpDffStructureList != null) {
+ this.diffStructure = result.GetCcpDffStructureList;
+ this.drawEitFields(result.GetCcpDffStructureList);
+ if (this.isUpdate) {
+ //this.submitAbsObjList = this.cs.sharedService.getSharedData(ProfileService.EMP_ADDRESS);
+ //this.fillAbsStructure();
+ }
+ }
+ }
+ private drawEitFields(feildsList) {
+ const containerId = "containerDiv";
+ this.eitVALSettoCall = [];
+ for (let i = 0; i < feildsList.length; i++) {
+ let defaultVal: string = "";
+ let defaultValText: string = "";
+
+ if (feildsList[i].DISPLAY_FLAG != "N") {
+ //check if the field should be displayed
+ if (feildsList[i].VALIDATION_TYPE == "N") {
+ //text , date , time
+ if (feildsList[i].FORMAT_TYPE == "C") {
+ // character
+ this.textInput = new TextInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ defaultValText,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ } else if (feildsList[i].FORMAT_TYPE == "N") {
+ // number
+ this.numberInput = new NumberInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ } else if (feildsList[i].FORMAT_TYPE == "X") {
+ // standard date
+ if (
+ feildsList[i].DEFAULT_TYPE == "C" ||
+ feildsList[i].DEFAULT_TYPE == "D" ||
+ feildsList[i].DEFAULT_TYPE == "P" ||
+ feildsList[i].DEFAULT_TYPE == "S"
+ ) {
+ //constant
+ this.dateInput = new DateInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ this.cs.reverseFormatDate(defaultVal),
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ } else {
+ this.dateInput = new DateInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ "",
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ }
+ } else if (feildsList[i].FORMAT_TYPE == "Y") {
+ // standard date time
+ if (
+ feildsList[i].DEFAULT_TYPE == "C" ||
+ feildsList[i].DEFAULT_TYPE == "D" ||
+ feildsList[i].DEFAULT_TYPE == "P" ||
+ feildsList[i].DEFAULT_TYPE == "S"
+ ) {
+ this.datetimeInput = new DateTimeInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ this.cs.reverseFormatStandardDate(defaultVal),
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ } else {
+ this.datetimeInput = new DateTimeInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ "",
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ }
+ const elem = document.getElementById(
+ feildsList[i].APPLICATION_COLUMN_NAME
+ );
+ } else if (feildsList[i].FORMAT_TYPE == "I") {
+ //time
+ if (
+ feildsList[i].DEFAULT_TYPE == "C" ||
+ feildsList[i].DEFAULT_TYPE == "D" ||
+ feildsList[i].DEFAULT_TYPE == "P" ||
+ feildsList[i].DEFAULT_TYPE == "S"
+ ) {
+ this.timeInput = new TimeInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ "",
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ } else {
+ this.timeInput = new TimeInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ "",
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ }
+ }
+ } else {
+ if (feildsList[i].READ_ONLY == "Y") {
+ this.textInput = new TextInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ defaultValText,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ } else {
+ this.selectInput = new SelectInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ this.fillDropdownList(
+ feildsList[i].SEGMENT_NAME,
+ feildsList[i].E_SERVICES_VS,
+ feildsList[i].E_SERVICES_DV
+ );
+ }
+ }
+ this.bindHtmlElemEvents(
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ feildsList[i]
+ );
+ } else {
+ this.hiddenInput = new HiddenInput(
+ defaultVal,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultValText,
+ containerId
+ );
+ this.bindHtmlElemEvents(
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ feildsList[i]
+ );
+ }
+ }
+ if (this.validateEitObj && this.validateEitObj.length > 0) {
+ this.fillEITStructure();
+ }
+ }
+ fillDropdownList(segmentName, optionList: any = [], DV: any = "") {
+ let elemID: any = "";
+ let eitObj: any;
+ if (optionList.length > 0) {
+ for (let i = 0; i < this.diffStructure.length; i++) {
+ if (this.diffStructure[i].SEGMENT_NAME == segmentName) {
+ eitObj = this.diffStructure[i];
+ if (
+ this.diffStructure[i].READ_ONLY == "Y" ||
+ this.diffStructure[i].DISPLAY_FLAG == "N"
+ ) {
+ return false;
+ }
+ elemID = this.diffStructure[i].APPLICATION_COLUMN_NAME;
+ break;
+ }
+ }
+ let select = document.getElementById(elemID) as HTMLSelectElement;
+ document.getElementById(elemID).innerHTML = "";
+ if (eitObj.IsEmptyOption && eitObj.REQUIRED_FLAG == "N") {
+ var firstoption = document.createElement("option");
+ firstoption.text = this.ts.trPK("general", "choose");
+ firstoption.value = "";
+ select.add(firstoption);
+ }
+ for (let i = 0; i < optionList.length; i++) {
+ var option = document.createElement("option");
+ option.text = optionList[i].VALUE_COLUMN_NAME;
+ option.value = optionList[i].ID_COLUMN_NAME;
+ select.add(option);
+ }
+ if (select.dataset.hiddenval) {
+ select.value = select.dataset.hiddenval;
+ } else {
+ select.value = DV.P_ID_COLUMN_NAME;
+ }
+ select.disabled = false;
+ }
+ }
+ bindHtmlElemEvents(id, obj) {
+ const elem = document.getElementById(id);
+ console.log(elem);
+ console.log(obj);
+ const elemType = elem.tagName;
+ let changeEvent = "ionChange";
+
+ if (elemType == "SELECT") changeEvent = "change";
+
+ try {
+ elem.addEventListener(changeEvent, e => {
+ elem.classList.remove("requiredClassElm");
+ if (
+ obj.CHILD_SEGMENTS_VS_Splited &&
+ obj.CHILD_SEGMENTS_VS_Splited.length > 0
+ ) {
+ let listArray: any = obj.CHILD_SEGMENTS_VS_Splited;
+ listArray.forEach(element => {
+ this.emptyChildElement(element);
+ this.getValueSet(element);
+ });
+ }
+ if (
+ obj.CHILD_SEGMENTS_DV_Splited &&
+ obj.CHILD_SEGMENTS_DV_Splited.length > 0
+ ) {
+ let listArray: any = obj.CHILD_SEGMENTS_DV_Splited;
+ listArray.forEach(element => {
+ this.emptyChildElement(element);
+ for (let i = 0; i < this.diffStructure.length; i++) {
+ if (this.diffStructure[i].SEGMENT_NAME == element) {
+ this.getDefaultValue(
+ this.diffStructure[i],
+ this.diffStructure[i].DESC_FLEX_NAME,
+ this.diffStructure[i].DESC_FLEX_CONTEXT_CODE,
+ this.diffStructure[i].SEGMENT_NAME,
+ this.diffStructure[i].PARENT_SEGMENTS_VS_SplitedVS,
+ this.diffStructure[i].PARENT_SEGMENTS_DV_Splited
+ );
+ }
+ }
+ });
+ }
+ return false;
+ });
+ } catch (e) {
+ console.log(e.status);
+ }
+ }
+ public getDefaultValue(
+ obj,
+ descFlexName,
+ descFlexContextCode,
+ segmentName,
+ parentValue,
+ ParentsList
+ ) {
+ let dependenciesList: any = [];
+ let parentVal: any = null;
+ let isStandardDate: boolean = false;
+ let isStandardTimeDate: boolean = false;
+ let isStandardTime: boolean = false;
+ let isHidden: boolean = false;
+ let isReadOnlyList: boolean = false;
+ let isSelectElement: boolean = false;
+ isStandardDate = this.isStandardDate(obj);
+ isStandardTimeDate = this.isStandardDateTime(obj);
+ isStandardTime = this.isStandardTime(obj);
+ if (obj.DISPLAY_FLAG == "N") isHidden = true;
+ if (obj.VALIDATION_TYPE != "N" && obj.READ_ONLY == "Y") {
+ isReadOnlyList = true;
+ }
+ if (obj.VALIDATION_TYPE != "N" && obj.READ_ONLY == "N") {
+ isSelectElement = true;
+ }
+ if (
+ parentValue != "" &&
+ (obj.VALIDATION_TYPE == "D" || obj.VALIDATION_TYPE == "Y")
+ ) {
+ let parvalue = this.getDependenciesParams(parentValue);
+ if (parvalue && parvalue[0]) parentVal = parvalue[0].ID_COLUMN_NAME;
+ else {
+ parentVal = null;
+ }
+ if (!parentVal) {
+ return false;
+ }
+ }
+ if (ParentsList != "") {
+ if (parentValue) ParentsList.concat(parentValue);
+ dependenciesList = this.getDependenciesParams(ParentsList);
+ if (!dependenciesList) {
+ return false;
+ }
+ }
+
+ const body = {
+ P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
+ P_MENU_TYPE: this.menuType,
+ P_SELECTED_RESP_ID: this.respID, //-999,
+ P_DESC_FLEX_NAME: descFlexName,
+ P_DESC_FLEX_CONTEXT_CODE: descFlexContextCode,
+ P_SEGMENT_NAME: segmentName,
+ P_PARENT_VALUE: parentVal,
+ GetValueSetValuesTBL: dependenciesList
+ };
+
+ this.eitService.getDefaultValue(body).subscribe((result: any) => {
+ let elem = this.getElementByName(segmentName);
+ let obj = this.handleDefaultValueResult(result);
+ let val = obj.value;
+ let text = obj.text;
+ if (val == null) { val = ""; }
+ if (text == null) { text = ""; }
+ if (isStandardDate) {
+ console.log("isStandardDate");
+ elem.value = this.cs.reverseFormatDate(val);
+ } else if (isStandardTimeDate) {
+ console.log("isStandardTimeDate");
+ if (val) {
+ elem.dataset.dtvalue = this.cs.reverseFormatStandardDate(val);
+ elem.innerHTML = this.cs.reverseFormatStandardDate(val);
+ } else {
+ elem.dataset.dtvalue = "";
+ elem.innerHTML = "";
+ }
+ } else if (isStandardTime) {
+ console.log("isStandardTime");
+ if (val) {
+ elem.dataset.dtvalue = val;
+ elem.innerHTML = val;
+ elem.value = val;
+ } else {
+ elem.dataset.dtvalue = "";
+ elem.innerHTML = "";
+ }
+ } else {
+ if (isSelectElement) {
+ let elem = this.getSelectElementByName(segmentName);
+ elem = document.getElementById(elem),
+ elem.value = val;
+ } else {
+ elem.value = val;
+ elem.innerText = text;
+ elem.setAttribute("value", val);
+ }
+ }
+ if (isHidden || isReadOnlyList) {
+ if (val) elem.dataset.colmText = val;
+ else elem.dataset.colmText = "";
+ elem.value = text;
+ }
+ var event = new Event("ionChange");
+ elem.dispatchEvent(event);
+ });
+ }
+
+ handleDefaultValueResult(result) {
+ let data = {
+ text: result.GetDefaultValueList.P_VALUE_COLUMN_NAME,
+ value: result.GetDefaultValueList.P_ID_COLUMN_NAME
+ };
+ return data;
+ }
+ getSelectElementByName(segmentName) {
+ let elemID: any = "";
+ for (let i = 0; i < this.diffStructure.length; i++) {
+ if (this.diffStructure[i].SEGMENT_NAME == segmentName) {
+ elemID = this.diffStructure[i].APPLICATION_COLUMN_NAME;
+ break;
+ }
+ }
+ return elemID;
+ }
+ getElementByName(segmentName) {
+ let elemID: any = "";
+ for (let i = 0; i < this.diffStructure.length; i++) {
+ if (this.diffStructure[i].SEGMENT_NAME == segmentName) {
+ elemID = this.diffStructure[i].APPLICATION_COLUMN_NAME;
+ break;
+ }
+ }
+ return document.getElementById(elemID) as HTMLInputElement;
+ }
+
+ fillEITStructure() {
+ var obj = { peiObjVer: null, peiExtraInfoID: null };
+ for (let i = 0; i < this.validateEitObj.length; i++) {
+ let val: any;
+ if (this.validateEitObj[i].VARCHAR2_VALUE)
+ val = this.validateEitObj[i].VARCHAR2_VALUE;
+ else if (this.validateEitObj[i].DATE_VALUE)
+ val = this.validateEitObj[i].DATE_VALUE;
+ else if (this.validateEitObj[i].NUMBER_VALUE)
+ val = this.validateEitObj[i].NUMBER_VALUE;
+ const elem = document.getElementById(
+ this.validateEitObj[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement;
+ //obj.transactionNo=this.validateEitObj[i].TRANSACTION_NUMBER;
+ if (elem) {
+ if (val) {
+ let feldDetails = this.diffStructure.find(
+ x =>
+ x.APPLICATION_COLUMN_NAME ==
+ this.validateEitObj[i].APPLICATION_COLUMN_NAME
+ );
+ if (feldDetails) {
+ let isStandardDate = this.isStandardDateVal(feldDetails);
+ let isStandardDateTime = this.isStandardDateTimeVal(feldDetails);
+ let isStandardTime = this.isStandardTimeVal(feldDetails);
+ if (isStandardDate) {
+ elem.value = this.cs.reverseFormatDate(val);
+ } else if (isStandardDateTime) {
+ elem.innerHTML = this.cs.reverseFormatStandardDate(val);
+ elem.dataset.dtvalue = this.cs.reverseFormatStandardDate(val);
+ } else if (isStandardTime) {
+ elem.innerHTML = val;
+ elem.dataset.dtvalue = val;
+ } else {
+ elem.value = val;
+ elem.setAttribute("value", elem.value);
+ }
+ if (
+ feldDetails.DISPLAY_FLAG == "N" ||
+ (feldDetails.VALIDATION_TYPE != "N" &&
+ feldDetails.READ_ONLY == "Y")
+ ) {
+ elem.dataset.colmText = val;
+ elem.value = this.validateEitObj[i].SEGMENT_VALUE_DSP;
+ elem.setAttribute("value", elem.value);
+ }
+ }
+ elem.dataset.hiddenval = val; //hide the value to set it after calling get value set
+ if (
+ feldDetails.CHILD_SEGMENTS_VS_Splited &&
+ feldDetails.CHILD_SEGMENTS_VS_Splited.length > 0
+ ) {
+ let listArray: any = feldDetails.CHILD_SEGMENTS_VS_Splited;
+ listArray.forEach(element => {
+ this.getValueSet(element);
+ });
+ }
+ // var event = new Event('change');
+ // elem.dispatchEvent(event);
+ }
+ } else {
+ if (
+ this.validateEitObj[i].APPLICATION_COLUMN_NAME ==
+ "PEI_OBJECT_VERSION_NUMBER"
+ )
+ obj.peiObjVer = this.validateEitObj[i].NUMBER_VALUE;
+ else if (
+ this.validateEitObj[i].APPLICATION_COLUMN_NAME == "PEI_EXTRA_INFO_ID"
+ )
+ obj.peiExtraInfoID = this.validateEitObj[i].NUMBER_VALUE;
+ }
+ }
+ this.ExtraObj = obj;
+ }
+ public getValueSet(segmentName) {
+ let descFlexName: any = "";
+ let descFlexContextCode: any = "";
+ let parentValue: any = [];
+ let ParentsList: any = [];
+ let parentVal: any = null;
+ let dependenciesList: any = [];
+ let validationType: string = "";
+
+ for (let i = 0; i < this.diffStructure.length; i++) {
+ if (this.diffStructure[i].SEGMENT_NAME == segmentName) {
+ descFlexName = this.diffStructure[i].DESC_FLEX_NAME;
+ descFlexContextCode = this.diffStructure[i].DESC_FLEX_CONTEXT_CODE;
+ parentValue = this.diffStructure[i].PARENT_SEGMENTS_VS_SplitedVS;
+ ParentsList = this.diffStructure[i].PARENT_SEGMENTS_VS_SplitedVS;
+ validationType = this.diffStructure[i].VALIDATION_TYPE;
+ break;
+ }
+ }
+ if (parentValue != "" && (validationType == "D" || validationType == "Y")) {
+ let parvalue = this.getDependenciesParams(parentValue);
+ if (parvalue && parvalue[0]) parentVal = parvalue[0].ID_COLUMN_NAME;
+ else {
+ parentVal = null;
+ }
+ if (!parentVal) {
+ return false;
+ }
+ }
+ if (ParentsList != "") {
+ dependenciesList = this.getDependenciesParams(ParentsList);
+ if (!dependenciesList) {
+ return false;
+ }
+ }
+ const body = {
+ P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
+ P_MENU_TYPE: this.menuType,
+ P_SELECTED_RESP_ID: this.respID, //-999,
+ P_DESC_FLEX_NAME: descFlexName,
+ P_DESC_FLEX_CONTEXT_CODE: descFlexContextCode,
+ P_SEGMENT_NAME: segmentName,
+ P_PARENT_VALUE: parentVal,
+ GetValueSetValuesTBL: dependenciesList,
+ P_PAGE_NUM: 1,
+ P_PAGE_LIMIT: 1000
+ };
+
+ this.eitService.getSetValue(body).subscribe((result: any) => {
+ if (result.GetValueSetValuesList != null) {
+ this.fillDropdownList(segmentName, result.GetValueSetValuesList);
+ }
+ });
+ let arr: any = [];
+ return arr;
+ }
+ isStandardDateVal(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "X") {
+
+ isSt = true;
+
+ }
+ return isSt;
+ }
+
+ emptyChildElement(segmentName) {
+ let elem = this.getElementByName(segmentName);
+ elem.value = null;
+ elem.innerHTML = "";
+ if ("dtvalue" in elem.dataset) {
+ elem.dataset.dtvalue = "";
+ }
+ if ("colmText" in elem.dataset) {
+ elem.dataset.colmText = "";
+ }
+ var event = new Event("change");
+ elem.dispatchEvent(event);
+ elem.classList.remove("requiredClassElm");
+ }
+ getDependenciesParams(parentsList) {
+ let parentArr: any = [];
+ for (let i = 0; i < parentsList.length; i++) {
+ for (let j = 0; j < this.diffStructure.length; j++) {
+ if (this.diffStructure[j].SEGMENT_NAME == parentsList[i].Name) {
+ if (this.diffStructure[j].DISPLAY_FLAG != "N") {
+ if (this.diffStructure[j].VALIDATION_TYPE == "N") {
+ let idColName: string;
+ let val: any;
+ if (
+ this.diffStructure[j].FORMAT_TYPE == "Y" ||
+ this.diffStructure[j].FORMAT_TYPE == "I"
+ ) {
+ //standard date time or //time
+ let elem = document.getElementById(
+ this.diffStructure[j].APPLICATION_COLUMN_NAME
+ ) as HTMLDivElement;
+ val = elem.dataset.dtvalue;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ }
+ idColName = val;
+ if (this.diffStructure[j].FORMAT_TYPE == "Y")
+ idColName = this.cs.formatStandardDate(val);
+ } else {
+ val = (document.getElementById(
+ this.diffStructure[j].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement).value;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ }
+ idColName = val;
+ if (this.diffStructure[j].FORMAT_TYPE == "X") {
+ //date
+ // idColName = this.cs.formatDate(val);
+ idColName = this.cs.formatDateNew(val);
+ }
+ }
+ parentArr.push({
+ SEGMENT_NAME: this.diffStructure[j].SEGMENT_NAME,
+ VALUE_COLUMN_NAME: val,
+ DESCRIPTION: "",
+ ID_COLUMN_NAME: idColName,
+ FLEX_VALUE_SET_NAME: this.diffStructure[j].FLEX_VALUE_SET_NAME
+ });
+ break;
+ } else {
+ if (this.diffStructure[j].READ_ONLY != "Y") {
+ let x = document.getElementById(
+ this.diffStructure[j].APPLICATION_COLUMN_NAME
+ ) as HTMLSelectElement;
+ let text = x.options[x.selectedIndex]
+ ? x.options[x.selectedIndex].text
+ : "";
+ let val = x.options[x.selectedIndex]
+ ? x.options[x.selectedIndex].value
+ : undefined;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ } else {
+ }
+ if (text == undefined) {
+ text = "";
+ }
+ parentArr.push({
+ SEGMENT_NAME: this.diffStructure[j].SEGMENT_NAME,
+ VALUE_COLUMN_NAME: text,
+ DESCRIPTION: "",
+ ID_COLUMN_NAME: val,
+ FLEX_VALUE_SET_NAME: this.diffStructure[j].FLEX_VALUE_SET_NAME
+ });
+ break;
+ } else {
+ let x = document.getElementById(
+ this.diffStructure[j].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement;
+ let text = x.value;
+ let val = x.dataset.colmText;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ } else {
+ }
+ if (text == undefined) {
+ text = "";
+ }
+ parentArr.push({
+ SEGMENT_NAME: this.diffStructure[j].SEGMENT_NAME,
+ VALUE_COLUMN_NAME: text,
+ DESCRIPTION: "",
+ ID_COLUMN_NAME: val,
+ FLEX_VALUE_SET_NAME: this.diffStructure[j].FLEX_VALUE_SET_NAME
+ });
+ break;
+ }
+ }
+ } else {
+ let x = document.getElementById(
+ this.diffStructure[j].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement;
+ let text = x.value;
+ let val = x.dataset.colmText;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ } else {
+ }
+ if (text == undefined) {
+ text = "";
+ }
+ parentArr.push({
+ SEGMENT_NAME: this.diffStructure[j].SEGMENT_NAME,
+ VALUE_COLUMN_NAME: text,
+ DESCRIPTION: "",
+ ID_COLUMN_NAME: val,
+ FLEX_VALUE_SET_NAME: this.diffStructure[j].FLEX_VALUE_SET_NAME
+ });
+ break;
+ }
+ }
+ }
+ }
+ return parentArr;
+ }
+
+ isStandardTimeVal(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "I") {
+ // standard time
+ //if(obj.DEFAULT_TYPE=="C" || obj.DEFAULT_TYPE=="D" || obj.DEFAULT_TYPE=="P"||obj.DEFAULT_TYPE=="S"){//constant
+ isSt = true;
+ //}
+ }
+ return isSt;
+ }
+ isStandardDateTimeVal(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "Y") {
+ // standard date time
+ //if(obj.DEFAULT_TYPE=="C" || obj.DEFAULT_TYPE=="D" || obj.DEFAULT_TYPE=="P"||obj.DEFAULT_TYPE=="S"){//constant
+ isSt = true;
+ //}
+ }
+ return isSt;
+ }
+
+ isStandardDateTime(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "Y") {
+ // standard date time
+ if (
+ obj.DEFAULT_TYPE == "C" ||
+ obj.DEFAULT_TYPE == "D" ||
+ obj.DEFAULT_TYPE == "P" ||
+ obj.DEFAULT_TYPE == "S"
+ ) {
+ //constant
+ isSt = true;
+ }
+ }
+ return isSt;
+ }
+ isStandardTime(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "I") {
+ // standard date time
+ if (
+ obj.DEFAULT_TYPE == "C" ||
+ obj.DEFAULT_TYPE == "D" ||
+ obj.DEFAULT_TYPE == "P" ||
+ obj.DEFAULT_TYPE == "S"
+ ) {
+ //constant
+ isSt = true;
+ }
+ }
+ return isSt;
+ }
+
+ isStandardDate(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "X") {
+ // standard date
+ if (
+ obj.DEFAULT_TYPE == "C" ||
+ obj.DEFAULT_TYPE == "D" ||
+ obj.DEFAULT_TYPE == "P" ||
+ obj.DEFAULT_TYPE == "S"
+ ) {
+ //constant
+ isSt = true;
+ }
+ }
+ return isSt;
+ }
+
+ fixTransactionNo(): any[] {
+ const list: any = [];
+ let newIndex = 1;
+ const length: number = this.validEitTransactionTbl.length;
+ for (let i = 0; i < length; i++) {
+ // let item :any={};
+ const item = Object.assign({}, this.validEitTransactionTbl[i]);
+ const transNo: number = item.TRANSACTION_NUMBER;
+ const obj: any = item;
+ if (i == 0) {
+ obj.TRANSACTION_NUMBER = newIndex;
+ list.push(obj);
+ } else {
+ const prevEl: any = this.validEitTransactionTbl[i - 1].TRANSACTION_NUMBER;
+ if (transNo == prevEl) {
+ obj.TRANSACTION_NUMBER = newIndex;
+ list.push(obj);
+ } else {
+ newIndex++;
+ obj.TRANSACTION_NUMBER = newIndex;
+ list.push(obj);
+ }
+ }
+ }
+ return list;
+ }
+ removeItems(transNo) {
+ const list = [];
+ for (let i = 0; i < this.validEitTransactionTbl.length; i++) {
+ if (this.validEitTransactionTbl[i].TRANSACTION_NUMBER != transNo) {
+ list.push(this.validEitTransactionTbl[i]);
+ }
+ }
+ this.validEitTransactionTbl = list;
+ }
+ submitTransaction() {
+ // (this.elementRef.nativeElement.querySelectorAll(
+ // "ion-item"
+ // ) as HTMLElement[]).forEach(x => {
+ // x.classList.add("ng-touched");
+ // x.classList.remove("ng-untouched");
+ // });
+
+ // let arrValues = this.getElementsValues();
+
+ // if (arrValues) {
+ // if (!this.startDate || !this.endDate) {
+ // //this.common.showRequiredMsg();
+ // return false;
+ // }
+ // let Sdata = moment(this.startDate).format("MM/DD/YYYY");
+ // let Edata = moment(this.endDate).format("MM/DD/YYYY");
+
+ this.eitRequest = new EitRequest();
+ const list: any = this.getElementsValues();
+ this.eitRequest.EITTransactionTBL = list;
+ this.eitRequest.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
+ this.eitRequest.P_MENU_TYPE = this.selectedMenu.MENU_TYPE;
+ this.eitRequest.P_SELECTED_RESP_ID = -999;// this.selectedMenu.RESP_ID; // this.selMenu.List_Menu.RESP_ID,//-999,
+ this.eitRequest.P_FUNCTION_NAME = this.functionName;
+ this.eitRequest.P_DESC_FLEX_NAME = this.template.CONCURRENT_PROGRAM_NAME;
+ // this.reportSubmitRequest = {}
+ this.reports
+ .submitTransaction(this.eitRequest, {}, this.ts.trPK('general', 'retry'))
+ .subscribe((result: any) => {
+ this.handleSubmitAbsence(result);
+ });
+ }
+
+
+
+ private handleSubmitAbsence(result) {
+ if (this.cs.validResponse(result)) {
+ if (this.getPassdirfromNotifiPage) {
+ //this.cs.sharedService.setSharedData(result.ResubmitAbsenceTransactionList.P_TRANSACTION_ID, AbsenceResponse.SHARED_DATA);
+ this.cs.openConfirmAbsece();
+
+ } else {
+ //this.cs.sharedService.setSharedData(result.SumbitAbsenceTransactionList.P_TRANSACTION_ID, AbsenceResponse.SHARED_DATA);
+ this.cs.openConfirmAbsece();
+
+ }
+ }
+ }
+ public getElementsValues(): any {
+ this.updatedValues = []; //fill updated list
+ let valuseArr: any = [];
+ let varcharValue: any = null;
+ let numbervalue: any = 0;
+ let dateValue: any = null;
+ let transNo: number = this.comtransNo;
+ let textValue: any;
+ // if(this.ExtraObj.transactionNo)
+ // transNo=this.ExtraObj.transactionNo;
+ for (let i = 0; i < this.diffStructure.length; i++) {
+ varcharValue = null;
+ numbervalue = null;
+ dateValue = null;
+ /*********set transaction No of the updated object ********/
+ if (this.getPassdirfromNotifiPage) {
+ let updatedObj = this.validateEitObj.find(
+ x =>
+ x.APPLICATION_COLUMN_NAME ==
+ this.diffStructure[i].APPLICATION_COLUMN_NAME
+ );
+ let y = updatedObj;
+ transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop
+ }
+ if (this.diffStructure[i].DISPLAY_FLAG != "N") {
+ if (this.diffStructure[i].VALIDATION_TYPE == "N") {
+ let elem = document.getElementById(
+ this.diffStructure[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement;
+ let elemVal = (document.getElementById(
+ this.diffStructure[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement).value;
+ textValue = elemVal;
+ //let elemVal= (document.getElementById(this.eitResponse[i].APPLICATION_COLUMN_NAME)).value;
+ if (
+ this.diffStructure[i].FORMAT_TYPE == "X" &&
+ this.diffStructure[i].DISPLAY_FLAG != "N"
+ ) {
+ //date
+ elemVal = this.cs.formatDate(elemVal);
+ } else if (
+ this.diffStructure[i].FORMAT_TYPE == "Y" &&
+ this.diffStructure[i].DISPLAY_FLAG != "N"
+ ) {
+ //standard date time
+ // elemVal = elem.dataset.dtvalue;
+ // elemVal = this.cs.formatStandardDate(elemVal);
+ elemVal = this.cs.formatDate(elemVal);
+ } else if (
+ this.diffStructure[i].FORMAT_TYPE == "I" &&
+ this.diffStructure[i].DISPLAY_FLAG != "N"
+ ) {
+ //time
+ if (elemVal.length > 5) {
+ elemVal = elemVal.substring(11, 16);
+ } else {
+ elemVal = elemVal;
+ }
+ }
+ if (this.diffStructure[i].REQUIRED_FLAG == "Y" && !elemVal) {
+ elem.classList.add("requiredClassElm");
+ //this.common.showRequiredMsg();
+ return false;
+ } else {
+ elem.classList.remove("requiredClassElm");
+ }
+ // if (elemVal != 'null'){
+ varcharValue = elemVal;
+ //} else{
+ // elemVal = null;
+ // }
+ valuseArr.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: this.diffStructure[i].APPLICATION_COLUMN_NAME,
+ VARCHAR2_VALUE: varcharValue,
+ NUMBER_VALUE: numbervalue,
+ DATE_VALUE: dateValue
+ });
+ } else {
+ let x = document.getElementById(
+ this.diffStructure[i].APPLICATION_COLUMN_NAME
+ ) as HTMLSelectElement;
+ if (this.diffStructure[i].READ_ONLY == "Y") {
+ let text = x.value;
+ let val = x.dataset.colmText;
+ varcharValue = val;
+ textValue = text;
+ } else {
+ let val = x.options[x.selectedIndex]
+ ? x.options[x.selectedIndex].value
+ : null;
+ let txt = x.options[x.selectedIndex]
+ ? x.options[x.selectedIndex].text
+ : null;
+ varcharValue = val;
+ textValue = txt;
+ }
+ if (this.diffStructure[i].REQUIRED_FLAG == "Y" && !varcharValue) {
+ x.classList.add("requiredClassElm");
+ //this.common.showRequiredMsg();
+ return false;
+ } else {
+ x.classList.remove("requiredClassElm");
+ }
+
+ valuseArr.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: this.diffStructure[i].APPLICATION_COLUMN_NAME,
+ VARCHAR2_VALUE: varcharValue,
+ NUMBER_VALUE: numbervalue,
+ DATE_VALUE: dateValue
+ });
+ } //end else
+ } else {
+ let x = document.getElementById(
+ this.diffStructure[i].APPLICATION_COLUMN_NAME
+ ) as HTMLSelectElement;
+ let val = x.dataset.colmText;
+ textValue = x.value;
+ if (this.diffStructure[i].REQUIRED_FLAG == "Y" && !val) {
+ x.classList.add("requiredClassElm");
+ //this.common.showRequiredMsg();
+ return false;
+ } else {
+ x.classList.remove("requiredClassElm");
+ }
+ if (val) varcharValue = val;
+ valuseArr.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: this.diffStructure[i].APPLICATION_COLUMN_NAME,
+ VARCHAR2_VALUE: varcharValue,
+ NUMBER_VALUE: numbervalue,
+ DATE_VALUE: dateValue
+ });
+ }
+
+ if (this.getPassdirfromNotifiPage) {
+ let updatedObj = this.validateEitObj.find(
+ x =>
+ x.APPLICATION_COLUMN_NAME ==
+ this.diffStructure[i].APPLICATION_COLUMN_NAME
+ );
+ let y = updatedObj;
+ y.VARCHAR2_VALUE = varcharValue;
+ y.NUMBER_VALUE = numbervalue;
+ y.DATE_VALUE = dateValue;
+ y.SEGMENT_VALUE_DSP = textValue;
+ transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop
+ this.updatedValues.push(y);
+ } else {
+ if (this.validateEitObj && this.eitSubmitAction == EIT_ACTION.UPDATE) {
+ let updatedObj = this.validateEitObj.find(
+ x =>
+ x.APPLICATION_COLUMN_NAME ==
+ this.diffStructure[i].APPLICATION_COLUMN_NAME
+ );
+ let y = updatedObj;
+ y.VARCHAR2_VALUE = varcharValue;
+ y.NUMBER_VALUE = numbervalue;
+ y.DATE_VALUE = dateValue;
+ y.SEGMENT_VALUE_DSP = textValue;
+ transNo = transNo; // set the transaction number for all items in the updated loop
+ this.updatedValues.push(y);
+ } else {
+ let y = {
+ TRANSACTION_NUMBER: transNo,
+ VARCHAR2_VALUE: varcharValue,
+ NUMBER_VALUE: numbervalue,
+ DATE_VALUE: dateValue,
+ SEGMENT_VALUE_DSP: textValue,
+ APPLICATION_COLUMN_NAME: this.diffStructure[i]
+ .APPLICATION_COLUMN_NAME,
+ DATATYPE: this.diffStructure[i].DATATYPE,
+ DESC_FLEX_CONTEXT_CODE: this.diffStructure[i].DESC_FLEX_CONTEXT_CODE,
+ DESC_FLEX_NAME: this.diffStructure[i].DESC_FLEX_NAME,
+ DISPLAY_FLAG: this.diffStructure[i].DISPLAY_FLAG,
+ SEGMENT_NAME: this.diffStructure[i].SEGMENT_NAME,
+ SEGMENT_PROMPT: this.diffStructure[i].SEGMENT_PROMPT
+ };
+ transNo = transNo; // set the transaction number for all items in the updated loop
+ this.updatedValues.push(y);
+ }
+ }
+ } // end for
+
+ if (this.getPassdirfromNotifiPage) {
+ let updatedObj1 = this.validateEitObj.find(
+ x => x.APPLICATION_COLUMN_NAME === "PEI_ACTION"
+ );
+ let updatedObj2 = this.validateEitObj.find(
+ x => x.APPLICATION_COLUMN_NAME === "PEI_EXTRA_INFO_ID"
+ );
+ let updatedObj3 = this.validateEitObj.find(
+ x => x.APPLICATION_COLUMN_NAME === "PEI_OBJECT_VERSION_NUMBER"
+ );
+ this.updatedValues.push(updatedObj1);
+ this.updatedValues.push(updatedObj2);
+ this.updatedValues.push(updatedObj3);
+ valuseArr = this.fillExtraInformation(
+ valuseArr,
+ updatedObj1.VARCHAR2_VALUE,
+ updatedObj2.NUMBER_VALUE,
+ updatedObj3.NUMBER_VALUE,
+ transNo
+ );
+ } else {
+ if (this.eitSubmitAction == EIT_ACTION.ADD) {
+ this.updatedValues = this.fillExtraValuesUpdated(
+ this.updatedValues,
+ "NEW_ROW",
+ -1,
+ 0,
+ transNo
+ );
+ valuseArr = this.fillExtraInformation(
+ valuseArr,
+ "NEW_ROW",
+ -1,
+ 0,
+ transNo
+ );
+ } else if (this.eitSubmitAction == EIT_ACTION.UPDATE) {
+ valuseArr = this.fillExtraInformation(
+ valuseArr,
+ "UPDATE_ROW",
+ this.ExtraObj.peiExtraInfoID,
+ this.ExtraObj.peiObjVer,
+ transNo
+ );
+ } else if (this.eitSubmitAction == EIT_ACTION.DELETE) {
+ valuseArr = this.fillExtraInformation(
+ valuseArr,
+ "DELETE_ROW",
+ this.ExtraObj.peiExtraInfoID,
+ this.ExtraObj.peiObjVer,
+ transNo
+ );
+ }
+ }
+ return valuseArr;
+ } // end getElementsValues
+ fillExtraInformation(
+ values: any,
+ peiAction: string,
+ peiExtraInfoID: number,
+ peiObjVer: number,
+ transNo: number
+ ): any {
+ values.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: "PEI_ACTION",
+ VARCHAR2_VALUE: peiAction,
+ NUMBER_VALUE: null,
+ DATE_VALUE: null
+ });
+ values.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: "PEI_EXTRA_INFO_ID",
+ VARCHAR2_VALUE: null,
+ NUMBER_VALUE: peiExtraInfoID,
+ DATE_VALUE: null
+ });
+ values.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: "PEI_OBJECT_VERSION_NUMBER",
+ VARCHAR2_VALUE: null,
+ NUMBER_VALUE: peiObjVer,
+ DATE_VALUE: null
+ });
+ return values;
+ }
+ fillExtraValuesUpdated(
+ values: any,
+ peiAction: string,
+ peiExtraInfoID: number,
+ peiObjVer: number,
+ transNo: number
+ ): any {
+ let obj1 = {
+ TRANSACTION_NUMBER: transNo,
+ VARCHAR2_VALUE: peiAction,
+ NUMBER_VALUE: null,
+ DATE_VALUE: null,
+ SEGMENT_VALUE_DSP: "",
+ APPLICATION_COLUMN_NAME: "PEI_ACTION",
+ DATATYPE: "VARCHAR2",
+ DESC_FLEX_CONTEXT_CODE: "",
+ DESC_FLEX_NAME: "",
+ DISPLAY_FLAG: "N",
+ SEGMENT_NAME: "",
+ SEGMENT_PROMPT: ""
+ };
+ let obj2 = {
+ TRANSACTION_NUMBER: 1,
+ APPLICATION_COLUMN_NAME: "PEI_OBJECT_VERSION_NUMBER",
+ VARCHAR2_VALUE: null,
+ NUMBER_VALUE: peiObjVer,
+ DATATYPE: "NUMBER",
+ SEGMENT_VALUE_DSP: "",
+ DATE_VALUE: null,
+ DESC_FLEX_CONTEXT_CODE: "",
+ DESC_FLEX_NAME: "",
+ DISPLAY_FLAG: "N",
+ SEGMENT_NAME: "",
+ SEGMENT_PROMPT: ""
+ };
+ let obj3 = {
+ APPLICATION_COLUMN_NAME: "PEI_EXTRA_INFO_ID",
+ DATATYPE: "NUMBER",
+ DATE_VALUE: null,
+ DESC_FLEX_CONTEXT_CODE: "",
+ DESC_FLEX_NAME: "",
+ DISPLAY_FLAG: "N",
+ NUMBER_VALUE: peiExtraInfoID,
+ SEGMENT_NAME: "",
+ SEGMENT_PROMPT: "",
+ SEGMENT_VALUE_DSP: "",
+ TRANSACTION_NUMBER: transNo,
+ VARCHAR2_VALUE: null
+ };
+ values.push(obj1);
+ values.push(obj2);
+ values.push(obj3);
+ return values;
+ }
+ selectTemplates() {
+ this.elementRef
+ .nativeElement.querySelectorAll('#containerDiv')[0].innerHTML = '';
+ this.getCppDiffStructure(this.template);
+ }
+
+}
diff --git a/Mohem/src/app/reports/report-service.service.spec.ts b/Mohem/src/app/reports/report-service.service.spec.ts
new file mode 100644
index 00000000..dbf6efe5
--- /dev/null
+++ b/Mohem/src/app/reports/report-service.service.spec.ts
@@ -0,0 +1,12 @@
+import { TestBed } from '@angular/core/testing';
+
+import { ReportServiceService } from './report-service.service';
+
+describe('ReportServiceService', () => {
+ beforeEach(() => TestBed.configureTestingModule({}));
+
+ it('should be created', () => {
+ const service: ReportServiceService = TestBed.get(ReportServiceService);
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/reports/report-service.service.ts b/Mohem/src/app/reports/report-service.service.ts
new file mode 100644
index 00000000..d8356223
--- /dev/null
+++ b/Mohem/src/app/reports/report-service.service.ts
@@ -0,0 +1,49 @@
+import { Injectable } from '@angular/core';
+import { AuthenticationService } from '../hmg-common/services/authentication/authentication.service';
+import { CommonService } from '../hmg-common/services/common/common.service';
+import { ConnectorService } from '../hmg-common/services/connector/connector.service';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class ReportServiceService {
+ public static GET_CONCURRENT_PROGRAM = 'Services/ERP.svc/REST/GET_CONCURRENT_PROGRAMS';
+ public static GET_CPP_DIFF_STRUCTURE = 'Services/ERP.svc/REST/GET_CCP_DFF_STRUCTURE';
+ public static SUBMIT_CPP_REQUEST = 'Services/ERP.svc/REST/SUBMIT_CCP_TRANSACTION'
+ constructor(
+ public con: ConnectorService,
+ private authService: AuthenticationService,
+ public cs: CommonService
+ ) { }
+
+ getConcurrentProgram(request, onError, errorLabel) {
+ this.authService.authenticateRequest(request);
+ request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName;
+ return this.con.postNoLoad(
+ ReportServiceService.GET_CONCURRENT_PROGRAM,
+ request,
+ onError,
+ errorLabel
+ );
+ }
+ getCPPDiffStructure(request, onError, errorLabel) {
+ this.authService.authenticateRequest(request);
+ request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName;
+ return this.con.postNoLoad(
+ ReportServiceService.GET_CPP_DIFF_STRUCTURE,
+ request,
+ onError,
+ errorLabel
+ );
+ }
+ submitTransaction(request, onError, errorLabel) {
+ this.authService.authenticateRequest(request);
+ request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName;
+ return this.con.postNoLoad(
+ ReportServiceService.SUBMIT_CPP_REQUEST,
+ request,
+ onError,
+ errorLabel
+ );
+ }
+}
diff --git a/Mohem/src/app/reports/reports.module.ts b/Mohem/src/app/reports/reports.module.ts
new file mode 100644
index 00000000..41be692b
--- /dev/null
+++ b/Mohem/src/app/reports/reports.module.ts
@@ -0,0 +1,39 @@
+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 { ReportsPage } from './reports.page';
+import { ConcurrentReportComponent } from './concurrent-report/concurrent-report.component';
+import { ReportServiceService } from './report-service.service';
+import { HmgCommonModule } from '../hmg-common/hmg-common.module';
+
+
+const routes: Routes = [
+ {
+ path: '',
+ component: ReportsPage,
+ children: [
+ {
+ path: 'concurrent-report',
+ component: ConcurrentReportComponent
+ },
+
+ ],
+ }
+];
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ IonicModule,
+ RouterModule.forChild(routes),
+ HmgCommonModule
+ ],
+ declarations: [ReportsPage, ConcurrentReportComponent],
+ providers: [ReportServiceService]
+})
+export class ReportsPageModule { }
diff --git a/Mohem/src/app/reports/reports.page.html b/Mohem/src/app/reports/reports.page.html
new file mode 100644
index 00000000..67cbe279
--- /dev/null
+++ b/Mohem/src/app/reports/reports.page.html
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/reports/reports.page.scss b/Mohem/src/app/reports/reports.page.scss
new file mode 100644
index 00000000..e69de29b
diff --git a/Mohem/src/app/reports/reports.page.spec.ts b/Mohem/src/app/reports/reports.page.spec.ts
new file mode 100644
index 00000000..94e66db4
--- /dev/null
+++ b/Mohem/src/app/reports/reports.page.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ReportsPage } from './reports.page';
+
+describe('ReportsPage', () => {
+ let component: ReportsPage;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ReportsPage ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ReportsPage);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/reports/reports.page.ts b/Mohem/src/app/reports/reports.page.ts
new file mode 100644
index 00000000..13faa7bd
--- /dev/null
+++ b/Mohem/src/app/reports/reports.page.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-reports',
+ templateUrl: './reports.page.html',
+ styleUrls: ['./reports.page.scss'],
+})
+export class ReportsPage implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+}
diff --git a/Mohem/src/app/termination/service/termination-service.service.spec.ts b/Mohem/src/app/termination/service/termination-service.service.spec.ts
new file mode 100644
index 00000000..f9172295
--- /dev/null
+++ b/Mohem/src/app/termination/service/termination-service.service.spec.ts
@@ -0,0 +1,12 @@
+import { TestBed } from '@angular/core/testing';
+
+import { TerminationServiceService } from './termination-service.service';
+
+describe('TerminationServiceService', () => {
+ beforeEach(() => TestBed.configureTestingModule({}));
+
+ it('should be created', () => {
+ const service: TerminationServiceService = TestBed.get(TerminationServiceService);
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/termination/service/termination-service.service.ts b/Mohem/src/app/termination/service/termination-service.service.ts
new file mode 100644
index 00000000..d980c9d3
--- /dev/null
+++ b/Mohem/src/app/termination/service/termination-service.service.ts
@@ -0,0 +1,40 @@
+import { Injectable } from '@angular/core';
+import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
+import { CommonService } from 'src/app/hmg-common/services/common/common.service';
+import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class TerminationServiceService {
+
+ public static GET_TERM_COLS_STRUCTURE = 'Services/ERP.svc/REST/GET_TERM_COLS_STRUCTURE';
+ public static GET_TERM_DIFF_STRUCTURE = 'Services/ERP.svc/REST/GET_TERM_DFF_STRUCTURE';
+ public static TERMINATION_PAGE = 'termination-page';
+
+ constructor(
+ public con: ConnectorService,
+ private authService: AuthenticationService,
+ public cs: CommonService
+ ) { }
+ getTerminationColStructure(request, onError, errorLabel) {
+ this.authService.authenticateRequest(request);
+ request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName;
+ return this.con.postNoLoad(
+ TerminationServiceService.GET_TERM_COLS_STRUCTURE,
+ request,
+ onError,
+ errorLabel
+ );
+ }
+ getTermDiffStructure(request, onError, errorLabel) {
+ this.authService.authenticateRequest(request);
+ request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName;
+ return this.con.postNoLoad(
+ TerminationServiceService.GET_TERM_DIFF_STRUCTURE,
+ request,
+ onError,
+ errorLabel
+ );
+ }
+}
diff --git a/Mohem/src/app/termination/termination-form/termination-form.component.html b/Mohem/src/app/termination/termination-form/termination-form.component.html
new file mode 100644
index 00000000..f8fa6523
--- /dev/null
+++ b/Mohem/src/app/termination/termination-form/termination-form.component.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{'vacation-rule, next-label' | translate}}
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/termination/termination-form/termination-form.component.scss b/Mohem/src/app/termination/termination-form/termination-form.component.scss
new file mode 100644
index 00000000..e69de29b
diff --git a/Mohem/src/app/termination/termination-form/termination-form.component.spec.ts b/Mohem/src/app/termination/termination-form/termination-form.component.spec.ts
new file mode 100644
index 00000000..bb916661
--- /dev/null
+++ b/Mohem/src/app/termination/termination-form/termination-form.component.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TerminationFormComponent } from './termination-form.component';
+
+describe('TerminationFormComponent', () => {
+ let component: TerminationFormComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TerminationFormComponent ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TerminationFormComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/termination/termination-form/termination-form.component.ts b/Mohem/src/app/termination/termination-form/termination-form.component.ts
new file mode 100644
index 00000000..f175165a
--- /dev/null
+++ b/Mohem/src/app/termination/termination-form/termination-form.component.ts
@@ -0,0 +1,1024 @@
+import { Component, ElementRef, OnInit } from '@angular/core';
+
+import * as moment from 'moment';
+import { EitService } from 'src/app/eit/services/eit.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 { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
+import { DateTimeInput } from 'src/app/uI-elements/date-time.input';
+import { DateInput } from 'src/app/uI-elements/date.input';
+import { HiddenInput } from 'src/app/uI-elements/hidden.input';
+import { NumberInput } from 'src/app/uI-elements/number.input';
+import { SelectInput } from 'src/app/uI-elements/select.input';
+import { TextInput } from 'src/app/uI-elements/text.input';
+import { TimeInput } from 'src/app/uI-elements/time.input';
+import { TerminationServiceService } from '../service/termination-service.service';
+
+
+@Component({
+ selector: 'app-termination-form',
+ templateUrl: './termination-form.component.html',
+ styleUrls: ['./termination-form.component.scss'],
+})
+export class TerminationFormComponent implements OnInit {
+ public selectedMenu;
+ public diffStructure = [];
+ public termColStructure = [];
+ public isUpdate: boolean;
+ private eitVALSettoCall: any = [];
+ private textInput;
+ private numberInput;
+ private dateInput;
+ public direction: string;
+ private datetimeInput;
+ private timeInput;
+ private selectInput;
+ private hiddenInput;
+ private validateEitObj: any = [];
+ public menuType: any;
+ public respID;
+ public selEmp;
+ public eitRequest;
+ private ExtraObj: any = {};
+ private arrValues: any = [];
+ selMenu: MenuResponse;
+ private country;
+ private updatedValues;
+ private effectiveDate;
+ private comtransNo;
+ private reportSubmitRequest = {};
+ getPassdirfromNotifiPage: boolean = false;
+ private startDate;
+ private endDate;
+ constructor(public cs: CommonService, private elementRef: ElementRef, public terminationFormService: TerminationServiceService, public ts: TranslatorService, public eitService: EitService) { }
+
+ ngOnInit() {
+ this.getPassdirfromNotifiPage = this.cs.sharedService.getSharedData('dirfromNotificationPage');
+ this.selectedMenu = this.cs.sharedService.getSharedData(TerminationServiceService.TERMINATION_PAGE, false);
+ this.getTerminationCol();
+ this.direction = TranslatorService.getCurrentLanguageName();
+ this.effectiveDate = new Date();
+ }
+ getTerminationCol() {
+ this.terminationFormService.getTerminationColStructure({
+ P_FUNCTION_NAME: this.selectedMenu.P_FUNCTION_NAME
+ }, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => {
+ this.termColStructure = response;
+ console.log(response);
+ this.getTermDiffStructure();
+ })
+ }
+ getTermDiffStructure() {
+ this.terminationFormService.getTermDiffStructure({
+ P_DESC_FLEX_CONTEXT_CODE: null,
+ P_FUNCTION_NAME: this.selectedMenu.FUNCTION_NAME
+ }, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => {
+ console.log("Diff Structure");
+ console.log(response);
+ this.handleDiffStructure(response);
+ })
+ }
+ handleDiffStructure(result) {
+ if (result.GetCcpDffStructureList != null) {
+ this.diffStructure = result.GetCcpDffStructureList;
+ this.drawEitFields(result.GetCcpDffStructureList);
+ if (this.isUpdate) {
+ //this.submitAbsObjList = this.cs.sharedService.getSharedData(ProfileService.EMP_ADDRESS);
+ //this.fillAbsStructure();
+ }
+ }
+ }
+ private drawEitFields(feildsList) {
+ const containerId = "containerDiv";
+ this.eitVALSettoCall = [];
+ for (let i = 0; i < feildsList.length; i++) {
+ let defaultVal: string = "";
+ let defaultValText: string = "";
+
+ if (feildsList[i].DISPLAY_FLAG != "N") {
+ //check if the field should be displayed
+ if (feildsList[i].VALIDATION_TYPE == "N") {
+ //text , date , time
+ if (feildsList[i].FORMAT_TYPE == "C") {
+ // character
+ this.textInput = new TextInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ defaultValText,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ } else if (feildsList[i].FORMAT_TYPE == "N") {
+ // number
+ this.numberInput = new NumberInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ } else if (feildsList[i].FORMAT_TYPE == "X") {
+ // standard date
+ if (
+ feildsList[i].DEFAULT_TYPE == "C" ||
+ feildsList[i].DEFAULT_TYPE == "D" ||
+ feildsList[i].DEFAULT_TYPE == "P" ||
+ feildsList[i].DEFAULT_TYPE == "S"
+ ) {
+ //constant
+ this.dateInput = new DateInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ this.cs.reverseFormatDate(defaultVal),
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ } else {
+ this.dateInput = new DateInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ "",
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ }
+ } else if (feildsList[i].FORMAT_TYPE == "Y") {
+ // standard date time
+ if (
+ feildsList[i].DEFAULT_TYPE == "C" ||
+ feildsList[i].DEFAULT_TYPE == "D" ||
+ feildsList[i].DEFAULT_TYPE == "P" ||
+ feildsList[i].DEFAULT_TYPE == "S"
+ ) {
+ this.datetimeInput = new DateTimeInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ this.cs.reverseFormatStandardDate(defaultVal),
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ } else {
+ this.datetimeInput = new DateTimeInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ "",
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ }
+ const elem = document.getElementById(
+ feildsList[i].APPLICATION_COLUMN_NAME
+ );
+ } else if (feildsList[i].FORMAT_TYPE == "I") {
+ //time
+ if (
+ feildsList[i].DEFAULT_TYPE == "C" ||
+ feildsList[i].DEFAULT_TYPE == "D" ||
+ feildsList[i].DEFAULT_TYPE == "P" ||
+ feildsList[i].DEFAULT_TYPE == "S"
+ ) {
+ this.timeInput = new TimeInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ "",
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ } else {
+ this.timeInput = new TimeInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ "",
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ }
+ }
+ } else {
+ if (feildsList[i].READ_ONLY == "Y") {
+ this.textInput = new TextInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ defaultValText,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ } else {
+ this.selectInput = new SelectInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ this.fillDropdownList(
+ feildsList[i].SEGMENT_NAME,
+ feildsList[i].E_SERVICES_VS,
+ feildsList[i].E_SERVICES_DV
+ );
+ }
+ }
+ this.bindHtmlElemEvents(
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ feildsList[i]
+ );
+ } else {
+ this.hiddenInput = new HiddenInput(
+ defaultVal,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultValText,
+ containerId
+ );
+ this.bindHtmlElemEvents(
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ feildsList[i]
+ );
+ }
+ }
+ if (this.validateEitObj && this.validateEitObj.length > 0) {
+ this.fillEITStructure();
+ }
+ }
+ fillDropdownList(segmentName, optionList: any = [], DV: any = "") {
+ let elemID: any = "";
+ let eitObj: any;
+ if (optionList.length > 0) {
+ for (let i = 0; i < this.diffStructure.length; i++) {
+ if (this.diffStructure[i].SEGMENT_NAME == segmentName) {
+ eitObj = this.diffStructure[i];
+ if (
+ this.diffStructure[i].READ_ONLY == "Y" ||
+ this.diffStructure[i].DISPLAY_FLAG == "N"
+ ) {
+ return false;
+ }
+ elemID = this.diffStructure[i].APPLICATION_COLUMN_NAME;
+ break;
+ }
+ }
+ let select = document.getElementById(elemID) as HTMLSelectElement;
+ document.getElementById(elemID).innerHTML = "";
+ if (eitObj.IsEmptyOption && eitObj.REQUIRED_FLAG == "N") {
+ var firstoption = document.createElement("option");
+ firstoption.text = this.ts.trPK("general", "choose");
+ firstoption.value = "";
+ select.add(firstoption);
+ }
+ for (let i = 0; i < optionList.length; i++) {
+ var option = document.createElement("option");
+ option.text = optionList[i].VALUE_COLUMN_NAME;
+ option.value = optionList[i].ID_COLUMN_NAME;
+ select.add(option);
+ }
+ if (select.dataset.hiddenval) {
+ select.value = select.dataset.hiddenval;
+ } else {
+ select.value = DV.P_ID_COLUMN_NAME;
+ }
+ select.disabled = false;
+ }
+ }
+ bindHtmlElemEvents(id, obj) {
+ const elem = document.getElementById(id);
+ console.log(elem);
+ console.log(obj);
+ const elemType = elem.tagName;
+ let changeEvent = "ionChange";
+
+ if (elemType == "SELECT") changeEvent = "change";
+
+ try {
+ elem.addEventListener(changeEvent, e => {
+ elem.classList.remove("requiredClassElm");
+ if (
+ obj.CHILD_SEGMENTS_VS_Splited &&
+ obj.CHILD_SEGMENTS_VS_Splited.length > 0
+ ) {
+ let listArray: any = obj.CHILD_SEGMENTS_VS_Splited;
+ listArray.forEach(element => {
+ this.emptyChildElement(element);
+ this.getValueSet(element);
+ });
+ }
+ if (
+ obj.CHILD_SEGMENTS_DV_Splited &&
+ obj.CHILD_SEGMENTS_DV_Splited.length > 0
+ ) {
+ let listArray: any = obj.CHILD_SEGMENTS_DV_Splited;
+ listArray.forEach(element => {
+ this.emptyChildElement(element);
+ for (let i = 0; i < this.diffStructure.length; i++) {
+ if (this.diffStructure[i].SEGMENT_NAME == element) {
+ this.getDefaultValue(
+ this.diffStructure[i],
+ this.diffStructure[i].DESC_FLEX_NAME,
+ this.diffStructure[i].DESC_FLEX_CONTEXT_CODE,
+ this.diffStructure[i].SEGMENT_NAME,
+ this.diffStructure[i].PARENT_SEGMENTS_VS_SplitedVS,
+ this.diffStructure[i].PARENT_SEGMENTS_DV_Splited
+ );
+ }
+ }
+ });
+ }
+ return false;
+ });
+ } catch (e) {
+ console.log(e.status);
+ }
+ }
+ public getDefaultValue(
+ obj,
+ descFlexName,
+ descFlexContextCode,
+ segmentName,
+ parentValue,
+ ParentsList
+ ) {
+ let dependenciesList: any = [];
+ let parentVal: any = null;
+ let isStandardDate: boolean = false;
+ let isStandardTimeDate: boolean = false;
+ let isStandardTime: boolean = false;
+ let isHidden: boolean = false;
+ let isReadOnlyList: boolean = false;
+ let isSelectElement: boolean = false;
+ isStandardDate = this.isStandardDate(obj);
+ isStandardTimeDate = this.isStandardDateTime(obj);
+ isStandardTime = this.isStandardTime(obj);
+ if (obj.DISPLAY_FLAG == "N") isHidden = true;
+ if (obj.VALIDATION_TYPE != "N" && obj.READ_ONLY == "Y") {
+ isReadOnlyList = true;
+ }
+ if (obj.VALIDATION_TYPE != "N" && obj.READ_ONLY == "N") {
+ isSelectElement = true;
+ }
+ if (
+ parentValue != "" &&
+ (obj.VALIDATION_TYPE == "D" || obj.VALIDATION_TYPE == "Y")
+ ) {
+ let parvalue = this.getDependenciesParams(parentValue);
+ if (parvalue && parvalue[0]) parentVal = parvalue[0].ID_COLUMN_NAME;
+ else {
+ parentVal = null;
+ }
+ if (!parentVal) {
+ return false;
+ }
+ }
+ if (ParentsList != "") {
+ if (parentValue) ParentsList.concat(parentValue);
+ dependenciesList = this.getDependenciesParams(ParentsList);
+ if (!dependenciesList) {
+ return false;
+ }
+ }
+
+ const body = {
+ P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
+ P_MENU_TYPE: this.menuType,
+ P_SELECTED_RESP_ID: this.respID, //-999,
+ P_DESC_FLEX_NAME: descFlexName,
+ P_DESC_FLEX_CONTEXT_CODE: descFlexContextCode,
+ P_SEGMENT_NAME: segmentName,
+ P_PARENT_VALUE: parentVal,
+ GetValueSetValuesTBL: dependenciesList
+ };
+
+ this.eitService.getDefaultValue(body).subscribe((result: any) => {
+ let elem = this.getElementByName(segmentName);
+ let obj = this.handleDefaultValueResult(result);
+ let val = obj.value;
+ let text = obj.text;
+ if (val == null) { val = ""; }
+ if (text == null) { text = ""; }
+ if (isStandardDate) {
+ console.log("isStandardDate");
+ elem.value = this.cs.reverseFormatDate(val);
+ } else if (isStandardTimeDate) {
+ console.log("isStandardTimeDate");
+ if (val) {
+ elem.dataset.dtvalue = this.cs.reverseFormatStandardDate(val);
+ elem.innerHTML = this.cs.reverseFormatStandardDate(val);
+ } else {
+ elem.dataset.dtvalue = "";
+ elem.innerHTML = "";
+ }
+ } else if (isStandardTime) {
+ console.log("isStandardTime");
+ if (val) {
+ elem.dataset.dtvalue = val;
+ elem.innerHTML = val;
+ elem.value = val;
+ } else {
+ elem.dataset.dtvalue = "";
+ elem.innerHTML = "";
+ }
+ } else {
+ if (isSelectElement) {
+ let elem = this.getSelectElementByName(segmentName);
+ elem = document.getElementById(elem),
+ elem.value = val;
+ } else {
+ elem.value = val;
+ elem.innerText = text;
+ elem.setAttribute("value", val);
+ }
+ }
+ if (isHidden || isReadOnlyList) {
+ if (val) elem.dataset.colmText = val;
+ else elem.dataset.colmText = "";
+ elem.value = text;
+ }
+ var event = new Event("ionChange");
+ elem.dispatchEvent(event);
+ });
+ }
+
+ handleDefaultValueResult(result) {
+ let data = {
+ text: result.GetDefaultValueList.P_VALUE_COLUMN_NAME,
+ value: result.GetDefaultValueList.P_ID_COLUMN_NAME
+ };
+ return data;
+ }
+ getSelectElementByName(segmentName) {
+ let elemID: any = "";
+ for (let i = 0; i < this.diffStructure.length; i++) {
+ if (this.diffStructure[i].SEGMENT_NAME == segmentName) {
+ elemID = this.diffStructure[i].APPLICATION_COLUMN_NAME;
+ break;
+ }
+ }
+ return elemID;
+ }
+ getElementByName(segmentName) {
+ let elemID: any = "";
+ for (let i = 0; i < this.diffStructure.length; i++) {
+ if (this.diffStructure[i].SEGMENT_NAME == segmentName) {
+ elemID = this.diffStructure[i].APPLICATION_COLUMN_NAME;
+ break;
+ }
+ }
+ return document.getElementById(elemID) as HTMLInputElement;
+ }
+
+ fillEITStructure() {
+ var obj = { peiObjVer: null, peiExtraInfoID: null };
+ for (let i = 0; i < this.validateEitObj.length; i++) {
+ let val: any;
+ if (this.validateEitObj[i].VARCHAR2_VALUE)
+ val = this.validateEitObj[i].VARCHAR2_VALUE;
+ else if (this.validateEitObj[i].DATE_VALUE)
+ val = this.validateEitObj[i].DATE_VALUE;
+ else if (this.validateEitObj[i].NUMBER_VALUE)
+ val = this.validateEitObj[i].NUMBER_VALUE;
+ const elem = document.getElementById(
+ this.validateEitObj[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement;
+ //obj.transactionNo=this.validateEitObj[i].TRANSACTION_NUMBER;
+ if (elem) {
+ if (val) {
+ let feldDetails = this.diffStructure.find(
+ x =>
+ x.APPLICATION_COLUMN_NAME ==
+ this.validateEitObj[i].APPLICATION_COLUMN_NAME
+ );
+ if (feldDetails) {
+ let isStandardDate = this.isStandardDateVal(feldDetails);
+ let isStandardDateTime = this.isStandardDateTimeVal(feldDetails);
+ let isStandardTime = this.isStandardTimeVal(feldDetails);
+ if (isStandardDate) {
+ elem.value = this.cs.reverseFormatDate(val);
+ } else if (isStandardDateTime) {
+ elem.innerHTML = this.cs.reverseFormatStandardDate(val);
+ elem.dataset.dtvalue = this.cs.reverseFormatStandardDate(val);
+ } else if (isStandardTime) {
+ elem.innerHTML = val;
+ elem.dataset.dtvalue = val;
+ } else {
+ elem.value = val;
+ elem.setAttribute("value", elem.value);
+ }
+ if (
+ feldDetails.DISPLAY_FLAG == "N" ||
+ (feldDetails.VALIDATION_TYPE != "N" &&
+ feldDetails.READ_ONLY == "Y")
+ ) {
+ elem.dataset.colmText = val;
+ elem.value = this.validateEitObj[i].SEGMENT_VALUE_DSP;
+ elem.setAttribute("value", elem.value);
+ }
+ }
+ elem.dataset.hiddenval = val; //hide the value to set it after calling get value set
+ if (
+ feldDetails.CHILD_SEGMENTS_VS_Splited &&
+ feldDetails.CHILD_SEGMENTS_VS_Splited.length > 0
+ ) {
+ let listArray: any = feldDetails.CHILD_SEGMENTS_VS_Splited;
+ listArray.forEach(element => {
+ this.getValueSet(element);
+ });
+ }
+ // var event = new Event('change');
+ // elem.dispatchEvent(event);
+ }
+ } else {
+ if (
+ this.validateEitObj[i].APPLICATION_COLUMN_NAME ==
+ "PEI_OBJECT_VERSION_NUMBER"
+ )
+ obj.peiObjVer = this.validateEitObj[i].NUMBER_VALUE;
+ else if (
+ this.validateEitObj[i].APPLICATION_COLUMN_NAME == "PEI_EXTRA_INFO_ID"
+ )
+ obj.peiExtraInfoID = this.validateEitObj[i].NUMBER_VALUE;
+ }
+ }
+ this.ExtraObj = obj;
+ }
+ public getValueSet(segmentName) {
+ let descFlexName: any = "";
+ let descFlexContextCode: any = "";
+ let parentValue: any = [];
+ let ParentsList: any = [];
+ let parentVal: any = null;
+ let dependenciesList: any = [];
+ let validationType: string = "";
+
+ for (let i = 0; i < this.diffStructure.length; i++) {
+ if (this.diffStructure[i].SEGMENT_NAME == segmentName) {
+ descFlexName = this.diffStructure[i].DESC_FLEX_NAME;
+ descFlexContextCode = this.diffStructure[i].DESC_FLEX_CONTEXT_CODE;
+ parentValue = this.diffStructure[i].PARENT_SEGMENTS_VS_SplitedVS;
+ ParentsList = this.diffStructure[i].PARENT_SEGMENTS_VS_SplitedVS;
+ validationType = this.diffStructure[i].VALIDATION_TYPE;
+ break;
+ }
+ }
+ if (parentValue != "" && (validationType == "D" || validationType == "Y")) {
+ let parvalue = this.getDependenciesParams(parentValue);
+ if (parvalue && parvalue[0]) parentVal = parvalue[0].ID_COLUMN_NAME;
+ else {
+ parentVal = null;
+ }
+ if (!parentVal) {
+ return false;
+ }
+ }
+ if (ParentsList != "") {
+ dependenciesList = this.getDependenciesParams(ParentsList);
+ if (!dependenciesList) {
+ return false;
+ }
+ }
+ const body = {
+ P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
+ P_MENU_TYPE: this.menuType,
+ P_SELECTED_RESP_ID: this.respID, //-999,
+ P_DESC_FLEX_NAME: descFlexName,
+ P_DESC_FLEX_CONTEXT_CODE: descFlexContextCode,
+ P_SEGMENT_NAME: segmentName,
+ P_PARENT_VALUE: parentVal,
+ GetValueSetValuesTBL: dependenciesList,
+ P_PAGE_NUM: 1,
+ P_PAGE_LIMIT: 1000
+ };
+
+ this.eitService.getSetValue(body).subscribe((result: any) => {
+ if (result.GetValueSetValuesList != null) {
+ this.fillDropdownList(segmentName, result.GetValueSetValuesList);
+ }
+ });
+ let arr: any = [];
+ return arr;
+ }
+ isStandardDateVal(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "X") {
+
+ isSt = true;
+
+ }
+ return isSt;
+ }
+
+ emptyChildElement(segmentName) {
+ let elem = this.getElementByName(segmentName);
+ elem.value = null;
+ elem.innerHTML = "";
+ if ("dtvalue" in elem.dataset) {
+ elem.dataset.dtvalue = "";
+ }
+ if ("colmText" in elem.dataset) {
+ elem.dataset.colmText = "";
+ }
+ var event = new Event("change");
+ elem.dispatchEvent(event);
+ elem.classList.remove("requiredClassElm");
+ }
+ getDependenciesParams(parentsList) {
+ let parentArr: any = [];
+ for (let i = 0; i < parentsList.length; i++) {
+ for (let j = 0; j < this.diffStructure.length; j++) {
+ if (this.diffStructure[j].SEGMENT_NAME == parentsList[i].Name) {
+ if (this.diffStructure[j].DISPLAY_FLAG != "N") {
+ if (this.diffStructure[j].VALIDATION_TYPE == "N") {
+ let idColName: string;
+ let val: any;
+ if (
+ this.diffStructure[j].FORMAT_TYPE == "Y" ||
+ this.diffStructure[j].FORMAT_TYPE == "I"
+ ) {
+ //standard date time or //time
+ let elem = document.getElementById(
+ this.diffStructure[j].APPLICATION_COLUMN_NAME
+ ) as HTMLDivElement;
+ val = elem.dataset.dtvalue;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ }
+ idColName = val;
+ if (this.diffStructure[j].FORMAT_TYPE == "Y")
+ idColName = this.cs.formatStandardDate(val);
+ } else {
+ val = (document.getElementById(
+ this.diffStructure[j].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement).value;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ }
+ idColName = val;
+ if (this.diffStructure[j].FORMAT_TYPE == "X") {
+ //date
+ // idColName = this.cs.formatDate(val);
+ idColName = this.cs.formatDateNew(val);
+ }
+ }
+ parentArr.push({
+ SEGMENT_NAME: this.diffStructure[j].SEGMENT_NAME,
+ VALUE_COLUMN_NAME: val,
+ DESCRIPTION: "",
+ ID_COLUMN_NAME: idColName,
+ FLEX_VALUE_SET_NAME: this.diffStructure[j].FLEX_VALUE_SET_NAME
+ });
+ break;
+ } else {
+ if (this.diffStructure[j].READ_ONLY != "Y") {
+ let x = document.getElementById(
+ this.diffStructure[j].APPLICATION_COLUMN_NAME
+ ) as HTMLSelectElement;
+ let text = x.options[x.selectedIndex]
+ ? x.options[x.selectedIndex].text
+ : "";
+ let val = x.options[x.selectedIndex]
+ ? x.options[x.selectedIndex].value
+ : undefined;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ } else {
+ }
+ if (text == undefined) {
+ text = "";
+ }
+ parentArr.push({
+ SEGMENT_NAME: this.diffStructure[j].SEGMENT_NAME,
+ VALUE_COLUMN_NAME: text,
+ DESCRIPTION: "",
+ ID_COLUMN_NAME: val,
+ FLEX_VALUE_SET_NAME: this.diffStructure[j].FLEX_VALUE_SET_NAME
+ });
+ break;
+ } else {
+ let x = document.getElementById(
+ this.diffStructure[j].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement;
+ let text = x.value;
+ let val = x.dataset.colmText;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ } else {
+ }
+ if (text == undefined) {
+ text = "";
+ }
+ parentArr.push({
+ SEGMENT_NAME: this.diffStructure[j].SEGMENT_NAME,
+ VALUE_COLUMN_NAME: text,
+ DESCRIPTION: "",
+ ID_COLUMN_NAME: val,
+ FLEX_VALUE_SET_NAME: this.diffStructure[j].FLEX_VALUE_SET_NAME
+ });
+ break;
+ }
+ }
+ } else {
+ let x = document.getElementById(
+ this.diffStructure[j].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement;
+ let text = x.value;
+ let val = x.dataset.colmText;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ } else {
+ }
+ if (text == undefined) {
+ text = "";
+ }
+ parentArr.push({
+ SEGMENT_NAME: this.diffStructure[j].SEGMENT_NAME,
+ VALUE_COLUMN_NAME: text,
+ DESCRIPTION: "",
+ ID_COLUMN_NAME: val,
+ FLEX_VALUE_SET_NAME: this.diffStructure[j].FLEX_VALUE_SET_NAME
+ });
+ break;
+ }
+ }
+ }
+ }
+ return parentArr;
+ }
+
+ isStandardTimeVal(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "I") {
+ // standard time
+ //if(obj.DEFAULT_TYPE=="C" || obj.DEFAULT_TYPE=="D" || obj.DEFAULT_TYPE=="P"||obj.DEFAULT_TYPE=="S"){//constant
+ isSt = true;
+ //}
+ }
+ return isSt;
+ }
+ isStandardDateTimeVal(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "Y") {
+ // standard date time
+ //if(obj.DEFAULT_TYPE=="C" || obj.DEFAULT_TYPE=="D" || obj.DEFAULT_TYPE=="P"||obj.DEFAULT_TYPE=="S"){//constant
+ isSt = true;
+ //}
+ }
+ return isSt;
+ }
+
+ isStandardDateTime(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "Y") {
+ // standard date time
+ if (
+ obj.DEFAULT_TYPE == "C" ||
+ obj.DEFAULT_TYPE == "D" ||
+ obj.DEFAULT_TYPE == "P" ||
+ obj.DEFAULT_TYPE == "S"
+ ) {
+ //constant
+ isSt = true;
+ }
+ }
+ return isSt;
+ }
+ isStandardTime(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "I") {
+ // standard date time
+ if (
+ obj.DEFAULT_TYPE == "C" ||
+ obj.DEFAULT_TYPE == "D" ||
+ obj.DEFAULT_TYPE == "P" ||
+ obj.DEFAULT_TYPE == "S"
+ ) {
+ //constant
+ isSt = true;
+ }
+ }
+ return isSt;
+ }
+
+ isStandardDate(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "X") {
+ // standard date
+ if (
+ obj.DEFAULT_TYPE == "C" ||
+ obj.DEFAULT_TYPE == "D" ||
+ obj.DEFAULT_TYPE == "P" ||
+ obj.DEFAULT_TYPE == "S"
+ ) {
+ //constant
+ isSt = true;
+ }
+ }
+ return isSt;
+ }
+
+ validateAbcenseTransaction() {
+ (this.elementRef.nativeElement.querySelectorAll(
+ "ion-item"
+ ) as HTMLElement[]).forEach(x => {
+ x.classList.add("ng-touched");
+ x.classList.remove("ng-untouched");
+ });
+
+ let arrValues = this.getElementsValues();
+
+ if (arrValues) {
+ if (!this.startDate || !this.endDate) {
+ //this.common.showRequiredMsg();
+ return false;
+ }
+ let Sdata = moment(this.startDate).format("MM/DD/YYYY");
+ let Edata = moment(this.endDate).format("MM/DD/YYYY");
+ this.reportSubmitRequest = {}
+ // this.reports
+ // .submitTransaction(this.reportSubmitRequest, {}, this.ts.trPK('general', 'retry'))
+ // .subscribe((result: any) => {
+ // this.handleSubmitAbsence(result);
+ // });
+ }
+ }
+
+
+ private handleSubmitAbsence(result) {
+ if (this.cs.validResponse(result)) {
+ if (this.getPassdirfromNotifiPage) {
+ //this.cs.sharedService.setSharedData(result.ResubmitAbsenceTransactionList.P_TRANSACTION_ID, AbsenceResponse.SHARED_DATA);
+ this.cs.openConfirmAbsece();
+
+ } else {
+ //this.cs.sharedService.setSharedData(result.SumbitAbsenceTransactionList.P_TRANSACTION_ID, AbsenceResponse.SHARED_DATA);
+ this.cs.openConfirmAbsece();
+
+ }
+ }
+ } getElementsValues() {
+ //this.updatedValues=[];//fill updated list
+ let valuseArr: any = [];
+ let varcharValue: any = null;
+ let numbervalue: any = 0;
+ let dateValue: any = null;
+ let textValue = "";
+ let key: string = "";
+ let obj: any = {};
+ for (let i = 0; i < this.diffStructure.length; i++) {
+ varcharValue = null;
+ numbervalue = null;
+ dateValue = null;
+ if (this.diffStructure[i].DISPLAY_FLAG != "N") {
+ if (this.diffStructure[i].VALIDATION_TYPE == "N") {
+ let elem = document.getElementById(
+ this.diffStructure[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement;
+ let elemVal = "";
+ if (elem.classList.contains('onic-date')) {
+ elemVal = (document.getElementById(
+ this.diffStructure[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement).value;
+ if (elemVal) {
+ elemVal = moment(elemVal).format("YYYY/MM/DD hh:mm:ss");
+ }
+
+ } else {
+ elemVal = (document.getElementById(
+ this.diffStructure[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement).value;
+ }
+ textValue = elemVal;
+
+ if (
+ this.diffStructure[i].FORMAT_TYPE == "X" &&
+ this.diffStructure[i].DISPLAY_FLAG != "N"
+ ) {
+ //date
+ elemVal = this.cs.formatDate(elemVal);
+ } else if (
+ this.diffStructure[i].FORMAT_TYPE == "Y" &&
+ this.diffStructure[i].DISPLAY_FLAG != "N"
+ ) {
+ //standard date time
+ elemVal = elem.dataset.dtvalue;
+ // elemVal = this.common.formatStandardDate(elemVal);
+ } else if (
+ this.diffStructure[i].FORMAT_TYPE == "I" &&
+ this.diffStructure[i].DISPLAY_FLAG != "N"
+ ) {
+ //time
+ elemVal = elem.dataset.dtvalue;
+ }
+ if (this.diffStructure[i].REQUIRED_FLAG == "Y" && !elemVal) {
+ elem.classList.add("requiredClassElm");
+ return false;
+ } else {
+ elem.classList.remove("requiredClassElm");
+ }
+ if (elemVal) varcharValue = elemVal;
+ key = "P_" + this.diffStructure[i].APPLICATION_COLUMN_NAME;
+ // obj = {};
+ obj[key] = varcharValue;
+ } else {
+ let x = document.getElementById(
+ this.diffStructure[i].APPLICATION_COLUMN_NAME
+ ) as HTMLSelectElement;
+ if (this.diffStructure[i].READ_ONLY == "Y") {
+ let text = x.value;
+ let val = x.dataset.colmText;
+ varcharValue = val;
+ textValue = text;
+ } else {
+ let val = x.options[x.selectedIndex]
+ ? x.options[x.selectedIndex].value
+ : null;
+ let txt = x.options[x.selectedIndex]
+ ? x.options[x.selectedIndex].text
+ : null;
+ varcharValue = val;
+ textValue = txt;
+ }
+ if (
+ this.diffStructure[i].REQUIRED_FLAG == "Y" &&
+ !varcharValue
+ ) {
+ x.classList.add("requiredClassElm");
+ // this.common.showRequiredMsg();
+ return false;
+ } else {
+ x.classList.remove("requiredClassElm");
+ }
+
+ key = "P_" + this.diffStructure[i].APPLICATION_COLUMN_NAME;
+ //obj = {};
+ obj[key] = varcharValue;
+ } //end else
+ } else {
+ let x = document.getElementById(
+ this.diffStructure[i].APPLICATION_COLUMN_NAME
+ ) as HTMLSelectElement;
+ let val = x.dataset.colmText;
+ textValue = x.value;
+ if (this.diffStructure[i].REQUIRED_FLAG == "Y" && !varcharValue) {
+ x.classList.add("requiredClassElm");
+ // this.common.showRequiredMsg();
+ return false;
+ } else {
+ x.classList.remove("requiredClassElm");
+ }
+ if (val) varcharValue = val;
+ key = "P_" + this.diffStructure[i].APPLICATION_COLUMN_NAME;
+ //obj = {};
+ obj[key] = varcharValue;
+ }
+ } // end for
+
+ valuseArr.push(obj);
+ return valuseArr;
+ }
+
+
+}
diff --git a/Mohem/src/app/termination/termination.module.ts b/Mohem/src/app/termination/termination.module.ts
new file mode 100644
index 00000000..aadbde53
--- /dev/null
+++ b/Mohem/src/app/termination/termination.module.ts
@@ -0,0 +1,39 @@
+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 { TerminationPage } from './termination.page';
+import { TerminationFormComponent } from './termination-form/termination-form.component';
+import { TerminationServiceService } from './service/termination-service.service';
+import { HmgCommonModule } from '../hmg-common/hmg-common.module';
+
+
+const routes: Routes = [
+ {
+ path: '',
+ component: TerminationPage,
+ children: [
+ {
+ path: 'termination-form',
+ component: TerminationFormComponent
+ },
+
+ ],
+ }
+];
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ IonicModule,
+ RouterModule.forChild(routes),
+ HmgCommonModule
+ ],
+ declarations: [TerminationPage, TerminationFormComponent],
+ providers: [TerminationServiceService]
+})
+export class TerminationPageModule { }
diff --git a/Mohem/src/app/termination/termination.page.html b/Mohem/src/app/termination/termination.page.html
new file mode 100644
index 00000000..67cbe279
--- /dev/null
+++ b/Mohem/src/app/termination/termination.page.html
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/termination/termination.page.scss b/Mohem/src/app/termination/termination.page.scss
new file mode 100644
index 00000000..e69de29b
diff --git a/Mohem/src/app/termination/termination.page.spec.ts b/Mohem/src/app/termination/termination.page.spec.ts
new file mode 100644
index 00000000..04fa359a
--- /dev/null
+++ b/Mohem/src/app/termination/termination.page.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TerminationPage } from './termination.page';
+
+describe('TerminationPage', () => {
+ let component: TerminationPage;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TerminationPage ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TerminationPage);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/termination/termination.page.ts b/Mohem/src/app/termination/termination.page.ts
new file mode 100644
index 00000000..f821ad78
--- /dev/null
+++ b/Mohem/src/app/termination/termination.page.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-termination',
+ templateUrl: './termination.page.html',
+ styleUrls: ['./termination.page.scss'],
+})
+export class TerminationPage implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+}
diff --git a/Mohem/src/assets/imgs/no-images.png b/Mohem/src/assets/imgs/no-images.png
new file mode 100644
index 00000000..e4578a12
Binary files /dev/null and b/Mohem/src/assets/imgs/no-images.png differ
diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json
index 05acf396..62303fa2 100644
--- a/Mohem/src/assets/localization/i18n.json
+++ b/Mohem/src/assets/localization/i18n.json
@@ -209,6 +209,26 @@
}
},
"general": {
+ "concurrent-report": {
+ "en": "Concurrent Report",
+ "ar": "تقرير متزامن"
+ },
+ "from-date": {
+ "en": "From Date",
+ "ar": "من التاريخ"
+ },
+ "to-date": {
+ "en": "To Date",
+ "ar": "حتى الآن"
+ },
+ "termination": {
+ "en": "Termination",
+ "ar": "نهاية"
+ },
+ "pending-transaction": {
+ "en": "Pending Transactions",
+ "ar": "المعاملات المعلقة"
+ },
"huawei-plugin-issue": {
"en": "Error while initializing Huawei Location Plugin",
"ar": "خطأ أثناء تهيئة Huawei Location Plugin"
@@ -1049,7 +1069,7 @@
"en": " Select the type of change you want to make.",
"ar": " حدد نوع التغيير الذي تريد القيام به."
},
- "try-again":{
+ "try-again": {
"en": "somthing went wrong please try again later",
"ar": "حدث خطا الرجاء المحاولة لاحقا"
},
@@ -1061,13 +1081,13 @@
"en": "Update Now",
"ar": "تحديث الان"
},
- "success-create":{
+ "success-create": {
"en": "Request has been submitted successfully",
"ar": "تم تقديم الطلب بنجاح"
},
- "business-card":{
- "en":"View Business Card",
- "ar":"عرض بطاقة العمل"
+ "business-card": {
+ "en": "View Business Card",
+ "ar": "عرض بطاقة العمل"
}
},
"home": {
@@ -2261,23 +2281,22 @@
"en": "Favorite",
"ar": "مفضل"
},
- "workflow":{
- "en":"WorkFlow",
- "ar":"سير العمل"
+ "workflow": {
+ "en": "WorkFlow",
+ "ar": "سير العمل"
},
- "employee-id":{
- "en":"Employee ID",
- "ar":"هوية الموظف"
+ "employee-id": {
+ "en": "Employee ID",
+ "ar": "هوية الموظف"
},
- "employee-email":{
- "en":"Employee Email",
- "ar":"البريد الإلكتروني للموظف"
+ "employee-email": {
+ "en": "Employee Email",
+ "ar": "البريد الإلكتروني للموظف"
},
- "employee-name":{
- "en":"Employee Name",
- "ar":"اسم الموظف"
+ "employee-name": {
+ "en": "Employee Name",
+ "ar": "اسم الموظف"
}
-
},
"worklist": {
"view": {
@@ -3236,5 +3255,19 @@
"en": "Please give us a comments",
"ar": "من فضلك اعطنا تعليقات"
}
+ },
+ "transaction": {
+ "created-for": {
+ "en": "Created for",
+ "ar": "خلقت ل"
+ },
+ "created-date": {
+ "en": "Created Date",
+ "ar": "تاريخ الإنشاء"
+ },
+ "request-type": {
+ "en": "Request type",
+ "ar": "نوع الطلب"
+ }
}
}
\ No newline at end of file