Skip to content

Commit f643b15

Browse files
Jose Alberto Hernandezadamsaghy
Jose Alberto Hernandez
authored andcommitted
Fix search entities view for savings and deposits accounts
1 parent 5d0e063 commit f643b15

File tree

11 files changed

+45
-14
lines changed

11 files changed

+45
-14
lines changed

src/app/clients/clients-routing.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ const routes: Routes = [
251251
loadChildren: () => import('../savings/savings.module').then(m => m.SavingsModule)
252252
},
253253
{
254-
path: 'recurringdeposits',
254+
path: 'recurring-deposits-accounts',
255255
loadChildren: () => import('../deposits/recurring-deposits/recurring-deposits.module').then(m => m.RecurringDepositsModule)
256256
},
257257
{

src/app/clients/clients-view/clients-view.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ <h3 fxFlex="95%">
115115
<button mat-menu-item *mifosxHasPermission="'CREATE_SHAREACCOUNT'"
116116
[routerLink]="['shares-accounts', 'create']">{{"labels.buttons.New Share Account" | translate}}</button>
117117
<button mat-menu-item *mifosxHasPermission="'CREATE_RECURRINGDEPOSITACCOUNT'"
118-
[routerLink]="['recurringdeposits', 'create-recurring-deposits-account']">{{"labels.buttons.New Recurring Deposit Account" | translate}}</button>
118+
[routerLink]="['recurring-deposits-accounts', 'create-recurring-deposits-account']">{{"labels.buttons.New Recurring Deposit Account" | translate}}</button>
119119
<button mat-menu-item *mifosxHasPermission="'CREATE_FIXEDDEPOSITACCOUNT'"
120120
[routerLink]="['fixed-deposits-accounts', 'create']">{{"labels.buttons.New Fixed Deposits Account" | translate}}</button>
121121
</mat-menu>

src/app/clients/clients-view/general-tab/general-tab.component.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -476,20 +476,20 @@ <h3>{{"labels.heading.Recurring Deposit Accounts" | translate}}</h3>
476476
<td mat-cell class="center" *matCellDef="let element">
477477
<ng-container *ngIf="element.status.submittedAndPendingApproval">
478478
<button class="account-action-button" mat-raised-button *mifosxHasPermission="'APPROVE_SAVINGSACCOUNT'"
479-
[routerLink]="['../','recurringdeposits', element.id, 'actions', 'Approve']" color="primary">
479+
[routerLink]="['../','recurring-deposits-accounts', element.id, 'actions', 'Approve']" color="primary">
480480
<i class="fa fa-check"></i>
481481
</button>
482482
</ng-container>
483483
<ng-container *ngIf="!element.status.submittedAndPendingApproval && !element.status.active">
484484
<button
485485
class="account-action-button" mat-raised-button color="primary" (click)="routeEdit($event)"
486486
*mifosxHasPermission="'APPROVALUNDO_SAVINGSACCOUNT'"
487-
[routerLink]="['../','recurringdeposits', element.id, 'actions', 'Undo Approval']">
487+
[routerLink]="['../','recurring-deposits-accounts', element.id, 'actions', 'Undo Approval']">
488488
<i class="fa fa-undo"></i>
489489
</button>
490490
<button class="account-action-button" mat-raised-button color="primary" (click)="routeEdit($event)"
491491
*mifosxHasPermission="'ACTIVATE_SAVINGSACCOUNT'"
492-
[routerLink]="['../','recurringdeposits', element.id, 'actions', 'Activate']">
492+
[routerLink]="['../','recurring-deposits-accounts', element.id, 'actions', 'Activate']">
493493
<i class="fa fa-check-circle"></i>
494494
</button>
495495
</ng-container>
@@ -498,7 +498,7 @@ <h3>{{"labels.heading.Recurring Deposit Accounts" | translate}}</h3>
498498

499499
<tr mat-header-row *matHeaderRowDef="openSavingsColumns"></tr>
500500
<tr mat-row *matRowDef="let row; columns: openSavingsColumns;"
501-
[routerLink]="['../', 'recurringdeposits', row.id, 'general']" class="select-row"></tr>
501+
[routerLink]="['../', 'recurring-deposits-accounts', row.id, 'general']" class="select-row"></tr>
502502

503503
</table>
504504

@@ -525,7 +525,7 @@ <h3>{{"labels.heading.Recurring Deposit Accounts" | translate}}</h3>
525525

526526
<tr mat-header-row *matHeaderRowDef="closedSavingsColumns"></tr>
527527
<tr mat-row *matRowDef="let row; columns: closedSavingsColumns;"
528-
[routerLink]="['../', 'recurringdeposits', row.id, 'general']" class="select-row"></tr>
528+
[routerLink]="['../', 'recurring-deposits-accounts', row.id, 'general']" class="select-row"></tr>
529529
</table>
530530

531531
<!-- Shares overview Table -->

src/app/deposits/recurring-deposits/recurring-deposits-account-view/charges-tab/charges-tab.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export class ChargesTabComponent implements OnInit {
211211
private reload() {
212212
const clientId = this.recurringDepositsAccountData.clientId;
213213
const url: string = this.router.url;
214-
this.router.navigateByUrl(`/clients/${clientId}/recurringdeposits`, { skipLocationChange: true })
214+
this.router.navigateByUrl(`/clients/${clientId}/recurring-deposits-accounts`, { skipLocationChange: true })
215215
.then(() => this.router.navigate([url]));
216216
}
217217

src/app/deposits/recurring-deposits/recurring-deposits-account-view/general-tab/general-tab.component.html

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ <h4 class="table-headers">{{"labels.inputs.Account Details" | translate }}</h4>
3737
<tr>
3838
</tr>
3939
<tr>
40+
<td>{{"labels.inputs.Deposit Frequency" | translate }}</td>
4041
<td><span>{{recurringDepositsAccountData.recurringFrequency}}
4142
&nbsp;{{recurringDepositsAccountData.recurringFrequencyType.value}}
4243
</span></td>

src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
148148
reload() {
149149
const clientId = this.recurringDepositsAccountData.clientId;
150150
const url: string = this.router.url;
151-
this.router.navigateByUrl(`/clients/${clientId}/recurringdeposits`, { skipLocationChange: true })
151+
this.router.navigateByUrl(`/clients/${clientId}/recurring-deposits-accounts`, { skipLocationChange: true })
152152
.then(() => this.router.navigate([url]));
153153
}
154154

src/app/notifications/notifications-page/notifications-page.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class NotificationsPageComponent implements OnInit {
3333
'center' : '/centers/',
3434
'shareAccount' : '/shares-accounts/',
3535
'fixedDeposit' : '/fixed-deposits-accounts/',
36-
'recurringDepositAccount': '/recurringdeposits/',
36+
'recurringDepositAccount': '/recurring-deposits-accounts/',
3737
'savingsAccount' : '/savings-accounts/',
3838
'shareProduct': '/products/share-products/',
3939
'loanProduct' : '/products/loan-products/'

src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts

+3
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ export class LoanProductSettingsStepComponent implements OnInit {
112112
'enableDownPayment': this.loanProductsTemplate.enableDownPayment,
113113
'enableInstallmentLevelDelinquency': this.loanProductsTemplate.enableInstallmentLevelDelinquency,
114114
'loanScheduleType': this.loanProductsTemplate.loanScheduleType.code,
115+
'useDueForRepaymentsConfigurations': this.loanProductsTemplate.useDueForRepaymentsConfigurations,
116+
'allowAccrualPostingInArrears': this.loanProductsTemplate.allowAccrualPostingInArrears
115117
});
116118

117119
this.isAdvancedTransactionProcessingStrategy = LoanProducts.isAdvancedPaymentAllocationStrategy(transactionProcessingStrategyCode);
@@ -243,6 +245,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
243245
'dueDaysForRepaymentEvent': [''],
244246
'overDueDaysForRepaymentEvent': [''],
245247
'loanScheduleType': [LoanProducts.LOAN_SCHEDULE_TYPE_CUMULATIVE, Validators.required],
248+
'allowAccrualPostingInArrears': [false]
246249
});
247250
}
248251

