From d2940a70d0b503831096786a93cbd4700ad3eae0 Mon Sep 17 00:00:00 2001 From: "Fatimah.Alshammari" Date: Tue, 25 Feb 2020 09:20:26 +0300 Subject: [PATCH] add ticket balance --- .../app/eit/eit-list/eit-list.component.html | 117 ++++++++++++- .../app/eit/eit-list/eit-list.component.scss | 157 +++++++++++++++++- .../app/eit/eit-list/eit-list.component.ts | 37 +++++ Mohem/src/app/home/home.page.ts | 5 + Mohem/src/assets/localization/i18n.json | 20 +++ 5 files changed, 331 insertions(+), 5 deletions(-) diff --git a/Mohem/src/app/eit/eit-list/eit-list.component.html b/Mohem/src/app/eit/eit-list/eit-list.component.html index 5e2769c7..788ffb1d 100644 --- a/Mohem/src/app/eit/eit-list/eit-list.component.html +++ b/Mohem/src/app/eit/eit-list/eit-list.component.html @@ -1,11 +1,122 @@ - + - + + +
+ + + +

{{ts.trPK('absenceList','tickets-balance')}}

+ +
+ +
+ + + +

{{ts.trPK('absenceList','tickets-balance')}}

+
+ +
+ + + +
+ + + +
+ + +
+ +
+ + +
+ +
+ + + +
+
+
+ + +
+
+
+
+ + +
+ + +
+ +
+
+ +
+
+ +
+ +
+
+ + +
+
+ +
+ +
+
+ +
+
+
+ + +
+
+ + + +
diff --git a/Mohem/src/app/eit/eit-list/eit-list.component.scss b/Mohem/src/app/eit/eit-list/eit-list.component.scss index 81a31342..ed9b1079 100644 --- a/Mohem/src/app/eit/eit-list/eit-list.component.scss +++ b/Mohem/src/app/eit/eit-list/eit-list.component.scss @@ -52,7 +52,7 @@ h4 { background-color: #22C6B3; text-transform: capitalize; height: 160px; - position: relative; + // position: relative; display: block; margin-bottom: -28px; } @@ -82,4 +82,157 @@ h4 { border-bottom: 1px solid #e6e6e6; background: #fff !important; height: 1px; -} \ No newline at end of file +} + +//////////////////////////////// + +.colorBG{ + --background: #f0efef; + } + +.Title{ + text-align: center; + color: white; + margin-top: -33px; + font-size: 17px; +} +.title{ + text-align: center; + color: black; + margin-top: -10px; + font-size: 17px; +} +.today-graph{ + display: block !important; + height: 196px; + width: 365px; + /* padding-left: 51px; */ + margin-left: 28px !important; +} + + .headerGrid{ + background-color: white !important; + border: 1px solid #cac8c8 !important; + border-radius: 20px !important; + padding-top: 28px; + padding-bottom: 53px; + margin-left: 9px; + margin-right: 13px; + margin-top: -94px; + margin-bottom: 10px; + + } + .result-graph{ + font-size: 14px; + margin-left: -48px; + margin-right: 3px; + margin-bottom: -30px; + } + + .green-label{ + font-size: 15px !important; + margin-left: 7px !important; + margin-right: 42px; + } + .blue-label{ + font-size: 15px !important; + margin-left: 7px !important; + margin-right: 13px; + } + .light-label{ + font-size: 15px !important; + margin-left: 7px !important; + margin-right: -26px; + } + + .light-dote{ + background-color: #3CB9D5; + width: 12px; + height: 12px; + border-radius: 50% !important; + display: inline-block; + } + .blue-dote{ + + background-color: #22C6B3; + width: 12px; + height: 12px; + border-radius: 50% !important; + display: inline-block; + } + .green-dote{ + background-color: #1FA269; + width: 12px; + height: 12px; + border-radius: 50% !important; + display: inline-block; + margin-right: -1px; + } + .col{ + text-align: right; + } + + .gridService{ + + /* margin-top: 87px; */ + border-radius: 10px; + /* margin-bottom: -49px; */ + margin-left: 14px; + margin-right: 14px; + + } + .columns{ + margin: 3px; + margin-bottom: 13px; + background: white; + border-radius: 27px; + padding-left: 30px; + padding-right: 6px; + padding-top: 19px; + padding-bottom: 8px; + border: 1px solid #cac8c8 !important; + } + + + .service{ + font-size: 22px; + color: black; + letter-spacing: 1px; + font-weight: bold; + } + .services{ + + font-size: 12px; + color: black; + } + + .adult-dote{ + background-color: #3CB9D5; + width: 15px; + height: 15px; + border-radius: 50% !important; + display: inline-block; + margin-left: -17px; + margin-right: 5px; + } + .child-dote{ + + background-color: #22C6B3; + width: 15px; + height: 15px; + border-radius: 50% !important; + display: inline-block; + margin-left: -17px; + margin-right: 5px; + } + .infants-dote{ + background-color: #1FA269; + width: 15px; + height: 15px; + border-radius: 50% !important; + display: inline-block; + margin-left: -17px; + margin-right: 5px; + // margin-bottom: 6px; + } + \ No newline at end of file diff --git a/Mohem/src/app/eit/eit-list/eit-list.component.ts b/Mohem/src/app/eit/eit-list/eit-list.component.ts index 9e92fdd6..51fa8d28 100644 --- a/Mohem/src/app/eit/eit-list/eit-list.component.ts +++ b/Mohem/src/app/eit/eit-list/eit-list.component.ts @@ -40,6 +40,21 @@ export class EitListComponent implements OnInit { private selectedIndex: number; private pAction: number = 0; public headerTitle: string = ""; + data: any; + accrualNetInfants: any; + accrualUNetChild: any; + accrualNetAdult: any; + + + public options = { + cutoutPercentage: 80, + tooltips: { enabled: false }, + legend: { display: false }}; + gaugeType = "full"; + accrualBalancesList: any; + common: any; + // gaugeValue = 11.200; + // gaugeLabel = ""; constructor(private cs: CommonService, private EITService: EitService, private ts: TranslatorService, private modalCtrl: ModalController) { this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); @@ -57,6 +72,26 @@ export class EitListComponent implements OnInit { ngOnInit() { this.getEITTransactions(); + + this.accrualBalancesList = this.cs.sharedService.getSharedData('tickitsbalance', false); + // accrualNetInfants + // accrualUNetChild + // accrualNetAdult + this.accrualNetAdult = this.accrualBalancesList[1].ACCRUAL_NET_ENTITLEMENT; + this.accrualUNetChild = this.accrualBalancesList[2].ACCRUAL_NET_ENTITLEMENT; + this. accrualNetInfants= this.accrualBalancesList[3].ACCRUAL_NET_ENTITLEMENT; + this.data = { + // labels: ['earingTotal', 'deductionTotal'], + datasets: [ + { data: [this.accrualNetInfants, this.accrualUNetChild, this.accrualNetAdult], + backgroundColor: [ + '#1FA269', + '#22C6B3', + '#3CB9D5',], + borderWidth: 2 + } + ] + }; } getEITTransactions() { @@ -455,4 +490,6 @@ export class EitListComponent implements OnInit { this.eitAddedList = list; this.removeItems(item.Collection_Transaction[0].TRANSACTION_NUMBER); } + + } diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index 2016f9a5..2056334b 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -117,6 +117,7 @@ export class HomePage implements OnInit { public displayTime: any; public menuEntries: any; public percent: any; + accrualBalancesList: any; constructor( public ts: TranslatorService, @@ -546,6 +547,7 @@ export class HomePage implements OnInit { } openPage(subMenu) { + console.log("openPage"); let selMenu: MenuResponse = new MenuResponse(); selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); selMenu.GetMenuEntriesList = subMenu; @@ -576,11 +578,14 @@ export class HomePage implements OnInit { .subscribe((result: any) => { if (this.common.validResponse(result)) { let totalTicketsLeft = 0; + this.accrualBalancesList = result.GetAccrualBalancesList; for (const accrualBalance of result.GetAccrualBalancesList) { + if (accrualBalance.ACCURAL_PLAN_NAME === 'HMG Annual Vacation Accrual Plan') { this.statsButtons[3].statsValue = accrualBalance.ACCRUAL_NET_ENTITLEMENT; this.common.sharedService.setSharedData( accrualBalance, 'leaveAccrualBalance'); this.common.sharedService.setSharedData( request, 'leaveAccrualBalanceDate'); + this.common.sharedService.setSharedData( this.accrualBalancesList, 'tickitsbalance') } else { totalTicketsLeft = totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT; } diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 308b8b42..64ef772c 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -1277,6 +1277,26 @@ "attachList": { "en": "Attachment List", "ar": "قائمة المرفقات" + }, + "adult": { + "en": "Adult", + "ar": "بالغ" + }, + "child": { + "en": "Child", + "ar": "طفل" + }, + "infants": { + "en": "Infants", + "ar": "رضيع" + }, + "tickets": { + "en": "Tickets", + "ar": "تذاكر" + }, + "tickets-balance": { + "en": "Ticket Balance", + "ar": "رصيد التذاكر" } }, "accrualBalances": {