diff --git a/package.json b/package.json index 03455a1..32c9dc3 100644 --- a/package.json +++ b/package.json @@ -51,8 +51,8 @@ "@progress/kendo-angular-treeview": "^5.1.1", "@progress/kendo-angular-upload": "^7.1.0", "@progress/kendo-data-query": "^1.5.4", - "@progress/kendo-drawing": "^1.10.0", - "@progress/kendo-licensing": "^1.1.4", + "@progress/kendo-drawing": "^1.2.0", + "@progress/kendo-licensing": "^1.0.2", "@progress/kendo-svg-icons": "^0.1.2", "@progress/kendo-theme-default": "^4.36.0", "bootstrap": "^4.6.0", diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index e4f4c80..03f8415 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -27,6 +27,7 @@ import {ListAllPeopleComponent} from './list-all-people/list-all-people.componen import {ListIncomeComponent} from './list-income/list-income.component'; import {UploadDetailComponent} from './upload-detail/upload-detail.component'; import {LoansAllComponent} from './loans-all/loans-all.component'; +import {RewardsAllComponent} from './rewards-all/rewards-all.component'; const routes: Routes = [ @@ -46,7 +47,7 @@ const routes: Routes = [ {path : 'broker-profile', component: BrokerProfileComponent, canActivate: [AuthGuard]}, {path : 'client-loan-list', component: ClientLoanListComponent, canActivate: [AuthGuard] }, {path : 'client-profile', component: ClientProfileComponent, canActivate: [AuthGuard] }, - {path : 'list-all-rewards', component: ListAllRewardsComponent, canActivate: [AuthGuard] }, + {path : 'list-all-rewards', component: RewardsAllComponent, canActivate: [AuthGuard] }, {path : 'list-reward-by-broker', component: AdminRewardByBrokerComponent , canActivate: [AuthGuard] }, {path : 'reward-overview', component: RewardOverviewComponent, canActivate: [AuthGuard] }, {path : 'reward-paid', component: RewardPaidComponent, canActivate: [AuthGuard] }, diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 57ea5f9..942bc5b 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -107,6 +107,11 @@ import { LenderResimacXlsIncomeComponent } from './pay-in/lender-resimac-xls-inc import { LenderResimacPdfIncomeComponent } from './pay-in/lender-resimac-pdf-income/lender-resimac-pdf-income.component'; import { LenderPepperIncomeComponent } from './pay-in/lender-pepper-income/lender-pepper-income.component'; import { PayOutDetailsComponent } from './pay-out-details/pay-out-details.component'; +import { PDFExportModule } from '@progress/kendo-angular-pdf-export'; +import { RewardSelectComponent } from './reward-select/reward-select.component'; +import { RewardsAllComponent } from './rewards-all/rewards-all.component'; +import { SinglePayoutRewardsListComponent } from './single-payout-rewards-list/single-payout-rewards-list.component'; + @@ -183,6 +188,9 @@ export function initializeApp(appConfig: AppConfig): () => Promise { LenderResimacPdfIncomeComponent, LenderPepperIncomeComponent, PayOutDetailsComponent, + RewardSelectComponent, + RewardsAllComponent, + SinglePayoutRewardsListComponent, ], imports: [ BrowserModule, @@ -218,7 +226,8 @@ export function initializeApp(appConfig: AppConfig): () => Promise { FileSelectModule, ProgressBarModule, PagerModule, - PopupModule + PopupModule, + PDFExportModule ], providers: [ MenuService, diff --git a/src/app/chart-amount-of-loans/chart-amount-of-loans.component.ts b/src/app/chart-amount-of-loans/chart-amount-of-loans.component.ts index 8c1f156..2b91012 100644 --- a/src/app/chart-amount-of-loans/chart-amount-of-loans.component.ts +++ b/src/app/chart-amount-of-loans/chart-amount-of-loans.component.ts @@ -41,6 +41,9 @@ export class ChartAmountOfLoansComponent implements OnInit { this.share = []; this.label = []; this.count = []; + if ( ! Array.isArray(items) ) { + return; + } items.forEach( (value, index) =>{ this.label.push(value.Kind); this.amount.push(value.Amount / 1000000); diff --git a/src/app/chart-type-of-loans/chart-type-of-loans.component.ts b/src/app/chart-type-of-loans/chart-type-of-loans.component.ts index 2fa761d..a6b98c4 100644 --- a/src/app/chart-type-of-loans/chart-type-of-loans.component.ts +++ b/src/app/chart-type-of-loans/chart-type-of-loans.component.ts @@ -29,13 +29,16 @@ export class ChartTypeOfLoansComponent implements OnInit { map( input => { const ret = []; - input.forEach( (value, index) =>{ - ret.push({ - Kind: value.Kind + ' ' + (value.Share * 100).toFixed(2) + '%', - Count: value.Count, - Share: value.Share, - Amount: value.Amount - }); }); + if (Array.isArray(input)) { + input.forEach( (value, index) =>{ + ret.push({ + Kind: value.Kind + ' ' + (value.Share * 100).toFixed(2) + '%', + Count: value.Count, + Share: value.Share, + Amount: value.Amount + }); + }); + } return ret; } ) diff --git a/src/app/list-all-rewards/list-all-rewards.component.html b/src/app/list-all-rewards/list-all-rewards.component.html index ba5caef..208fa55 100644 --- a/src/app/list-all-rewards/list-all-rewards.component.html +++ b/src/app/list-all-rewards/list-all-rewards.component.html @@ -1,5 +1,3 @@ -
- @@ -118,4 +117,3 @@ -
diff --git a/src/app/list-all-rewards/list-all-rewards.component.scss b/src/app/list-all-rewards/list-all-rewards.component.scss index 409d76a..6c825be 100644 --- a/src/app/list-all-rewards/list-all-rewards.component.scss +++ b/src/app/list-all-rewards/list-all-rewards.component.scss @@ -1,16 +1,7 @@ -.box { - display: flex; - flex-flow: column; - height: calc(100vh - 48px); +kendo-grid.fullheight_grid{ + height: 100% !important; } - -kendo-grid{ - flex: 0 1 auto; - height: 100%; -} - - .customer-photo{ display: inline-block; width: 32px; diff --git a/src/app/list-all-rewards/list-all-rewards.component.ts b/src/app/list-all-rewards/list-all-rewards.component.ts index e4a4d4e..8de9e5c 100644 --- a/src/app/list-all-rewards/list-all-rewards.component.ts +++ b/src/app/list-all-rewards/list-all-rewards.component.ts @@ -25,7 +25,7 @@ export class ListAllRewardsComponent implements OnInit { public selectTableSettings: SelectableSettings | boolean = true; private multipleSelection: SelectableSettings = { - checkboxOnly: true, + checkboxOnly: false, mode: 'multiple', drag: false }; diff --git a/src/app/models/people.model.ts b/src/app/models/people.model.ts index 996c0f6..687224a 100644 --- a/src/app/models/people.model.ts +++ b/src/app/models/people.model.ts @@ -1,5 +1,3 @@ -import {Observable} from 'rxjs'; -import {PeopleService} from '../service/people.service'; export class PeopleModel{ constructor( diff --git a/src/app/models/reward-ex.model.ts b/src/app/models/reward-ex.model.ts new file mode 100644 index 0000000..08e895f --- /dev/null +++ b/src/app/models/reward-ex.model.ts @@ -0,0 +1,52 @@ +import {LoanModel} from './loan.model'; +import {PayOutModel} from './payout.model'; +import {PeopleModel} from './people.model'; + +export class RewardExModel { + public Id: number; + public Ts: Date; + public ToId: string; + public Amount: number; + public Description: string; + public LoanId: string; + public FromId: string; + public PayOutId: number; + + public To?: PeopleModel; + public Loan?: LoanModel; + public From?: PeopleModel; + public PayOut?: PayOutModel; + + constructor(payload: Partial) { + this.Id = payload.Id || 0; + if ( payload.Ts ) { + this.Ts = new Date(payload.Ts); + }else{ + this.Ts = new Date('1800-01-01'); + } + this.ToId = payload.ToId || ''; + this.Amount = payload.Amount || 0; + this.Description = payload.Description || ''; + this.LoanId = payload.LoanId || ''; + this.FromId = payload.FromId || ''; + this.PayOutId = payload.PayOutId || 0; + + // TODO: must make reward Ex workable + // if (payload.To) { + // this.To = new PeopleModel(payload.To); + // } + // + // if (payload.Loan) { + // this.Loan = new LoanModel(payload.Loan); + // } + // + // if ( payload.From) { + // this.From = new PeopleModel(payload.From); + // } + // + // if ( payload. PayOut ) { + // this.PayOut = new PayOutModel(payload.PayOut); + // } + + } +} diff --git a/src/app/models/reward.model.ts b/src/app/models/reward.model.ts index 5c48d0d..4a34bc2 100644 --- a/src/app/models/reward.model.ts +++ b/src/app/models/reward.model.ts @@ -13,6 +13,7 @@ export class RewardModel { private lc: LoanModelCallBacks ){} + public get Role(): string { return this.lc.getUserRole(this.To); } diff --git a/src/app/pay-out-details/pay-out-details.component.html b/src/app/pay-out-details/pay-out-details.component.html index db7969a..d5226f7 100644 --- a/src/app/pay-out-details/pay-out-details.component.html +++ b/src/app/pay-out-details/pay-out-details.component.html @@ -1,10 +1,11 @@ +
-
Receiving End Invoice
+
+
@@ -42,50 +44,31 @@

Invoice #BBB1243

-
    -
  • Date: March 15, 2020
  • -
  • Due date: March 30, 2020
  • -
+ + + + + + + + + + + + + + + + + +
To:
Tibco Turang
email:abc@hotmail.com
Date:March 15, 2020
Pay Date:March 15, 2020
Paid To:BSB/ACC
-
-
Invoice To: - -
-
Payment Details: -
-
    -
  • -
    Total Amount:
    -
  • -
  • Organization:
  • -
  • BSB:
  • -
  • ACC:
  • -
-
    -
  • -
    $1,090
    -
  • -
  • Hong Kong Bank
  • -
  • Hong Kong
  • -
  • Thurnung street, 21
  • -
-
-
-
- +
@@ -111,13 +94,15 @@
-
+ +
+ diff --git a/src/app/pay-out-details/pay-out-details.component.scss b/src/app/pay-out-details/pay-out-details.component.scss index 6c67f09..70013db 100644 --- a/src/app/pay-out-details/pay-out-details.component.scss +++ b/src/app/pay-out-details/pay-out-details.component.scss @@ -9,6 +9,7 @@ div.InvoiceBody { background-color: darkgrey; padding-top:20px; padding-bottom:20px; + height:100%; .container{ padding:0; @@ -66,6 +67,21 @@ div.InvoiceBody { color: #ca974d !important } + table.invoice-to-details { + display:inline-block; + max-width: 400px; + td.left { + text-align: right; + } + td.middle{ + width:15px; + text-align:center; + } + td.right{ + text-align: right; + } + } + .card-header { padding: .9375rem 1.25rem; margin-bottom: 0; diff --git a/src/app/reward-paid/reward-paid.component.html b/src/app/reward-paid/reward-paid.component.html index e8bebd5..6be0f54 100644 --- a/src/app/reward-paid/reward-paid.component.html +++ b/src/app/reward-paid/reward-paid.component.html @@ -1,2 +1,4 @@ +
+ +
- diff --git a/src/app/reward-paid/reward-paid.component.scss b/src/app/reward-paid/reward-paid.component.scss index e69de29..fd8baa7 100644 --- a/src/app/reward-paid/reward-paid.component.scss +++ b/src/app/reward-paid/reward-paid.component.scss @@ -0,0 +1,4 @@ +div.box{ + height: calc( 100vh - 48px); + overflow: scroll; +} diff --git a/src/app/reward-select/reward-select.component.html b/src/app/reward-select/reward-select.component.html new file mode 100644 index 0000000..7c7979c --- /dev/null +++ b/src/app/reward-select/reward-select.component.html @@ -0,0 +1,13 @@ +
+ +
+ + + + + diff --git a/src/app/reward-select/reward-select.component.scss b/src/app/reward-select/reward-select.component.scss new file mode 100644 index 0000000..2240ff3 --- /dev/null +++ b/src/app/reward-select/reward-select.component.scss @@ -0,0 +1,33 @@ +.popup-content { + box-shadow: 1px 1px 10px black; + padding: 10px; + width: calc(100vw - 20px); + height:calc(100vh - 96px); + color: #787878; + background-color: #ca974d29; + border: 1px solid rgba(0,0,0,.05); + border-radius:0 20px 0 0; +} + +div.anchor.wrapper { + width:100%; + position: relative; + + button{ + position: absolute; + /* left: 0px; */ + right: 0px; + top: -10px; + color: red; + border-radius: 100%; + z-index: 1; + } +} + +button.close-popup{ + float: right; + position: absolute; + right: 0px; + border-radius: 100%; + z-index: 1; +} diff --git a/src/app/reward-select/reward-select.component.spec.ts b/src/app/reward-select/reward-select.component.spec.ts new file mode 100644 index 0000000..e51a009 --- /dev/null +++ b/src/app/reward-select/reward-select.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RewardSelectComponent } from './reward-select.component'; + +describe('RewardSelectComponent', () => { + let component: RewardSelectComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ RewardSelectComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(RewardSelectComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/reward-select/reward-select.component.ts b/src/app/reward-select/reward-select.component.ts new file mode 100644 index 0000000..4ba7612 --- /dev/null +++ b/src/app/reward-select/reward-select.component.ts @@ -0,0 +1,30 @@ +import {Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core'; +import {ListAllLoansComponent} from '../list-all-loans/list-all-loans.component'; +import {LoanModel} from '../models/loan.model'; +import {RewardModel} from '../models/reward.model'; + +@Component({ + selector: 'app-reward-select', + templateUrl: './reward-select.component.html', + styleUrls: ['./reward-select.component.scss'] +}) +export class RewardSelectComponent implements OnInit { + // @ViewChild('list', {static: false} ) list: list-all; + @Input() Max = 1; // we do not support multiple loan selection at the moment + @Input() readOnly = false; + @Output() valueChange: EventEmitter = new EventEmitter(); + public Rewards: RewardModel[]; + + // popup + public showPopup = false; + public Offset = { left: 10, top: 48 }; + + constructor() { } + + ngOnInit(): void { + } + + public onToggle(): void { + this.showPopup = !this.showPopup; + } +} diff --git a/src/app/rewards-all/rewards-all.component.html b/src/app/rewards-all/rewards-all.component.html new file mode 100644 index 0000000..1c9041f --- /dev/null +++ b/src/app/rewards-all/rewards-all.component.html @@ -0,0 +1,3 @@ +
+ +
diff --git a/src/app/rewards-all/rewards-all.component.scss b/src/app/rewards-all/rewards-all.component.scss new file mode 100644 index 0000000..879bdc0 --- /dev/null +++ b/src/app/rewards-all/rewards-all.component.scss @@ -0,0 +1,3 @@ +div.box{ + height: calc(100vh - 48px); +} diff --git a/src/app/rewards-all/rewards-all.component.spec.ts b/src/app/rewards-all/rewards-all.component.spec.ts new file mode 100644 index 0000000..59876c0 --- /dev/null +++ b/src/app/rewards-all/rewards-all.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RewardsAllComponent } from './rewards-all.component'; + +describe('RewardsAllComponent', () => { + let component: RewardsAllComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ RewardsAllComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(RewardsAllComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/rewards-all/rewards-all.component.ts b/src/app/rewards-all/rewards-all.component.ts new file mode 100644 index 0000000..abe39d9 --- /dev/null +++ b/src/app/rewards-all/rewards-all.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-rewards-all', + templateUrl: './rewards-all.component.html', + styleUrls: ['./rewards-all.component.scss'] +}) +export class RewardsAllComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/src/app/single-payout-rewards-list/single-payout-rewards-list.component.html b/src/app/single-payout-rewards-list/single-payout-rewards-list.component.html new file mode 100644 index 0000000..a58f3f8 --- /dev/null +++ b/src/app/single-payout-rewards-list/single-payout-rewards-list.component.html @@ -0,0 +1,3 @@ + + + diff --git a/src/app/single-payout-rewards-list/single-payout-rewards-list.component.scss b/src/app/single-payout-rewards-list/single-payout-rewards-list.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/single-payout-rewards-list/single-payout-rewards-list.component.spec.ts b/src/app/single-payout-rewards-list/single-payout-rewards-list.component.spec.ts new file mode 100644 index 0000000..2392470 --- /dev/null +++ b/src/app/single-payout-rewards-list/single-payout-rewards-list.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SinglePayoutRewardsListComponent } from './single-payout-rewards-list.component'; + +describe('SinglePayoutRewardsListComponent', () => { + let component: SinglePayoutRewardsListComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ SinglePayoutRewardsListComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(SinglePayoutRewardsListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/single-payout-rewards-list/single-payout-rewards-list.component.ts b/src/app/single-payout-rewards-list/single-payout-rewards-list.component.ts new file mode 100644 index 0000000..52a518b --- /dev/null +++ b/src/app/single-payout-rewards-list/single-payout-rewards-list.component.ts @@ -0,0 +1,17 @@ +import {Component, Input, OnInit} from '@angular/core'; +import {RewardModel} from '../models/reward.model'; + +@Component({ + selector: 'app-single-payout-rewards-list', + templateUrl: './single-payout-rewards-list.component.html', + styleUrls: ['./single-payout-rewards-list.component.scss'] +}) +export class SinglePayoutRewardsListComponent implements OnInit { + @Input() items: RewardModel[] = []; + constructor() { } + + ngOnInit(): void { + // this.items.push(new RewardModel({})); + } + +}