Bläddra i källkod

before changing people model

tags/2.037
Patrick Sun 4 år sedan
förälder
incheckning
be7d71a32d
27 ändrade filer med 324 tillägg och 69 borttagningar
  1. +2
    -2
      package.json
  2. +2
    -1
      src/app/app-routing.module.ts
  3. +10
    -1
      src/app/app.module.ts
  4. +3
    -0
      src/app/chart-amount-of-loans/chart-amount-of-loans.component.ts
  5. +10
    -7
      src/app/chart-type-of-loans/chart-type-of-loans.component.ts
  6. +1
    -3
      src/app/list-all-rewards/list-all-rewards.component.html
  7. +2
    -11
      src/app/list-all-rewards/list-all-rewards.component.scss
  8. +1
    -1
      src/app/list-all-rewards/list-all-rewards.component.ts
  9. +0
    -2
      src/app/models/people.model.ts
  10. +52
    -0
      src/app/models/reward-ex.model.ts
  11. +1
    -0
      src/app/models/reward.model.ts
  12. +25
    -40
      src/app/pay-out-details/pay-out-details.component.html
  13. +16
    -0
      src/app/pay-out-details/pay-out-details.component.scss
  14. +3
    -1
      src/app/reward-paid/reward-paid.component.html
  15. +4
    -0
      src/app/reward-paid/reward-paid.component.scss
  16. +13
    -0
      src/app/reward-select/reward-select.component.html
  17. +33
    -0
      src/app/reward-select/reward-select.component.scss
  18. +25
    -0
      src/app/reward-select/reward-select.component.spec.ts
  19. +30
    -0
      src/app/reward-select/reward-select.component.ts
  20. +3
    -0
      src/app/rewards-all/rewards-all.component.html
  21. +3
    -0
      src/app/rewards-all/rewards-all.component.scss
  22. +25
    -0
      src/app/rewards-all/rewards-all.component.spec.ts
  23. +15
    -0
      src/app/rewards-all/rewards-all.component.ts
  24. +3
    -0
      src/app/single-payout-rewards-list/single-payout-rewards-list.component.html
  25. +0
    -0
      src/app/single-payout-rewards-list/single-payout-rewards-list.component.scss
  26. +25
    -0
      src/app/single-payout-rewards-list/single-payout-rewards-list.component.spec.ts
  27. +17
    -0
      src/app/single-payout-rewards-list/single-payout-rewards-list.component.ts

+ 2
- 2
package.json Visa fil

"@progress/kendo-angular-treeview": "^5.1.1", "@progress/kendo-angular-treeview": "^5.1.1",
"@progress/kendo-angular-upload": "^7.1.0", "@progress/kendo-angular-upload": "^7.1.0",
"@progress/kendo-data-query": "^1.5.4", "@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-svg-icons": "^0.1.2",
"@progress/kendo-theme-default": "^4.36.0", "@progress/kendo-theme-default": "^4.36.0",
"bootstrap": "^4.6.0", "bootstrap": "^4.6.0",

+ 2
- 1
src/app/app-routing.module.ts Visa fil

import {ListIncomeComponent} from './list-income/list-income.component'; import {ListIncomeComponent} from './list-income/list-income.component';
import {UploadDetailComponent} from './upload-detail/upload-detail.component'; import {UploadDetailComponent} from './upload-detail/upload-detail.component';
import {LoansAllComponent} from './loans-all/loans-all.component'; import {LoansAllComponent} from './loans-all/loans-all.component';
import {RewardsAllComponent} from './rewards-all/rewards-all.component';