src/app/search/search-page/search-page.component.ts

+11-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Component, ViewChild } from '@angular/core';
33
import { MatPaginator } from '@angular/material/paginator';
44
import { MatTableDataSource } from '@angular/material/table';
55
import { Router, ActivatedRoute } from '@angular/router';
6+
import { SearchData } from '../search.model';
67

78
/**
89
* Search Page Component
@@ -16,7 +17,7 @@ export class SearchPageComponent {
1617
/** Flags if number of search results exceed 200 */
1718
overload: boolean;
1819
/** Datasource for loans disbursal table */
19-
dataSource: MatTableDataSource<any>;
20+
dataSource: MatTableDataSource<SearchData>;
2021
/** Displayed Columns for serach results */
2122
displayedColumns: string[] = ['entityType', 'entityName', 'entityAccount', 'externalId', 'parentType', 'parentName', 'details'];
2223
/** Paginator for the table */
@@ -31,6 +32,7 @@ export class SearchPageComponent {
3132
constructor(private route: ActivatedRoute,
3233
private router: Router) {
3334
this.route.data.subscribe(( data: { searchResults: any }) => {
35+
console.log(data.searchResults);
3436
this.dataSource = new MatTableDataSource(data.searchResults);
3537
this.dataSource.paginator = this.paginator;
3638
this.hasResults = (data.searchResults.length > 0);
@@ -45,7 +47,7 @@ export class SearchPageComponent {
4547
* Returns link to entity view page.
4648
* @param {any} entity Entity
4749
*/
48-
navigate(entity: any) {
50+
navigate(entity: SearchData) {
4951
switch (entity.entityType) {
5052
case 'CLIENT':
5153
this.router.navigate(['clients', entity.entityId, 'general']);
@@ -60,7 +62,13 @@ export class SearchPageComponent {
6062
this.router.navigate(['clients', entity.parentId, 'shares-accounts', entity.entityId]);
6163
break;
6264
case 'SAVING':
63-
this.router.navigate(['clients', entity.parentId, 'savings-accounts', entity.entityId, 'transactions']);
65+
if (entity.subEntityType === 'depositAccountType.recurringDeposit') {
66+
this.router.navigate(['clients', entity.parentId, 'recurring-deposits-accounts', entity.entityId, 'transactions']);
67+
} else if (entity.subEntityType === 'depositAccountType.fixedDeposit') {
68+
this.router.navigate(['clients', entity.parentId, 'fixed-deposits-accounts', entity.entityId, 'transactions']);
69+
} else if (entity.subEntityType === 'depositAccountType.savingsDeposit') {
70+
this.router.navigate(['clients', entity.parentId, 'savings-accounts', entity.entityId, 'transactions']);
71+
}
6472
break;
6573
case 'LOAN':
6674
this.router.navigate(['clients', entity.parentId, 'loans-accounts', entity.entityId, 'general']);

src/app/search/search.model.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export interface SearchData {
2+
entityId: number;
3+
entityAccountNo: string;
4+
entityExternalId: string;
5+
entityName: string;
6+
entityType: string;
7+
parentId: number;
8+
parentName: string;
9+
entityStatus: EntityStatus;
10+
parentType: string;
11+
subEntityType: string;
12+
}
13+
14+
export interface EntityStatus {
15+
id: number;
16+
code: string;
17+
value: string;
18+
}
19+

src/app/shared/notifications-tray/notifications-tray.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class NotificationsTrayComponent implements OnInit, OnDestroy {
4040
'center' : '/centers/',
4141
'shareAccount' : '/shares-accounts/',
4242
'fixedDeposit' : '/fixed-deposits-accounts/',
43-
'recurringDepositAccount': '/recurringdeposits/',
43+
'recurringDepositAccount': '/recurring-deposits-accounts/',
4444
'savingsAccount' : '/savings-accounts/',
4545
'shareProduct': '/products/share-products/',
4646
'loanProduct' : '/products/loan-products/'

0 commit comments

Comments
 (0)