External Identifier as component with copy to clipboard (#1774)
Co-authored-by: Jose Alberto Hernandez <alberto@blue-daemon.local>
This commit is contained in:
co-authored by
Jose Alberto Hernandez
parent
d0bc11256d
commit
f459b1ae4e
+8
-8
@@ -18,7 +18,7 @@
|
||||
<b>Owner External Id :</b>
|
||||
</td>
|
||||
<td fxFlex="25%" class="left">
|
||||
{{activeTransferData.owner.externalId}}
|
||||
<mifosx-external-identifier externalId="{{activeTransferData.owner.externalId}}" completed="true"></mifosx-external-identifier>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -44,27 +44,27 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td fxFlex="50%"><b>Principal Outstanding :</b></td>
|
||||
<td fxFlex="50%" class="r-amount">{{activeTransferData.details.totalPrincipalOutstanding | number}}</td>
|
||||
<td fxFlex="50%" class="r-amount">{{activeTransferData.details.totalPrincipalOutstanding | formatNumber}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td fxFlex="50%"><b>Interest Outstanding :</b></td>
|
||||
<td fxFlex="50%" class="r-amount">{{activeTransferData.details.totalInterestOutstanding | number}}</td>
|
||||
<td fxFlex="50%" class="r-amount">{{activeTransferData.details.totalInterestOutstanding | formatNumber}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td fxFlex="50%"><b>Fees Outstanding :</b></td>
|
||||
<td fxFlex="50%" class="r-amount">{{activeTransferData.details.totalFeeChargesOutstanding | number}}</td>
|
||||
<td fxFlex="50%" class="r-amount">{{activeTransferData.details.totalFeeChargesOutstanding | formatNumber}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td fxFlex="50%"><b>Penalties Outstanding :</b></td>
|
||||
<td fxFlex="50%" class="r-amount">{{activeTransferData.details.totalPenaltyChargesOutstanding | number}}</td>
|
||||
<td fxFlex="50%" class="r-amount">{{activeTransferData.details.totalPenaltyChargesOutstanding | formatNumber}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td fxFlex="50%"><b>Outstanding :</b></td>
|
||||
<td fxFlex="50%" class="r-amount">{{activeTransferData.details.totalOutstanding | number}}</td>
|
||||
<td fxFlex="50%" class="r-amount">{{activeTransferData.details.totalOutstanding | formatNumber}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td fxFlex="50%"><b>Overpaid :</b></td>
|
||||
<td fxFlex="50%" class="r-amount">{{activeTransferData.details.totalOverpaid | number}}</td>
|
||||
<td fxFlex="50%" class="r-amount">{{activeTransferData.details.totalOverpaid | formatNumber}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -144,7 +144,7 @@
|
||||
<ng-container matColumnDef="actions">
|
||||
<th mat-header-cell class="center" *matHeaderCellDef> Actions </th>
|
||||
<td mat-cell *matCellDef="let item" class="center td-min-space">
|
||||
<button class="account-action-button" *ngIf="!isPending(item)" mat-raised-button color="primary" matTooltip="View Journal Entries"
|
||||
<button class="account-action-button" *ngIf="!isPendingOrCanceled(item)" mat-raised-button color="primary" matTooltip="View Journal Entries"
|
||||
matTooltipPosition="left" (click)="routeJournalEntry($event)" [routerLink]="['/', 'journal-entry', 'view-transfer', item.transferId]">
|
||||
<i class="fa fa-arrow-circle-right"></i>
|
||||
</button>
|
||||
|
||||
+18
-6
@@ -11,6 +11,7 @@ import { CancelDialogComponent } from 'app/shared/cancel-dialog/cancel-dialog.co
|
||||
})
|
||||
export class ExternalAssetOwnerTabComponent implements OnInit {
|
||||
|
||||
defaultDate = '9999-12-31';
|
||||
loanTransfersData: any[] = [];
|
||||
activeTransferData: any;
|
||||
loanTransferColumns: string[] = ['status', 'effectiveFrom', 'ownerExternalId', 'transferExternalId', 'settlementDate', 'purchasePriceRatio', 'actions'];
|
||||
@@ -27,8 +28,6 @@ export class ExternalAssetOwnerTabComponent implements OnInit {
|
||||
this.loanTransfersData = data.loanTransfersData.empty ? [] : data.loanTransfersData.content;
|
||||
this.activeTransferData = data.activeTransferData || null;
|
||||
this.existActiveTransfer = (data.activeTransferData && data.activeTransferData.transferId != null);
|
||||
console.log(this.existActiveTransfer);
|
||||
console.log(this.activeTransferData);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -40,7 +39,7 @@ export class ExternalAssetOwnerTabComponent implements OnInit {
|
||||
}
|
||||
|
||||
itemCurrentStatus(item: any): string {
|
||||
if (item.status === 'BUYBACK' && item.effectiveTo === '9999-12-31') {
|
||||
if (this.isBuyBackPending(item)) {
|
||||
return item.status + ' PENDING';
|
||||
}
|
||||
return item.status;
|
||||
@@ -54,6 +53,14 @@ export class ExternalAssetOwnerTabComponent implements OnInit {
|
||||
return (item.status === 'PENDING');
|
||||
}
|
||||
|
||||
isPendingOrCanceled(item: any): boolean {
|
||||
return ((item.status === 'PENDING') || (item.status === 'CANCELLED') || this.isBuyBackPending(item));
|
||||
}
|
||||
|
||||
isBuyBackPending(item: any): boolean {
|
||||
return (item.status === 'BUYBACK' && item.effectiveTo === this.defaultDate);
|
||||
}
|
||||
|
||||
canBeCancelled(): boolean {
|
||||
return this.validateStatus('PENDING');
|
||||
}
|
||||
@@ -62,7 +69,7 @@ export class ExternalAssetOwnerTabComponent implements OnInit {
|
||||
if (this.currentItem == null) {
|
||||
return true;
|
||||
}
|
||||
return ['', 'BUYBACK'].includes(this.currentItem.status);
|
||||
return ['', 'CANCELLED'].includes(this.currentItem.status) || (this.currentItem.status === 'BUYBACK' && this.currentItem.effectiveTo !== this.defaultDate);
|
||||
}
|
||||
|
||||
canBeBuyed(): boolean {
|
||||
@@ -89,9 +96,9 @@ export class ExternalAssetOwnerTabComponent implements OnInit {
|
||||
const payload: any = {
|
||||
transferExternalId: this.currentItem.transferExternalId
|
||||
};
|
||||
this.externalAssetOwnerService.executeExternalAssetOwnerLoanCommand(this.currentItem.loan.loanId, payload, 'cancel')
|
||||
this.externalAssetOwnerService.executeExternalAssetOwnerTransferCommand(this.currentItem.transferId, payload, 'cancel')
|
||||
.subscribe((result: any) => {
|
||||
console.log(result);
|
||||
this.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -105,4 +112,9 @@ export class ExternalAssetOwnerTabComponent implements OnInit {
|
||||
ev.stopPropagation();
|
||||
}
|
||||
|
||||
reload() {
|
||||
const url: string = this.router.url;
|
||||
this.router.navigateByUrl(`/`, {skipLocationChange: true})
|
||||
.then(() => this.router.navigate([url]));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user