Fixed Deposit account view update (#1881)

Co-authored-by: Jose Alberto Hernandez <alberto@blue-daemon.local>
This commit is contained in:
José Alberto Hernández
2023-10-19 00:07:22 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent d92f6c1c5e
commit c7fe21e74a
217 changed files with 23945 additions and 1869 deletions
@@ -22,7 +22,7 @@
<div fxFlexFill>
<span fxFlex="40%">Primary Grouping by Amount:</span>
<span fxFlex="60%">{{ fixedDepositsAccountProductTemplate?.accountChart.isPrimaryGroupingByAmount ? 'Yes' : 'No' }}</span>
<span fxFlex="60%">{{ fixedDepositsAccountProductTemplate?.accountChart.isPrimaryGroupingByAmount | yesNo }}</span>
</div>
<table class="mat-elevation-z1" mat-table [dataSource]="interestRateChartData" #chartsTable multiTemplateDataRows>
@@ -98,7 +98,7 @@
<div fxFlexFill>
<span fxFlex="40%">Transfer Interest to Savings Account?</span>
<span fxFlex="60%">{{ fixedDepositAccountData.transferInterestToSavings ? 'Yes' : 'No' }}</span>
<span fxFlex="60%">{{ fixedDepositAccountData.transferInterestToSavings | yesNo }}</span>
</div>
<div fxFlexFill *ngIf="fixedDepositAccountData.transferInterestToSavings">
@@ -108,7 +108,7 @@
<div fxFlexFill>
<span fxFlex="40%">Apply Penal Interest (less):</span>
<span fxFlex="60%">{{ fixedDepositsAccountProductTemplate.preClosurePenalApplicable ? 'Yes' : 'No' }}</span>
<span fxFlex="60%">{{ fixedDepositsAccountProductTemplate.preClosurePenalApplicable | yesNo }}</span>
</div>
<div fxFlexFill *ngIf="fixedDepositsAccountProductTemplate.preClosurePenalApplicable">
@@ -118,7 +118,7 @@
<div fxFlexFill *ngIf="fixedDepositsAccountProductTemplate.withHoldTax">
<span fxFlex="40%">Withhold Tax is Applicable:</span>
<span fxFlex="60%">{{ fixedDepositAccountData.withHoldTax ? 'Yes' : 'No' }}</span>
<span fxFlex="60%">{{ fixedDepositAccountData.withHoldTax | yesNo }}</span>
</div>
<h3 class="mat-h3" fxFlexFill>Interest Rate Chart</h3>
@@ -149,7 +149,7 @@
<div fxFlexFill>
<span fxFlex="40%">Primary Grouping by Amount:</span>
<span fxFlex="60%">{{ fixedDepositsAccountProductTemplate?.accountChart.isPrimaryGroupingByAmount ? 'Yes' : 'No' }}</span>
<span fxFlex="60%">{{ fixedDepositsAccountProductTemplate?.accountChart.isPrimaryGroupingByAmount | yesNo }}</span>
</div>
<table class="mat-elevation-z1 irc-table" mat-table [dataSource]="interestRateChartData" multiTemplateDataRows>
@@ -6,50 +6,61 @@
<div class="profile-image-container">
<div>
<img mat-card-md-image class="profile-image"
matTooltip="Fixed Deposits Account"
<img mat-card-md-image class="profile-image" matTooltip="Fixed Deposits Account"
[src]="'assets/images/fd_account_placeholder.png'">
</div>
</div>
<div class="mat-typography account-card-title">
<mat-card-title>
<h3>
<i class="fa fa-stop" [ngClass]="fixedDepositsAccountData.status.code | statusLookup" [matTooltip]="fixedDepositsAccountData.status.value"></i>
Account Name : {{fixedDepositsAccountData.depositProductName}}
<h3 fxFlex="95%">
<i class="fa fa-stop" [ngClass]="fixedDepositsAccountData.status.code | statusLookup"
[matTooltip]="fixedDepositsAccountData.status.value"></i>
Fixed Deposit Product : {{fixedDepositsAccountData.fixedDepositsAccountData}}<span class="m-l-10">
<mifosx-account-number accountNo="{{fixedDepositsAccountData.accountNo}}"></mifosx-account-number></span>
</h3>
<div fxFlex="5%">
<button mat-icon-button [matMenuTriggerFor]="accountMenu" aria-label="Loan account actions"
yPosition="below">
<mat-icon matListIcon class="actions-menu">
<fa-icon icon="bars" size="sm"></fa-icon>
</mat-icon>
</button>
</div>
</mat-card-title>
<mat-card-subtitle>
<p>
Account #: {{fixedDepositsAccountData.accountNo}} | Client Name: {{fixedDepositsAccountData.clientName}}<br/>
<span *ngIf="!fixedDepositsAccountData.status.rejected && !fixedDepositsAccountData.status.submittedAndPendingApproval">
Current Balance: {{fixedDepositsAccountData.currency.displaySymbol}}&nbsp;{{fixedDepositsAccountData.summary.accountBalance}}<br/>
Deposit Amount: {{fixedDepositsAccountData.currency.displaySymbol}}&nbsp;{{fixedDepositsAccountData.depositAmount}}<br/>
{{entityType}} Name: {{fixedDepositsAccountData.clientName || fixedDepositsAccountData.groupName}}
<span class="m-l-10" *ngIf="fixedDepositsAccountData.clientAccountNo">({{fixedDepositsAccountData.clientAccountNo}})</span><br />
<span
*ngIf="!fixedDepositsAccountData.status.rejected && !fixedDepositsAccountData.status.submittedAndPendingApproval">
Current Balance:
{{fixedDepositsAccountData.summary.accountBalance | currency:currencyCode:'symbol-narrow':'1.2-2'}}<br />
Deposit Amount:
{{fixedDepositsAccountData.depositAmount | currency:currencyCode:'symbol-narrow':'1.2-2'}}<br />
</span>
</p>
</mat-card-subtitle>
</div>
<mat-menu #accountMenu="matMenu">
<ng-container *ngFor="let button of buttonConfig.singleButtons">
<button mat-menu-item (click)="doAction(button.name)">
<i ngClass="{{button.icon}}"></i> {{button.name}}</button>
</ng-container>
<ng-container *ngIf="buttonConfig.options.length">
<button mat-menu-item [matMenuTriggerFor]="More">More</button>
<mat-menu #More="matMenu">
<span *ngFor="let option of buttonConfig.options">
<button mat-menu-item (click)="doAction(option.name)">{{option.name}}</button>
</span>
</mat-menu>
</ng-container>
</mat-menu>
</mat-card-title-group>
<mat-card-actions class="account-actions">
<ng-container *ngFor="let button of buttonConfig.singleButtons">
<button mat-raised-button (click)="doAction(button.name)">
<i class="{{button.icon}}"></i> {{button.name}}</button>
</ng-container>
<ng-container *ngIf="buttonConfig.options.length">
<button mat-raised-button [matMenuTriggerFor]="More">More</button>
<mat-menu #More="matMenu">
<span *ngFor="let option of buttonConfig.options">
<button mat-menu-item (click)="doAction(option.name)">{{option.name}}</button>
</span>
</mat-menu>
</ng-container>
</mat-card-actions>
</mat-card-header>
<mat-card-content class="content">
@@ -64,23 +75,28 @@
<tbody>
<tr>
<td>Activated On</td>
<td>{{fixedDepositsAccountData.timeline.activatedOnDate ? (fixedDepositsAccountData.timeline.activatedOnDate | dateFormat) : 'Not Activated'}}</td>
<td>{{fixedDepositsAccountData.timeline.activatedOnDate ?
(fixedDepositsAccountData.timeline.activatedOnDate | dateFormat) : 'Not Activated'}}</td>
</tr>
<tr *ngIf="fixedDepositsAccountData.timeline.closedOnDate">
<td>Closed On</td>
<td>{{fixedDepositsAccountData.timeline.closedOnDate | dateFormat}}</td>
<td>{{fixedDepositsAccountData.timeline.closedOnDate | dateFormat}}</td>
</tr>
<tr>
<td>Field Officer</td>
<td>{{fixedDepositsAccountData.fieldOfficerName ? fixedDepositsAccountData.fieldOfficerName : 'Unassigned'}}</td>
<td>{{fixedDepositsAccountData.fieldOfficerName ? fixedDepositsAccountData.fieldOfficerName :
'Unassigned'}}</td>
</tr>
<tr>
<td>Maturity Date</td>
<td>{{fixedDepositsAccountData.maturityDate ? (fixedDepositsAccountData.maturityDate | dateFormat) : 'N/A'}}</td>
<td>{{fixedDepositsAccountData.maturityDate ? (fixedDepositsAccountData.maturityDate | dateFormat) :
'N/A'}}</td>
</tr>
<tr>
<td>Deposit Period</td>
<td>{{fixedDepositsAccountData.depositPeriod}}&nbsp;{{fixedDepositsAccountData.depositPeriodFrequency.value}}</td>
<td>
{{fixedDepositsAccountData.depositPeriod}}&nbsp;{{fixedDepositsAccountData.depositPeriodFrequency.value}}
</td>
</tr>
<tr *ngIf="fixedDepositsAccountData.withHoldTax">
<td>Tax Group</td>
@@ -116,8 +132,10 @@
</tr>
<tr *ngIf="fixedDepositsAccountData.preClosurePenalApplicable">
<td>Pre-cloure Penal</td>
<td>{{fixedDepositsAccountData.preClosurePenalInterest}} % on {{fixedDepositsAccountData.preClosurePenalInterestOnType.value}}</td>
<td>{{fixedDepositsAccountData.preClosurePenalInterest}} % on
{{fixedDepositsAccountData.preClosurePenalInterestOnType.value}}</td>
</tr>
</tbody>
</table>
</div>
@@ -125,30 +143,40 @@
<div fxFlex="49%">
<div *ngIf="!fixedDepositsAccountData.status.rejected && !fixedDepositsAccountData.status.submittedAndPendingApproval; else otherDetails">
<div
*ngIf="!fixedDepositsAccountData.status.rejected && !fixedDepositsAccountData.status.submittedAndPendingApproval; else otherDetails">
<h4 class="table-headers">Performance History</h4>
<table>
<tbody>
<tr>
<td>Principal Amount</td>
<td>{{fixedDepositsAccountData.currency.displaySymbol}}&nbsp;{{fixedDepositsAccountData.depositAmount}}</td>
<td class="r-amount">{{fixedDepositsAccountData.depositAmount | currency:currencyCode:'symbol-narrow':'1.2-2'}}
</td>
</tr>
<tr>
<td>Maturity Amount</td>
<td>{{fixedDepositsAccountData.currency.displaySymbol}}&nbsp;{{fixedDepositsAccountData.maturityAmount}}</td>
<td class="r-amount">{{fixedDepositsAccountData.maturityAmount | currency:currencyCode:'symbol-narrow':'1.2-2'}}
</td>
</tr>
<tr *ngIf="fixedDepositsAccountData.summary.totalDeposits">
<td>Total Deposits</td>
<td>{{fixedDepositsAccountData.currency.displaySymbol}}&nbsp;{{fixedDepositsAccountData.summary.totalDeposits}}</td>
<td class="r-amount">
{{fixedDepositsAccountData.summary.totalDeposits | currency:currencyCode:'symbol-narrow':'1.2-2'}}
</td>
</tr>
<tr *ngIf="fixedDepositsAccountData.summary.totalWithdrawals">
<td>Total Withdrawals</td>
<td>{{fixedDepositsAccountData.currency.displaySymbol}}&nbsp;{{fixedDepositsAccountData.summary.totalWithdrawals}}</td>
<td class="r-amount">
{{fixedDepositsAccountData.summary.totalWithdrawals | currency:currencyCode:'symbol-narrow':'1.2-2'}}
</td>
</tr>
<tr *ngIf="fixedDepositsAccountData.summary.totalInterestEarned >= 0">
<td>Total Interest Earned</td>
<td>{{fixedDepositsAccountData.currency.displaySymbol}}&nbsp;{{fixedDepositsAccountData.summary.totalInterestEarned}}</td>
<td class="r-amount">
{{fixedDepositsAccountData.summary.totalInterestEarned | currency:currencyCode:'symbol-narrow':'1.2-2'}}
</td>
</tr>
</tbody>
</table>
</div>
@@ -159,11 +187,15 @@
<tbody>
<tr>
<td>Principal Amount</td>
<td>{{fixedDepositsAccountData.currency.displaySymbol}}&nbsp;{{fixedDepositsAccountData.depositAmount}}</td>
<td>
{{fixedDepositsAccountData.depositAmount | currency:currencyCode:'symbol-narrow':'1.2-2'}}
</td>
</tr>
<tr>
<td>Maturity Amount</td>
<td>{{fixedDepositsAccountData.currency.displaySymbol}}&nbsp;{{fixedDepositsAccountData.maturityAmount}}</td>
<td>
{{fixedDepositsAccountData.maturityAmount | currency:currencyCode:'symbol-narrow':'1.2-2'}}
</td>
</tr>
</tbody>
</table>
@@ -176,25 +208,26 @@
<nav mat-tab-nav-bar class="navigation-tabs">
<a mat-tab-link [routerLink]="['./interest-rate-chart']" routerLinkActive #IRC="routerLinkActive"
[active]="IRC.isActive">
[active]="IRC.isActive">
Interest Rate Chart
</a>
<a mat-tab-link [routerLink]="['./transactions']" routerLinkActive #transactions="routerLinkActive"
[active]="transactions.isActive">
[active]="transactions.isActive">
Transactions
</a>
<a mat-tab-link [routerLink]="['./charges']" routerLinkActive #charges="routerLinkActive"
[active]="charges.isActive">
[active]="charges.isActive">
Charges
</a>
<a mat-tab-link [routerLink]="['./standing-instructions']" routerLinkActive #standingInstructions="routerLinkActive"
[active]="standingInstructions.isActive" *ngIf="fixedDepositsAccountData.clientId">
<a mat-tab-link [routerLink]="['./standing-instructions']" routerLinkActive
#standingInstructions="routerLinkActive" [active]="standingInstructions.isActive"
*ngIf="fixedDepositsAccountData.clientId">
Standing Instructions
</a>
<ng-container *ngFor="let savingsDatatable of savingsDatatables">
<a mat-tab-link *mifosxHasPermission="'READ_' + savingsDatatable.registeredTableName"
[routerLink]="['./datatables',savingsDatatable.registeredTableName]"
routerLinkActive #datatable="routerLinkActive" [active]="datatable.isActive">
[routerLink]="['./datatables',savingsDatatable.registeredTableName]" routerLinkActive
#datatable="routerLinkActive" [active]="datatable.isActive">
{{savingsDatatable.registeredTableName}}
</a>
</ng-container>
@@ -32,6 +32,9 @@ export class FixedDepositAccountViewComponent implements OnInit {
savingsDatatables: any;
/** Button Configurations */
buttonConfig: FixedDepositsButtonsConfiguration;
/** Entity Type */
entityType: string;
currencyCode: string;
/**
* Fetches fixed deposits account data from `resolve`
@@ -49,7 +52,15 @@ export class FixedDepositAccountViewComponent implements OnInit {
this.route.data.subscribe((data: { fixedDepositsAccountData: any, savingsDatatables: any }) => {
this.fixedDepositsAccountData = data.fixedDepositsAccountData;
this.savingsDatatables = data.savingsDatatables;
this.currencyCode = this.fixedDepositsAccountData.currency.code;
});
if (this.router.url.includes('clients')) {
this.entityType = 'Client';
} else if (this.router.url.includes('groups')) {
this.entityType = 'Group';
} else if (this.router.url.includes('centers')) {
this.entityType = 'Center';
}
}
ngOnInit() {
@@ -97,6 +108,7 @@ export class FixedDepositAccountViewComponent implements OnInit {
case 'Activate':
case 'Close':
case 'Undo Approval':
case 'Undo Activation':
case 'Add Charge':
case 'Withdraw By Client':
case 'Premature Close':
@@ -34,6 +34,10 @@ export class FixedDepositsButtonsConfiguration {
{
name: 'Calculate Interest',
icon: 'fa fa-table'
},
{
name: 'Undo Activation',
icon: 'fa fa-undo'
}
];
break;
@@ -1,4 +1,4 @@
<div class="tab-container mat-typography">
<div class="tab-container mat-typography" *ngIf="showTransactionsData">
<div fxLayoutAlign="start">
<div class="m-b-20">
@@ -8,36 +8,47 @@
<div class="mat-elevation-z1 m-b-25">
<table mat-table [dataSource]="dataSource" >
<table mat-table [dataSource]="dataSource">
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef> ID </th>
<td mat-cell *matCellDef="let transaction"> {{ transaction.id }} </td>
<td mat-cell *matCellDef="let transaction" [ngClass]="transactionColor(transaction)"> {{ transaction.id }} </td>
</ng-container>
<ng-container matColumnDef="transactionDate">
<th mat-header-cell *matHeaderCellDef> Transaction Date </th>
<td mat-cell *matCellDef="let transaction"> {{ transaction.date | dateFormat }} </td>
<td mat-cell *matCellDef="let transaction" [ngClass]="transactionColor(transaction)"> {{ transaction.date | dateFormat }} </td>
</ng-container>
<ng-container matColumnDef="transactionType">
<th mat-header-cell *matHeaderCellDef> Transaction Type </th>
<td mat-cell *matCellDef="let transaction"> {{ transaction.transactionType.value }} </td>
<td mat-cell *matCellDef="let transaction" [ngClass]="transactionColor(transaction)"> {{ transaction.transactionType.value }} </td>
</ng-container>
<ng-container matColumnDef="debit">
<th mat-header-cell *matHeaderCellDef> Debit </th>
<td mat-cell *matCellDef="let transaction"> {{ isDebit(transaction.transactionType) ? transaction.amount : 'N/A'}} </td>
<td mat-cell *matCellDef="let transaction" [ngClass]="transactionColor(transaction)"> {{ isDebit(transaction.transactionType) ? transaction.amount : 'N/A'}} </td>
</ng-container>
<ng-container matColumnDef="credit">
<th mat-header-cell *matHeaderCellDef> Credit </th>
<td mat-cell *matCellDef="let transaction"> {{ !isDebit(transaction.transactionType) ? transaction.amount : 'N/A' }} </td>
<td mat-cell *matCellDef="let transaction" [ngClass]="transactionColor(transaction)"> {{ !isDebit(transaction.transactionType) ? transaction.amount : 'N/A' }} </td>
</ng-container>
<ng-container matColumnDef="balance">
<th mat-header-cell *matHeaderCellDef> Balance </th>
<td mat-cell *matCellDef="let transaction"> {{ transaction.runningBalance }} </td>
<td mat-cell *matCellDef="let transaction" [ngClass]="transactionColor(transaction)"> {{ transaction.runningBalance | number }} </td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef> Actions </th>
<td mat-cell *matCellDef="let transaction">
<button class="account-action-button" mat-raised-button color="primary" matTooltip="View Journal Entries"
matTooltipPosition="left" (click)="routeEdit($event)"
[routerLink]="['/','journal-entry', 'view', 'S'+transaction.id ]">
<i class="fa fa-arrow-circle-right"></i>
</button>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
@@ -1,3 +1,5 @@
@import "assets/styles/helper";
.tab-container {
padding: 1%;
margin: 1%;
@@ -6,8 +8,40 @@
}
table {
width: 100%;
color: $black;
.account-action-button{
min-width: 26px;
padding: 0 0 3px 0;
margin: 0 2%;
line-height: 25px;
}
.select-row:hover {
cursor: pointer;
}
.strike {
text-decoration: line-through;
color: $status-active-overdue;
}
.linked {
color: $status-approved;
}
.accrual {
color: $msg-default;
}
}
}
.active {
background-color: $status-active;
height: 4px;
}
.linked {
background-color: $status-approved;
height: 4px;
}
.undo {
background-color: $status-active-overdue;
height: 4px;
}
@@ -14,11 +14,12 @@ import { ActivatedRoute, Router } from '@angular/router';
export class TransactionsTabComponent implements OnInit {
/** Fixed Deposits Account Status */
status: any;
status: string;
showTransactionsData = false;
/** Transactions Data */
transactionsData: any;
/** Columns to be displayed in transactions table. */
displayedColumns: string[] = ['id', 'transactionDate', 'transactionType', 'debit', 'credit', 'balance'];
displayedColumns: string[] = ['id', 'transactionDate', 'transactionType', 'debit', 'credit', 'balance', 'actions'];
/** Data source for transactions table. */
dataSource: MatTableDataSource<any>;
@@ -32,6 +33,7 @@ export class TransactionsTabComponent implements OnInit {
this.route.parent.data.subscribe((data: { fixedDepositsAccountData: any }) => {
this.transactionsData = data.fixedDepositsAccountData.transactions;
this.status = data.fixedDepositsAccountData.status.value;
this.showTransactionsData = (this.status === 'Active');
});
}
@@ -60,4 +62,26 @@ export class TransactionsTabComponent implements OnInit {
}
}
transactionColor(transaction: any): string {
if (transaction.reversed) {
return 'strike';
}
if (this.isAccrual(transaction.transactionType)) {
return 'accrual';
}
return '';
}
private isAccrual(transactionType: any): boolean {
return (transactionType.accrual);
}
/**
* Stops the propagation to view pages.
* @param $event Mouse Event
*/
routeEdit($event: MouseEvent) {
$event.stopPropagation();
}
}
@@ -5,6 +5,8 @@
<mat-card-content>
<div fxLayout="row wrap" class="content">
<div fxFlex="100%" [ngClass]="transactionColor()">
</div>
<div fxFlex="50%" class="mat-body-strong">
Transaction Id
@@ -13,7 +15,7 @@
<div fxFlex="50%">
{{ transactionData.id }}
</div>
<div fxFlex="50%" class="mat-body-strong">
Type
</div>
@@ -27,7 +29,7 @@
</div>
<div fxFlex="50%">
{{ transactionData.date | dateFormat }}
{{ transactionData.date | dateFormat }}
</div>
<div fxFlex="50%" class="mat-body-strong">
@@ -43,7 +45,7 @@
</div>
<div fxFlex="50%">
{{ transactionData.amount }}
{{ transactionData.amount | currency:transactionData.currency.code:'symbol-narrow':'1.2-2' }}
</div>
<div fxFlex="50%" *ngIf="transactionData.note" class="mat-body-strong">
@@ -59,47 +61,47 @@
<div *ngIf="transactionData.paymentDetailData.paymentType" fxFlex="50%" class="mat-body-strong">
Payment Type
</div>
<div *ngIf="transactionData.paymentDetailData.paymentType" fxFlex="50%">
{{ transactionData.paymentDetailData.paymentType.name }}
</div>
<div *ngIf="transactionData.paymentDetailData.accountNumber" fxFlex="50%" class="mat-body-strong">
Account No.
</div>
<div *ngIf="transactionData.paymentDetailData.accountNumber" fxFlex="50%">
{{ transactionData.paymentDetailData.accountNumber }}
</div>
<div *ngIf="transactionData.paymentDetailData.checkNumber" fxFlex="50%" class="mat-body-strong">
Cheque Number
</div>
<div *ngIf="transactionData.paymentDetailData.checkNumber" fxFlex="50%">
{{ transactionData.paymentDetailData.checkNumber }}
</div>
<div *ngIf="transactionData.paymentDetailData.routingCode" fxFlex="50%" class="mat-body-strong">
Routing Code
</div>
<div *ngIf="transactionData.paymentDetailData.routingCode" fxFlex="50%">
{{ transactionData.paymentDetailData.routingCode }}
</div>
<div *ngIf="transactionData.paymentDetailData.receiptNumber" fxFlex="50%" class="mat-body-strong">
Receipt No.
</div>
<div *ngIf="transactionData.paymentDetailData.receiptNumber" fxFlex="50%">
{{ transactionData.paymentDetailData.receiptNumber }}
</div>
<div *ngIf="transactionData.paymentDetailData.bankNumber" fxFlex="50%" class="mat-body-strong">
Bank No.
</div>
<div *ngIf="transactionData.paymentDetailData.bankNumber" fxFlex="50%">
{{ transactionData.paymentDetailData.bankNumber }}
</div>
@@ -108,6 +110,9 @@
</div>
<div fxLayout="row" fxLayoutAlign="center" fxLayoutGap="2%" fxLayout.lt-md="column">
<button type="button" mat-raised-button color="primary" [routerLink]="['../']">{{ 'Back' | translate }}</button>
</div>
</mat-card-content>
</mat-card>
@@ -1,6 +1,8 @@
@import "assets/styles/helper";
.container {
max-width: 37rem;
.content {
div {
margin: 1rem 0;
@@ -8,3 +10,26 @@
}
}
}
.transaction-buttons {
margin-top: 3%;
}
.transaction-relation {
background-color: $mid-grey;
}
.active {
background-color: $status-active;
height: 4px;
}
.linked {
background-color: $status-approved;
height: 4px;
}
.undo {
background-color: $status-active-overdue;
height: 4px;
}
@@ -28,4 +28,11 @@ export class ViewTransactionComponent {
});
}
transactionColor(): string {
if (this.transactionData.manuallyReversed) {
return 'undo';
}
return 'active';
}
}
@@ -1,7 +1,7 @@
<mifosx-approve-fixed-deposits-account *ngIf="actions['Approve']"></mifosx-approve-fixed-deposits-account>
<mifosx-reject-fixed-deposits-account *ngIf="actions['Reject']"></mifosx-reject-fixed-deposits-account>
<mifosx-activate-fixed-deposits-account *ngIf="actions['Activate']"></mifosx-activate-fixed-deposits-account>
<mifosx-undo-approval-fixed-deposits-account *ngIf="actions['Undo Approval']"></mifosx-undo-approval-fixed-deposits-account>
<mifosx-undo-approval-fixed-deposits-account *ngIf="actions['Undo Approval'] || actions['Undo Activation']"></mifosx-undo-approval-fixed-deposits-account>
<mifosx-withdraw-by-client-fixed-deposits-account *ngIf="actions['Withdraw By Client']"></mifosx-withdraw-by-client-fixed-deposits-account>
<mifosx-add-charge-fixed-deposits-account *ngIf="actions['Add Charge']"></mifosx-add-charge-fixed-deposits-account>
<mifosx-premature-close-fixed-deposits-account *ngIf="actions['Premature Close']"></mifosx-premature-close-fixed-deposits-account>
@@ -19,6 +19,7 @@ export class FixedDepositsAccountActionsComponent {
'Activate': boolean
'Close': boolean
'Undo Approval': boolean
'Undo Activation': boolean
'Add Charge': boolean
'Premature Close': boolean
'Withdraw By Client': boolean
@@ -28,6 +29,7 @@ export class FixedDepositsAccountActionsComponent {
'Activate': false,
'Close': false,
'Undo Approval': false,
'Undo Activation': false,
'Add Charge': false,
'Premature Close': false,
'Withdraw By Client': false
@@ -5,6 +5,7 @@ import { ActivatedRoute, Router } from '@angular/router';
/** Custom Services */
import { SavingsService } from 'app/savings/savings.service';
import { FixedDepositsService } from '../../fixed-deposits.service';
/**
* Undo Approval Fixed Deposits Account Component
@@ -20,6 +21,9 @@ export class UndoApprovalFixedDepositsAccountComponent implements OnInit {
undoApprovalFixedDepositsAccountForm: UntypedFormGroup;
/** Fixed Deposits Account Id */
accountId: any;
/** Action to be Undo */
undoAction: string;
undoCommand: string;
/**
* Fixed deposits endpoint is not supported so using Savings endpoint.
@@ -30,8 +34,14 @@ export class UndoApprovalFixedDepositsAccountComponent implements OnInit {
*/
constructor(private formBuilder: UntypedFormBuilder,
private savingsService: SavingsService,
private fixedDepositsService: FixedDepositsService,
private route: ActivatedRoute,
private router: Router) {
this.undoCommand = 'undoapproval'; // Default command
this.undoAction = this.route.snapshot.params['name'];
if (this.undoAction === 'Undo Activation') {
this.undoCommand = 'undoactivate';
}
this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId'];
}
@@ -59,9 +69,15 @@ export class UndoApprovalFixedDepositsAccountComponent implements OnInit {
const data = {
...this.undoApprovalFixedDepositsAccountForm.value,
};
this.savingsService.executeSavingsAccountCommand(this.accountId, 'undoapproval', data).subscribe(() => {
this.router.navigate(['../../'], { relativeTo: this.route });
});
if (this.undoAction === 'Undo Activation') {
this.fixedDepositsService.executeFixedDepositsAccountCommand(this.accountId, this.undoCommand, data).subscribe(() => {
this.router.navigate(['../../'], { relativeTo: this.route });
});
} else {
this.savingsService.executeSavingsAccountCommand(this.accountId, this.undoCommand, data).subscribe(() => {
this.router.navigate(['../../'], { relativeTo: this.route });
});
}
}
}
@@ -54,6 +54,11 @@ const routes: Routes = [
savingsDatatables: SavingsDatatablesResolver
},
children: [
{
path: '',
redirectTo: 'transactions',
pathMatch: 'full'
},
{
path: 'interest-rate-chart',
component: InterestRateChartTabComponent,
@@ -23,7 +23,7 @@
<div fxFlexFill>
<span fxFlex="40%">Primary Grouping by Amount:</span>
<span
fxFlex="60%">{{ recurringDepositsAccountProductTemplate?.accountChart.isPrimaryGroupingByAmount ? 'Yes' : 'No' }}</span>
fxFlex="60%">{{ recurringDepositsAccountProductTemplate?.accountChart.isPrimaryGroupingByAmount | yesNo }}</span>
</div>
<table class="mat-elevation-z1" mat-table [dataSource]="interestRateChartData" #chartsTable multiTemplateDataRows>
@@ -90,7 +90,7 @@
<div fxFlexFill>
<span fxFlex="40%">Deposit Frequency Same as Group/Center meeting:</span>
<span fxFlex="60%">{{ recurringDepositsAccountProductTemplate.isCalendarInherited === true ? 'Yes' : 'No' }}</span>
<span fxFlex="60%">{{ recurringDepositsAccountProductTemplate.isCalendarInherited === true | yesNo }}</span>
</div>
<ng-container *ngIf="!recurringDepositsAccountProductTemplate.isCalendarInherited">
@@ -155,7 +155,7 @@
<div fxFlexFill>
<span fxFlex="40%">Primary Grouping by Amount:</span>
<span
fxFlex="60%">{{ recurringDepositsAccountProductTemplate?.accountChart.isPrimaryGroupingByAmount ? 'Yes' : 'No' }}</span>
fxFlex="60%">{{ recurringDepositsAccountProductTemplate?.accountChart.isPrimaryGroupingByAmount | yesNo }}</span>
</div>
<table class="mat-elevation-z1 irc-table" mat-table [dataSource]="interestRateChartData" multiTemplateDataRows>
@@ -1,4 +1,4 @@
<mat-card class="recurringDeposits-account-card">
<mat-card class="recurring-deposits-account-card">
<mat-card-header fxLayout="column" class="header">
@@ -13,11 +13,19 @@
<div class="mat-typography account-card-title">
<mat-card-title>
<h3>
<h3 fxFlex="95%">
<i class="fa fa-stop" [ngClass]="recurringDepositsAccountData.status.code | statusLookup"
[matTooltip]="recurringDepositsAccountData.status.value"></i>
Account Name : {{recurringDepositsAccountData.depositProductName}}
</h3>
<div fxFlex="5%">
<button mat-icon-button [matMenuTriggerFor]="accountMenu" aria-label="Loan account actions"
yPosition="below">
<mat-icon matListIcon class="actions-menu">
<fa-icon icon="bars" size="sm"></fa-icon>
</mat-icon>
</button>
</div>
</mat-card-title>
<mat-card-subtitle>
<p>
@@ -26,39 +34,38 @@
<span
*ngIf="!recurringDepositsAccountData.status.rejected && !recurringDepositsAccountData.status.submittedAndPendingApproval">
Current Balance:
{{recurringDepositsAccountData.currency.displaySymbol}}&nbsp;{{recurringDepositsAccountData.summary.accountBalance}}<br />
{{recurringDepositsAccountData.summary.accountBalance | currency:currencyCode:'symbol-narrow':'1.2-2'}}<br />
Available Balance:
{{recurringDepositsAccountData.currency.displaySymbol}}&nbsp;{{recurringDepositsAccountData.summary.availableBalance}}<br />
{{recurringDepositsAccountData.summary.availableBalance | currency:currencyCode:'symbol-narrow':'1.2-2'}}<br />
</span>
</p>
</mat-card-subtitle>
</div>
<mat-menu #accountMenu="matMenu">
<ng-container *ngFor="let button of buttonConfig.singleButtons">
<button mat-raised-button (click)="doAction(button.name)">
<i ngClass="{{button.icon}}"></i> {{button.name}}</button>
</ng-container>
<ng-container *ngIf="buttonConfig.options.length">
<button mat-raised-button [matMenuTriggerFor]="More">More</button>
<mat-menu #More="matMenu">
<span *ngFor="let option of buttonConfig.options">
<button mat-menu-item (click)="doAction(option.name)">{{option.name}}</button>
</span>
</mat-menu>
</ng-container>
</mat-menu>
</mat-card-title-group>
<mat-card-actions class="account-actions">
<ng-container *ngFor="let button of buttonConfig.singleButtons">
<button mat-raised-button (click)="doAction(button.name)">
<i class="{{button.icon}}"></i> {{button.name}}</button>
</ng-container>
<ng-container *ngIf="buttonConfig.options.length">
<button mat-raised-button [matMenuTriggerFor]="More">More</button>
<mat-menu #More="matMenu">
<span *ngFor="let option of buttonConfig.options">
<button mat-menu-item (click)="doAction(option.name)">{{option.name}}</button>
</span>
</mat-menu>
</ng-container>
</mat-card-actions>
</mat-card-header>
<mat-card-content class="content">
<div class="recurringDeposits-account-tables" fxLayout="row" fxLayoutGap="2%">
<div class="recurring-deposits-account-tables" fxLayout="row" fxLayoutGap="2%">
<div fxFlex="49%"
*ngIf="!recurringDepositsAccountData.status.rejected && !recurringDepositsAccountData.status.submittedAndPendingApproval">
@@ -98,7 +105,7 @@
</tr>
<tr *ngIf="recurringDepositsAccountData.minBalanceForInterestCalculation">
<td> Balance Required For Interest Calculation</td>
<td><span>{{recurringDepositsAccountData.minBalanceForInterestCalculation}}</span></td>
<td><span>{{recurringDepositsAccountData.minBalanceForInterestCalculation | number }}</span></td>
</tr>
<tr *ngIf="recurringDepositsAccountData.witdHoldTax">
<td> Witdhold Tax Group </td>
@@ -116,41 +123,41 @@
<tr>
<td>Principal Amount</td>
<td>
<span>{{recurringDepositsAccountData.currency.displaySymbol}}&nbsp;{{recurringDepositsAccountData.depositAmount}}</span>
<span>{{recurringDepositsAccountData.depositAmount | currency:currencyCode:'symbol-narrow':'1.2-2'}}}</span>
</td>
</tr>
<tr>
<td>Maturity Amount</td>
<td>
<span>{{recurringDepositsAccountData.currency.displaySymbol}}&nbsp;{{recurringDepositsAccountData.maturityAmount | formatNumber}}</span>
<span>{{recurringDepositsAccountData.maturityAmount | currency:currencyCode:'symbol-narrow':'1.2-2'}}}</span>
</td>
</tr>
<tr>
<td>Recurring Deposit Amount</td>
<td>
<span>{{recurringDepositsAccountData.currency.displaySymbol}}&nbsp;{{recurringDepositsAccountData?.mandatoryRecommendedDepositAmount | formatNumber}}</span>
<span>{{recurringDepositsAccountData?.mandatoryRecommendedDepositAmount | currency:currencyCode:'symbol-narrow':'1.2-2'}}</span>
</td>
</tr>
<tr>
<td>Deposits till Date</td>
<td><span
*ngIf="recurringDepositsAccountData.summary.totalDeposits">{{recurringDepositsAccountData.currency.displaySymbol}}&nbsp;{{recurringDepositsAccountData.summary.totalDeposits | formatNumber}}</span>
*ngIf="recurringDepositsAccountData.summary.totalDeposits">{{recurringDepositsAccountData.summary.totalDeposits | currency:currencyCode:'symbol-narrow':'1.2-2'}}</span>
<span
*ngIf="!recurringDepositsAccountData.summary.totalDeposits">{{recurringDepositsAccountData.currency.displaySymbol}}&nbsp;0</span>
*ngIf="!recurringDepositsAccountData.summary.totalDeposits">{{ 0 | currency:currencyCode:'symbol-narrow':'1.2-2'}}</span>
</td>
</tr>
<tr>
<td>Withdrwals till Date</td>
<td><span
*ngIf="recurringDepositsAccountData.summary.totalWithdrawals">{{recurringDepositsAccountData.currency.displaySymbol}}&nbsp;{{recurringDepositsAccountData.summary.totalWithdrawals | formatNumber}}</span>
*ngIf="recurringDepositsAccountData.summary.totalWithdrawals">{{recurringDepositsAccountData.summary.totalWithdrawals | currency:currencyCode:'symbol-narrow':'1.2-2'}}</span>
<span
*ngIf="!recurringDepositsAccountData.summary.totalWithdrawals">{{recurringDepositsAccountData.currency.displaySymbol}}&nbsp;0</span>
*ngIf="!recurringDepositsAccountData.summary.totalWithdrawals">{{ 0 | currency:currencyCode:'symbol-narrow':'1.2-2'}}</span>
</td>
</tr>
<tr *ngIf="recurringDepositsAccountData.summary.totalInterestEarned >= 0">
<td >Interest Earned</td>
<td><span>{{recurringDepositsAccountData.currency.displaySymbol}}&nbsp;{{recurringDepositsAccountData.summary.totalInterestEarned| formatNumber}}</span>
<td><span>{{recurringDepositsAccountData.summary.totalInterestEarned | currency:currencyCode:'symbol-narrow':'1.2-2'}}</span>
</td>
</tr>
@@ -186,33 +193,34 @@
<tr>
<td>Total Deposits </td>
<td>
<span *ngIf="recurringDepositsAccountData.summary.totalDeposits">{{ recurringDepositsAccountData.currency.displaySymbol }}&nbsp;{{ recurringDepositsAccountData.summary.totalDeposits }}</span>
<span *ngIf="!recurringDepositsAccountData.summary.totalDeposits">{{recurringDepositsAccountData.currency.displaySymbol}}&nbsp;0</span>
<span *ngIf="recurringDepositsAccountData.summary.totalDeposits">{{ recurringDepositsAccountData.summary.totalDeposits | currency:currencyCode:'symbol-narrow':'1.2-2'}}</span>
<span *ngIf="!recurringDepositsAccountData.summary.totalDeposits">{{ 0 | currency:currencyCode:'symbol-narrow':'1.2-2'}}</span>
</td>
</tr>
<tr >
<td> Actual Available Balance</td>
<td>{{ recurringDepositsAccountData.currency.displaySymbol }}&nbsp;{{ recurringDepositsAccountData.summary.accountBalance }}
<td>{{ recurringDepositsAccountData.summary.accountBalance | currency:currencyCode:'symbol-narrow':'1.2-2'}}</td>
</tr>
<tr>
<td> Recurring Deposits Amount</td>
<td>
{{ recurringDepositsAccountData.currency.displaySymbol }}&nbsp;{{ recurringDepositsAccountData.mandatoryRecommendedDepositAmount }}
{{ recurringDepositsAccountData.mandatoryRecommendedDepositAmount | currency:currencyCode:'symbol-narrow':'1.2-2'}}
</td>
</tr>
<tr *ngIf="recurringDepositsAccountData.summary.totalInterestEarned">
<td> Interests Earned </td>
<td><span>{{ recurringDepositsAccountData.currency.displaySymbol }}&nbsp;{{ recurringDepositsAccountData.summary.totalInterestEarned }}</span></td>
<td><span>{{ recurringDepositsAccountData.summary.totalInterestEarned | currency:currencyCode:'symbol-narrow':'1.2-2'}}</span></td>
</tr>
<tr *ngIf="recurringDepositsAccountData.summary.totalWithdrawals">
<td> Total Withdrawls </td>
<td>
<span>{{ recurringDepositsAccountData.currency.displaySymbol }}&nbsp;{{ recurringDepositsAccountData.summary.totalWithdrawals }}</span>
<span>{{ recurringDepositsAccountData.summary.totalWithdrawals | currency:currencyCode:'symbol-narrow':'1.2-2'}}</span>
</td>
</tr>
<tr *ngIf="recurringDepositsAccountData.minBalanceForInterestCalculation">
<td> Balance Required For Interest Calculation </td>
<td>
<span>{{ recurringDepositsAccountData.minBalanceForInterestCalculation }}</span>
<span>{{ recurringDepositsAccountData.minBalanceForInterestCalculation | number }}</span>
</td>
</tr>
</tbody>
@@ -226,9 +234,9 @@
<tr>
<td>Principal Amount</td>
<td><span
*ngIf="recurringDepositsAccountData.depositAmount">{{ recurringDepositsAccountData.currency.displaySymbol }}&nbsp;{{ recurringDepositsAccountData.depositAmount }}</span>
*ngIf="recurringDepositsAccountData.depositAmount">{{ recurringDepositsAccountData.depositAmount | currency:currencyCode:'symbol-narrow':'1.2-2'}}</span>
<span
*ngIf="!recurringDepositsAccountData.depositAmount">{{ recurringDepositsAccountData.currency.displaySymbol }}&nbsp;0</span>
*ngIf="!recurringDepositsAccountData.depositAmount">{{ 0 | currency:currencyCode:'symbol-narrow':'1.2-2'}}</span>
</td>
</tr>
<tr>
@@ -240,35 +248,37 @@
<tr *ngIf="recurringDepositsAccountData.maturityDate">
<td>Maturity Amount</td>
<td>
<span>{{ recurringDepositsAccountData.currency.displaySymbol }}&nbsp;{{ recurringDepositsAccountData.maturityAmount }}</span>
<span>{{ recurringDepositsAccountData.maturityAmount | currency:currencyCode:'symbol-narrow':'1.2-2'}}</span>
</td>
</tr>
<tr>
<td>Total Withdrawls </td>
<td>
<span
*ngIf="recurringDepositsAccountData.summary.totalWithdrawals">{{ recurringDepositsAccountData.currency.displaySymbol }}&nbsp;{{ recurringDepositsAccountData.summary.totalWithdrawals }}</span>
*ngIf="recurringDepositsAccountData.summary.totalWithdrawals">{{ recurringDepositsAccountData.summary.totalWithdrawals | currency:currencyCode:'symbol-narrow':'1.2-2'}}</span>
<span
*ngIf="!recurringDepositsAccountData.summary.totalWithdrawals">{{recurringDepositsAccountData.currency.displaySymbol}}&nbsp;0</span>
*ngIf="!recurringDepositsAccountData.summary.totalWithdrawals">{{ 0 | currency:currencyCode:'symbol-narrow':'1.2-2'}}</span>
</td>
</tr>
<tr *ngIf="recurringDepositsAccountData.timeline.closedOnDate">
<td> Closed on Date </td>
<td>
{{ recurringDepositsAccountData.timeline.closedOnDate | dateFormat }}
</td>
</tr>
<tr>
<td> Deposits Frequency </td>
<td>
{{ recurringDepositsAccountData.recurringFrequency }}&nbsp;{{ recurringDepositsAccountData.recurringFrequencyType.value }}
</td>
</tr>
<tr *ngIf="recurringDepositsAccountData.summary.totalInterestEarned">
<td> Interests Posted </td>
<td>
<span
*ngIf="recurringDepositsAccountData.summary.totalInterestPosted">{{recurringDepositsAccountData.currency.displaySymbol}}&nbsp;{{recurringDepositsAccountData.summary.totalInterestPosted}}</span>
*ngIf="recurringDepositsAccountData.summary.totalInterestPosted">{{recurringDepositsAccountData.summary.totalInterestPosted | currency:currencyCode:'symbol-narrow':'1.2-2'}}</span>
<span
*ngIf="!recurringDepositsAccountData.summary.totalInterestPosted">{{recurringDepositsAccountData.currency.displaySymbol}}&nbsp;0</span>
*ngIf="!recurringDepositsAccountData.summary.totalInterestPosted">{{ 0 | currency:currencyCode:'symbol-narrow':'1.2-2'}}</span>
</td>
</tr>
</tbody>
@@ -276,7 +286,7 @@
</div>
</div>
<div class="recurringDeposits-account-tables" fxLayout="row" fxLayoutGap="2%">
<div class="recurring-deposits-account-tables" fxLayout="row" fxLayoutGap="2%">
<div fxFlex="49%"
*ngIf="!recurringDepositsAccountData.status.rejected && !recurringDepositsAccountData.status.submittedAndPendingApproval">
<h4 class="table-headers">Interest Details</h4>
@@ -1,4 +1,4 @@
.recurringDeposits-account-card {
.recurring-deposits-account-card {
margin: 0 auto;
max-width: 80rem;
width: 90%;
@@ -45,7 +45,7 @@
td {
padding: 3px;
}
}
}
}
i, img:hover {
cursor: pointer;
@@ -35,6 +35,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
savingsDatatables: any;
/** Is Prematured Allowed */
isprematureAllowed: any;
currencyCode: string;
/**
* Fetches recurringDeposits account data from `resolve`
* @param {ActivatedRoute} route Activated Route
@@ -50,6 +51,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
this.recurringDepositsAccountData = data.recurringDepositsAccountData;
this.charges = this.recurringDepositsAccountData.charges;
this.savingsDatatables = data.savingsDatatables;
this.currencyCode = this.recurringDepositsAccountData.currency.code;
this.isprematureAllowed = data.recurringDepositsAccountData.maturityDate != null;
});
}