Enhancement/inverstor search data (#1838)
* Investor Search data * Investor module --------- Co-authored-by: Jose Alberto Hernandez <alberto@blue-daemon.local>
This commit is contained in:
co-authored by
Jose Alberto Hernandez
parent
861cf7a000
commit
ed47d769e3
@@ -1,25 +1,52 @@
|
||||
<div class="container">
|
||||
|
||||
<table mat-table [dataSource]="loanDetails.collateral">
|
||||
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px" class="action-buttons">
|
||||
<button mat-raised-button color="primary" [routerLink]="['../actions/Add Collateral']">
|
||||
Add Collateral
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div fxLayout="row" fxLayoutGap="32px" *ngIf="loanCollaterals?.length > 0" class="performance-history-container">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td fxFlex="25%">
|
||||
<b>Number of Collaterals :</b>
|
||||
</td>
|
||||
<td fxFlex="25%" class="left">
|
||||
{{loanCollaterals?.length | formatNumber}}
|
||||
</td>
|
||||
<td fxFlex="25%">
|
||||
<b>Total Amount :</b>
|
||||
</td>
|
||||
<td fxFlex="25%" class="left">
|
||||
{{totalAmount | formatNumber}}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<table mat-table *ngIf="loanCollaterals?.length > 0" [dataSource]="loanCollaterals">
|
||||
|
||||
<ng-container matColumnDef="id">
|
||||
<th mat-header-cell *matHeaderCellDef> ID </th>
|
||||
<td mat-cell *matCellDef="let ele"> {{ ele.clientCollateralId }} </td>
|
||||
<td mat-cell *matCellDef="let ele"> {{ ele.id }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="quantity">
|
||||
<th mat-header-cell *matHeaderCellDef> Quantity </th>
|
||||
<td mat-cell *matCellDef="let ele"> {{ ele.quantity }} </td>
|
||||
<ng-container matColumnDef="currency">
|
||||
<th mat-header-cell *matHeaderCellDef> Currency </th>
|
||||
<td mat-cell *matCellDef="let ele"> {{ ele.currency.code }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="description">
|
||||
<th mat-header-cell *matHeaderCellDef> Description </th>
|
||||
<td mat-cell *matCellDef="let ele"> {{ ele.description }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="total">
|
||||
<th mat-header-cell *matHeaderCellDef> Total Value </th>
|
||||
<td mat-cell *matCellDef="let ele"> {{ ele.total }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="totalCollateral">
|
||||
<th mat-header-cell *matHeaderCellDef> Total Collateral Value </th>
|
||||
<td mat-cell *matCellDef="let ele"> {{ ele.totalCollateral }} </td>
|
||||
<td mat-cell *matCellDef="let ele"> {{ ele.value | currency:currencyCode:'symbol-narrow':'1.2-2' }} </td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
|
||||
@@ -8,22 +8,28 @@ import { ActivatedRoute } from '@angular/router';
|
||||
})
|
||||
export class LoanCollateralTabComponent implements OnInit {
|
||||
|
||||
/** Loan Details */
|
||||
loanDetails: any;
|
||||
/** Loan Collateral Details */
|
||||
loanCollaterals: any[] = [];
|
||||
/** Columns to be displayed in collateral table. */
|
||||
displayedColumns: string[] = ['id', 'quantity', 'total', 'totalCollateral'];
|
||||
displayedColumns: string[] = ['id', 'currency', 'description', 'total'];
|
||||
|
||||
totalAmount: number;
|
||||
|
||||
/**
|
||||
* Retrieves the loans data from `resolve`.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
*/
|
||||
constructor(private route: ActivatedRoute) {
|
||||
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
|
||||
this.loanDetails = data.loanDetailsData;
|
||||
this.route.data.subscribe((data: { loanCollaterals: any }) => {
|
||||
this.loanCollaterals = data.loanCollaterals;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.totalAmount = 0;
|
||||
this.loanCollaterals.forEach((collateral: any) => {
|
||||
this.totalAmount = this.totalAmount + collateral.value;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user