const routes: Routes = [ const routes: Routes = [
{path : 'broker-profile', component: BrokerProfileComponent, canActivate: [AuthGuard]}, {path : 'broker-profile', component: BrokerProfileComponent, canActivate: [AuthGuard]},
{path : 'client-loan-list', component: ClientLoanListComponent, canActivate: [AuthGuard] }, {path : 'client-loan-list', component: ClientLoanListComponent, canActivate: [AuthGuard] },
{path : 'client-profile', component: ClientProfileComponent, 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 : 'list-reward-by-broker', component: AdminRewardByBrokerComponent , canActivate: [AuthGuard] },
{path : 'reward-overview', component: RewardOverviewComponent, canActivate: [AuthGuard] }, {path : 'reward-overview', component: RewardOverviewComponent, canActivate: [AuthGuard] },
{path : 'reward-paid', component: RewardPaidComponent, canActivate: [AuthGuard] }, {path : 'reward-paid', component: RewardPaidComponent, canActivate: [AuthGuard] },

+ 10
- 1
src/app/app.module.ts Visa fil

import { LenderResimacPdfIncomeComponent } from './pay-in/lender-resimac-pdf-income/lender-resimac-pdf-income.component'; 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 { LenderPepperIncomeComponent } from './pay-in/lender-pepper-income/lender-pepper-income.component';
import { PayOutDetailsComponent } from './pay-out-details/pay-out-details.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';







LenderResimacPdfIncomeComponent, LenderResimacPdfIncomeComponent,
LenderPepperIncomeComponent, LenderPepperIncomeComponent,
PayOutDetailsComponent, PayOutDetailsComponent,
RewardSelectComponent,
RewardsAllComponent,
SinglePayoutRewardsListComponent,
], ],
imports: [ imports: [
BrowserModule, BrowserModule,
FileSelectModule, FileSelectModule,
ProgressBarModule, ProgressBarModule,
PagerModule, PagerModule,
PopupModule
PopupModule,
PDFExportModule
], ],
providers: [ providers: [
MenuService, MenuService,

+ 3
- 0
src/app/chart-amount-of-loans/chart-amount-of-loans.component.ts Visa fil

this.share = []; this.share = [];
this.label = []; this.label = [];
this.count = []; this.count = [];
if ( ! Array.isArray(items) ) {
return;
}
items.forEach( (value, index) =>{ items.forEach( (value, index) =>{
this.label.push(value.Kind); this.label.push(value.Kind);
this.amount.push(value.Amount / 1000000); this.amount.push(value.Amount / 1000000);

+ 10
- 7
src/app/chart-type-of-loans/chart-type-of-loans.component.ts Visa fil

map( map(
input => { input => {
const ret = []; 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; return ret;
} }
) )

+ 1
- 3
src/app/list-all-rewards/list-all-rewards.component.html Visa fil

<div class="box">

<kendo-grid <kendo-grid
[data]="gridView" [data]="gridView"
[loading]="loading" [loading]="loading"
[sort]="state.sort" [sort]="state.sort"
[filter]="state.filter" [filter]="state.filter"
(dataStateChange)="dataStateChange($event)" (dataStateChange)="dataStateChange($event)"
class="fullheight_grid"
> >
<ng-template kendoGridToolbarTemplate [position]="'top'"> <ng-template kendoGridToolbarTemplate [position]="'top'">
<button (click)="onSelectionEmit()" class="k-button">Custom action</button> <button (click)="onSelectionEmit()" class="k-button">Custom action</button>


</kendo-grid> </kendo-grid>


</div>

+ 2
- 11
src/app/list-all-rewards/list-all-rewards.component.scss Visa fil

.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{ .customer-photo{
display: inline-block; display: inline-block;
width: 32px; width: 32px;

+ 1
- 1
src/app/list-all-rewards/list-all-rewards.component.ts Visa fil



public selectTableSettings: SelectableSettings | boolean = true; public selectTableSettings: SelectableSettings | boolean = true;
private multipleSelection: SelectableSettings = { private multipleSelection: SelectableSettings = {
checkboxOnly: true,
checkboxOnly: false,
mode: 'multiple', mode: 'multiple',
drag: false drag: false
}; };

+ 0
- 2
src/app/models/people.model.ts Visa fil

import {Observable} from 'rxjs';
import {PeopleService} from '../service/people.service';


export class PeopleModel{ export class PeopleModel{
constructor( constructor(

+ 52
- 0
src/app/models/reward-ex.model.ts Visa fil

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<RewardExModel>) {
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);
// }

}
}

+ 1
- 0
src/app/models/reward.model.ts Visa fil

private lc: LoanModelCallBacks private lc: LoanModelCallBacks
){} ){}



public get Role(): string { public get Role(): string {
return this.lc.getUserRole(this.To); return this.lc.getUserRole(this.To);
} }

+ 25
- 40
src/app/pay-out-details/pay-out-details.component.html Visa fil


<div class="InvoiceBody"> <div class="InvoiceBody">
<div class="container d-flex justify-content-center"> <div class="container d-flex justify-content-center">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="card"> <div class="card">
<div class="card-header bg-transparent header-elements-inline"> <div class="card-header bg-transparent header-elements-inline">
<h6 class="card-title">Receiving End Invoice</h6>
<app-reward-select></app-reward-select>
<div class="header-elements"> <div class="header-elements">
<kendo-chip <kendo-chip
[removable]="true" [removable]="true"
</kendo-chip> </kendo-chip>
</div> </div>
</div> </div>
<kendo-pdf-export #pdf paperSize="A4" margin="0.5cm">
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
<div class="mb-4 "> <div class="mb-4 ">
<div class="text-sm-right"> <div class="text-sm-right">
<h4 class="invoice-color mb-2 mt-md-2">Invoice #BBB1243</h4> <h4 class="invoice-color mb-2 mt-md-2">Invoice #BBB1243</h4>
<ul class="list list-unstyled mb-0">
<li>Date: <span class="font-weight-semibold">March 15, 2020</span></li>
<li>Due date: <span class="font-weight-semibold">March 30, 2020</span></li>
</ul>
<table class="invoice-to-details">
<tr>
<td class="left">To</td><td class="middle">:</td><td class="right"><h5 class="my-2">Tibco Turang</h5></td>
</tr>
<tr>
<td class="left">email</td><td class="middle">:</td><td class="right">abc@hotmail.com</td>
</tr>
<tr>
<td class="left">Date</td><td class="middle">:</td><td class="right">March 15, 2020</td>
</tr>
<tr>
<td class="left">Pay Date</td><td class="middle">:</td><td class="right">March 15, 2020</td>
</tr>
<tr>
<td class="left">Paid To</td><td class="middle">:</td><td class="right">BSB/ACC</td>
</tr>

</table>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="d-md-flex flex-md-wrap">
<div class="mb-4 mb-md-2 text-left"> <span class="text-muted">Invoice To:</span>
<ul class="list list-unstyled mb-0">
<li>
<h5 class="my-2">Tibco Turang</h5>
</li>
<li>Gurung Street</li>
<li>23 BB Lane</li>
<li>Hong kong</li>
<li><a href="#" data-abc="true">tibco@samantha.com</a></li>
</ul>
</div>
<div class="mb-2 ml-auto"> <span class="text-muted">Payment Details:</span>
<div class="d-flex flex-wrap wmin-md-400">
<ul class="list list-unstyled mb-0 text-left">
<li>
<h5 class="my-2">Total Amount:</h5>
</li>
<li>Organization:</li>
<li>BSB:</li>
<li>ACC:</li>
</ul>
<ul class="list list-unstyled text-right mb-0 ml-auto">
<li>
<h5 class="font-weight-semibold my-2 amount">$1,090</h5>
</li>
<li><span class="font-weight-semibold">Hong Kong Bank</span></li>
<li>Hong Kong</li>
<li>Thurnung street, 21</li>
</ul>
</div>
</div>
</div>
</div> </div>
<div class="table-responsive"> <div class="table-responsive">
<app-list-all-rewards></app-list-all-rewards>
<app-single-payout-rewards-list></app-single-payout-rewards-list>
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="d-md-flex flex-md-wrap"> <div class="d-md-flex flex-md-wrap">
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="text-right mt-3"> <button type="button" class="btn btn-primary"><b><i class="fa fa-paper-plane-o mr-1"></i></b> Send invoice</button> </div>
</div> </div>
</div> </div>
</div> </div>
</kendo-pdf-export>
<div class="text-right mt-3"> <button type="button" class="btn btn-primary" (click)="pdf.saveAs('invoice.pdf')"><b><i class="fa fa-paper-plane-o mr-1"></i></b> Send invoice</button> </div>
<div class="card-footer"> <span class="text-muted">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.Duis aute irure dolor in reprehenderit</span> </div> <div class="card-footer"> <span class="text-muted">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.Duis aute irure dolor in reprehenderit</span> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>


+ 16
- 0
src/app/pay-out-details/pay-out-details.component.scss Visa fil

background-color: darkgrey; background-color: darkgrey;
padding-top:20px; padding-top:20px;
padding-bottom:20px; padding-bottom:20px;
height:100%;


.container{ .container{
padding:0; padding:0;
color: #ca974d !important 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 { .card-header {
padding: .9375rem 1.25rem; padding: .9375rem 1.25rem;
margin-bottom: 0; margin-bottom: 0;

+ 3
- 1
src/app/reward-paid/reward-paid.component.html Visa fil

<div class="box">
<app-pay-out-details></app-pay-out-details>
</div>


<app-pay-out-details></app-pay-out-details>

+ 4
- 0
src/app/reward-paid/reward-paid.component.scss Visa fil

div.box{
height: calc( 100vh - 48px);
overflow: scroll;
}

+ 13
- 0
src/app/reward-select/reward-select.component.html Visa fil

<div #anchor class="anchor wrapper">
<button kendoButton *ngIf="!readOnly" (click)="onToggle()" [icon]="'edit'" ></button>
</div>

<kendo-popup [offset]="Offset" (anchorViewportLeave)="showPopup = false" *ngIf="showPopup">
<button kendoButton look="flat"
class="close-popup" icon="close-circle" style="float:right;"
(click)="onToggle()"
></button>
<div class='popup-content'>
<app-list-all-rewards></app-list-all-rewards>
</div>
</kendo-popup>

+ 33
- 0
src/app/reward-select/reward-select.component.scss Visa fil

.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;
}

+ 25
- 0
src/app/reward-select/reward-select.component.spec.ts Visa fil

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { RewardSelectComponent } from './reward-select.component';

describe('RewardSelectComponent', () => {
let component: RewardSelectComponent;
let fixture: ComponentFixture<RewardSelectComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ RewardSelectComponent ]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(RewardSelectComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});

+ 30
- 0
src/app/reward-select/reward-select.component.ts Visa fil

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<RewardModel[]> = new EventEmitter<RewardModel[]>();
public Rewards: RewardModel[];

// popup
public showPopup = false;
public Offset = { left: 10, top: 48 };

constructor() { }

ngOnInit(): void {
}

public onToggle(): void {
this.showPopup = !this.showPopup;
}
}

+ 3
- 0
src/app/rewards-all/rewards-all.component.html Visa fil

<div class="box">
<app-list-all-rewards></app-list-all-rewards>
</div>

+ 3
- 0
src/app/rewards-all/rewards-all.component.scss Visa fil

div.box{
height: calc(100vh - 48px);
}

+ 25
- 0
src/app/rewards-all/rewards-all.component.spec.ts Visa fil

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { RewardsAllComponent } from './rewards-all.component';

describe('RewardsAllComponent', () => {
let component: RewardsAllComponent;
let fixture: ComponentFixture<RewardsAllComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ RewardsAllComponent ]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(RewardsAllComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});

+ 15
- 0
src/app/rewards-all/rewards-all.component.ts Visa fil

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 {
}

}

+ 3
- 0
src/app/single-payout-rewards-list/single-payout-rewards-list.component.html Visa fil

<kendo-grid [scrollable]="false">
</kendo-grid>


+ 0
- 0
src/app/single-payout-rewards-list/single-payout-rewards-list.component.scss Visa fil


+ 25
- 0
src/app/single-payout-rewards-list/single-payout-rewards-list.component.spec.ts Visa fil

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { SinglePayoutRewardsListComponent } from './single-payout-rewards-list.component';

describe('SinglePayoutRewardsListComponent', () => {
let component: SinglePayoutRewardsListComponent;
let fixture: ComponentFixture<SinglePayoutRewardsListComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ SinglePayoutRewardsListComponent ]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(SinglePayoutRewardsListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});

+ 17
- 0
src/app/single-payout-rewards-list/single-payout-rewards-list.component.ts Visa fil

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({}));
}

}

Laddar…
Avbryt
Spara