Enhancement in loan and savings account views (#1690)

Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
José Alberto Hernández
2023-02-22 23:15:51 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent c0185627f7
commit 6ef53c6462
91 changed files with 841 additions and 568 deletions
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
}) })
export class ClientFamilyMemberDialogComponent implements OnInit { export class ClientFamilyMemberDialogComponent implements OnInit {
/** Maximum Due Date allowed. */ /** Maximum Due Date allowed. */
maxDate = new Date(); maxDate = new Date();
@@ -34,7 +34,6 @@ export class ViewSignatureDialogComponent implements OnInit {
const signature = this.data.documents.find((document: any) => document.name === 'clientSignature') || {}; const signature = this.data.documents.find((document: any) => document.name === 'clientSignature') || {};
this.signatureId = signature.id; this.signatureId = signature.id;
this.clientId = this.data.id; this.clientId = this.data.id;
console.log(this.clientId);
} }
ngOnInit() { ngOnInit() {
@@ -18,7 +18,6 @@ import { Dates } from 'app/core/utils/dates';
}) })
export class AddFamilyMemberComponent implements OnInit { export class AddFamilyMemberComponent implements OnInit {
/** Maximum Due Date allowed. */ /** Maximum Due Date allowed. */
maxDate = new Date(); maxDate = new Date();
/** Minimum age allowed is 0. */ /** Minimum age allowed is 0. */
@@ -23,7 +23,7 @@ export class GLIMLoanTemplateResolver implements Resolve<Object> {
* @returns {Observable<any>} * @returns {Observable<any>}
*/ */
resolve(route: ActivatedRouteSnapshot): Observable<any> { resolve(route: ActivatedRouteSnapshot): Observable<any> {
const groupId = route.parent.parent.paramMap.get('groupId'); const groupId = route.paramMap.get('groupId');
return this.loansService.getGLIMLoanAccountTemplate(groupId); return this.loansService.getGLIMLoanAccountTemplate(groupId);
} }
} }
@@ -24,7 +24,7 @@ export class LoanActionButtonResolver implements Resolve<Object> {
* @returns {Observable<any>} * @returns {Observable<any>}
*/ */
resolve(route: ActivatedRouteSnapshot): Observable<any> { resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanId = route.parent.paramMap.get('loanId'); const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId');
const loanActionButton = route.paramMap.get('action'); const loanActionButton = route.paramMap.get('action');
if (loanActionButton === 'Assign Loan Officer' || loanActionButton === 'Change Loan Officer') { if (loanActionButton === 'Assign Loan Officer' || loanActionButton === 'Change Loan Officer') {
return this.loansService.getLoanTemplate(loanId); return this.loansService.getLoanTemplate(loanId);
@@ -24,9 +24,9 @@ export class LoanDatatableResolver implements Resolve<Object> {
* @returns {Observable<any>} * @returns {Observable<any>}
*/ */
resolve(route: ActivatedRouteSnapshot): Observable<any> { resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanId = route.parent.parent.paramMap.get('loanId'); const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId');
const datatableName = route.paramMap.get('datatableName'); const datatableName = route.paramMap.get('datatableName');
return this.loansService.getLoanDatatable(loanId, datatableName); return this.loansService.getLoanDatatable(loanId, datatableName);
} }
} }
@@ -24,8 +24,8 @@ export class LoanDelinquencyTagsResolver implements Resolve<Object> {
* @returns {Observable<any>} * @returns {Observable<any>}
*/ */
resolve(route: ActivatedRouteSnapshot): Observable<any> { resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId') || route.parent.parent.paramMap.get('loanId'); const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId');
return this.loansService.getDelinquencyTags(loanId); return this.loansService.getDelinquencyTags(loanId);
} }
} }
@@ -24,7 +24,7 @@ export class LoanDetailsChargesResolver implements Resolve<Object> {
* @returns {Observable<any>} * @returns {Observable<any>}
*/ */
resolve(route: ActivatedRouteSnapshot): Observable<any> { resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanId = route.parent.parent.paramMap.get('loanId'); const loanId = route.paramMap.get('loanId');
return this.loansService.getLoanAccountAssociationDetails(loanId); return this.loansService.getLoanAccountAssociationDetails(loanId);
} }
@@ -24,8 +24,8 @@ export class LoanDetailsResolver implements Resolve<Object> {
* @returns {Observable<any>} * @returns {Observable<any>}
*/ */
resolve(route: ActivatedRouteSnapshot): Observable<any> { resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId') || route.parent.parent.paramMap.get('loanId'); const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId');
return this.loansService.getLoanAccountAssociationDetails(loanId); return this.loansService.getLoanAccountAssociationDetails(loanId);
} }
} }
@@ -24,8 +24,8 @@ export class LoanDocumentsResolver implements Resolve<Object> {
* @returns {Observable<any>} * @returns {Observable<any>}
*/ */
resolve(route: ActivatedRouteSnapshot): Observable<any> { resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanId = route.parent.paramMap.get('loanId'); const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId');
return this.loansService.getLoanDocuments(loanId); return this.loansService.getLoanDocuments(loanId);
} }
} }
@@ -24,8 +24,8 @@ export class LoanNotesResolver implements Resolve<Object> {
* @returns {Observable<any>} * @returns {Observable<any>}
*/ */
resolve(route: ActivatedRouteSnapshot): Observable<any> { resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanId = route.parent.paramMap.get('loanId'); const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId');
return this.loansService.getLoanNotes(loanId); return this.loansService.getLoanNotes(loanId);
} }
} }
@@ -22,8 +22,8 @@ export class LoanReschedulesResolver implements Resolve<boolean> {
* @returns {Observable<any>} * @returns {Observable<any>}
*/ */
resolve(route: ActivatedRouteSnapshot): Observable<any> { resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanId = route.parent.paramMap.get('loanId'); const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId');
return this.loansService.loanRescheduleRequests(loanId); return this.loansService.loanRescheduleRequests(loanId);
} }
} }
@@ -23,7 +23,7 @@ export class LoansAccountAndTemplateResolver implements Resolve<Object> {
* @returns {Observable<any>} * @returns {Observable<any>}
*/ */
resolve(route: ActivatedRouteSnapshot): Observable<any> { resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanId = route.parent.paramMap.get('loanId'); const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId');
return this.loansService.getLoansAccountAndTemplateResource(loanId); return this.loansService.getLoansAccountAndTemplateResource(loanId);
} }
} }
@@ -25,9 +25,9 @@ export class LoansAccountChargeResolver implements Resolve<Object> {
* @returns {Observable<any>} * @returns {Observable<any>}
*/ */
resolve(route: ActivatedRouteSnapshot): Observable<any> { resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanAccountId = route.parent.parent.paramMap.get('loanId'); const loanId = route.paramMap.get('loanId');
const chargeId = route.paramMap.get('id'); const chargeId = route.paramMap.get('id');
return this.loansService.getLoansAccountCharge(loanAccountId, chargeId); return this.loansService.getLoansAccountCharge(loanId, chargeId);
} }
} }
@@ -25,9 +25,9 @@ export class LoansAccountTransactionTemplateResolver implements Resolve<Object>
* @returns {Observable<any>} * @returns {Observable<any>}
*/ */
resolve(route: ActivatedRouteSnapshot): Observable<any> { resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanAccountId = route.parent.parent.parent.paramMap.get('loanId'); const loanId = route.paramMap.get('loanId');
const transactionId = route.paramMap.get('id'); const transactionId = route.paramMap.get('id');
return this.loansService.getLoansAccountTransactionTemplate(loanAccountId, transactionId); return this.loansService.getLoansAccountTransactionTemplate(loanId, transactionId);
} }
} }
@@ -25,9 +25,9 @@ export class LoansAccountTransactionResolver implements Resolve<Object> {
* @returns {Observable<any>} * @returns {Observable<any>}
*/ */
resolve(route: ActivatedRouteSnapshot): Observable<any> { resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanAccountId = route.parent.parent.parent.paramMap.get('loanId'); const loanId = route.paramMap.get('loanId');
const transactionId = route.paramMap.get('id'); const transactionId = route.paramMap.get('id');
return this.loansService.getLoansAccountTransaction(loanAccountId, transactionId); return this.loansService.getLoansAccountTransaction(loanId, transactionId);
} }
} }
@@ -48,7 +48,7 @@ export class EditLoansAccountComponent implements OnInit {
this.route.data.subscribe((data: { loansAccountAndTemplate: any }) => { this.route.data.subscribe((data: { loansAccountAndTemplate: any }) => {
this.loansAccountAndTemplate = data.loansAccountAndTemplate; this.loansAccountAndTemplate = data.loansAccountAndTemplate;
}); });
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
ngOnInit() { ngOnInit() {
+204 -196
View File
@@ -55,6 +55,7 @@ import { LoanDelinquencyTagsResolver } from './common-resolvers/loan-delinquency
import { LoanDelinquencyTagsTabComponent } from './loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component'; import { LoanDelinquencyTagsTabComponent } from './loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component';
import { LoanReschedulesResolver } from './common-resolvers/loan-reschedules.resolver'; import { LoanReschedulesResolver } from './common-resolvers/loan-reschedules.resolver';
import { RescheduleLoanTabComponent } from './loans-view/reschedule-loan-tab/reschedule-loan-tab.component'; import { RescheduleLoanTabComponent } from './loans-view/reschedule-loan-tab/reschedule-loan-tab.component';
import { AdjustLoanChargeComponent } from './loans-view/loan-account-actions/adjust-loan-charge/adjust-loan-charge.component';
/** Loans Route. */ /** Loans Route. */
const routes: Routes = [ const routes: Routes = [
@@ -73,246 +74,253 @@ const routes: Routes = [
{ {
path: ':loanId', path: ':loanId',
data: { title: extract('Loan View'), routeParamBreadcrumb: 'loanId' }, data: { title: extract('Loan View'), routeParamBreadcrumb: 'loanId' },
component: LoansViewComponent,
resolve: {
loanDetailsData: LoanDetailsResolver,
loanDatatables: LoanDatatablesResolver
},
children: [ children: [
{ {
path: '', path: '',
component: LoansViewComponent, redirectTo: 'general',
pathMatch: 'full'
},
{
path: 'general',
component: GeneralTabComponent,
data: { title: extract('General'), breadcrumb: 'General', routeParamBreadcrumb: false },
resolve: { resolve: {
loanDetailsData: LoanDetailsResolver, loanDetailsData: LoanDetailsResolver,
loanDatatables: LoanDatatablesResolver loanDatatables: LoanDatatablesResolver
}, },
children: [ },
{ {
path: '', path: 'accountdetail',
redirectTo: 'general', component: AccountDetailsComponent,
pathMatch: 'full' data: { title: extract('Account Detail'), breadcrumb: 'Account Detail', routeParamBreadcrumb: false }
}, },
{ {
path: 'general', path: 'original-schedule',
component: GeneralTabComponent, component: OriginalScheduleTabComponent,
data: { title: extract('General'), breadcrumb: 'General', routeParamBreadcrumb: false } data: { title: extract('Original Schedule'), breadcrumb: 'Original Schedule', routeParamBreadcrumb: false },
}, },
{ {
path: 'accountdetail', path: 'repayment-schedule',
component: AccountDetailsComponent, component: RepaymentScheduleTabComponent,
data: { title: extract('Account Detail'), breadcrumb: 'Account Detail', routeParamBreadcrumb: false } data: { title: extract('Repayment Schedule'), breadcrumb: 'Repayment Schedule', routeParamBreadcrumb: false },
},
{
path: 'original-schedule',
component: OriginalScheduleTabComponent,
data: { title: extract('Original Schedule'), breadcrumb: 'Original Schedule', routeParamBreadcrumb: false },
},
{
path: 'repayment-schedule',
component: RepaymentScheduleTabComponent,
data: { title: extract('Repayment Schedule'), breadcrumb: 'Repayment Schedule', routeParamBreadcrumb: false },
},
{
path: 'transactions',
data: { title: extract('Loans Account Transactions'), breadcrumb: 'Transactions', routeParamBreadcrumb: false },
children: [
{
path: '',
component: TransactionsTabComponent
},
{
path: 'export',
component: ExportTransactionsComponent
}
]
},
{
path: 'delinquencytags',
data: { title: extract('Loans Delinquency Tags'), breadcrumb: 'Delinquency Tags', routeParamBreadcrumb: false },
resolve: {
loanDelinquencyTagsData: LoanDelinquencyTagsResolver
},
children: [
{
path: '',
component: LoanDelinquencyTagsTabComponent
},
]
},
{
path: 'loan-reschedules',
data: {},
resolve: {
loanRescheduleData: LoanReschedulesResolver
},
children: [
{
path: '',
component: RescheduleLoanTabComponent
}
]
},
{
path: 'loan-collateral',
component: LoanCollateralTabComponent,
data: { title: extract('Loan Collateral Details'), breadcrumb: 'Loan Collateral Details', routeParamBreadcrumb: false },
},
{
path: 'loan-tranche-details',
component: LoanTrancheDetailsComponent,
data: { title: extract('Loan Tranche Details'), breadcrumb: 'Loan Tranche Details', routeParamBreadcrumb: false },
},
{
path: 'overdue-charges',
component: OverdueChargesTabComponent,
data: { title: extract('Overdue Charges'), breadcrumb: 'Overdue Charges', routeParamBreadcrumb: false }
},
{
path: 'floating-interest-rates',
component: FloatingInterestRatesComponent,
data: { title: extract('Floating Interest Rates'), breadcrumb: 'Floating Interest Rates', routeParamBreadcrumb: false },
},
{
path: 'charges',
data: { title: extract('Loans Account Charges'), breadcrumb: 'Charges', routeParamBreadcrumb: false },
component: ChargesTabComponent,
},
{
path: 'loan-documents',
component: LoanDocumentsTabComponent,
data: { title: extract('Loan Documents'), breadcrumb: 'Loan Documents', routeParamBreadcrumb: false },
resolve: {
loanDocuments: LoanDocumentsResolver
},
},
{
path: 'notes',
component: NotesTabComponent,
data: { title: extract('Notes'), breadcrumb: 'Notes', routeParamBreadcrumb: false },
resolve: {
loanNotes: LoanNotesResolver
},
},
{
path: 'standing-instruction',
component: StandingInstructionsTabComponent,
data: { title: extract('Standing Instructions'), breadcrumb: 'Standing Instructions', routeParamBreadcrumb: false }
},
{
path: 'datatables',
children: [{
path: ':datatableName',
component: DatatableTabComponent,
data: { title: extract('Data Table View'), routeParamBreadcrumb: 'datatableName' },
resolve: {
loanDatatable: LoanDatatableResolver
}
}]
},
],
}, },
{ {
path: 'transactions', path: 'transactions',
data: { title: extract('Loans Account Transactions'), breadcrumb: 'Transactions', routeParamBreadcrumb: false }, data: { title: extract('Loans Account Transactions'), breadcrumb: 'Transactions', routeParamBreadcrumb: false },
children: [
{
path: '',
component: TransactionsTabComponent
},
{
path: 'export',
component: ExportTransactionsComponent
}
]
},
{
path: 'delinquencytags',
data: { title: extract('Loans Delinquency Tags'), breadcrumb: 'Delinquency Tags', routeParamBreadcrumb: false },
resolve: { resolve: {
loanDetailsAssociationData: LoanDetailsResolver loanDelinquencyTagsData: LoanDelinquencyTagsResolver
}, },
children: [ children: [
{ {
path: '', path: '',
redirectTo: '../transactions', pathMatch: 'prefix' component: LoanDelinquencyTagsTabComponent
}, },
]
},
{
path: 'loan-reschedules',
data: {},
resolve: {
loanRescheduleData: LoanReschedulesResolver
},
children: [
{ {
path: ':id', path: '',
data: { routeParamBreadcrumb: 'id' }, component: RescheduleLoanTabComponent
children: [
{
path: '',
component: ViewTransactionComponent,
resolve: {
loansAccountTransaction: LoansAccountTransactionResolver
}
},
{
path: 'edit',
component: EditTransactionComponent,
data: { breadcrumb: 'Edit', routeParamBreadcrumb: false },
resolve: {
loansAccountTransactionTemplate: LoansAccountTransactionTemplateResolver
}
},
{
path: 'reciept',
component: ViewRecieptComponent,
data: { breadcrumb: 'Reciept', routeParamBreadcrumb: false },
resolve: {
loansTransactionReciept: LoansTransactionRecieptResolver
}
}
]
} }
] ]
}, },
{
path: 'loan-collateral',
component: LoanCollateralTabComponent,
data: { title: extract('Loan Collateral Details'), breadcrumb: 'Loan Collateral Details', routeParamBreadcrumb: false },
},
{
path: 'loan-tranche-details',
component: LoanTrancheDetailsComponent,
data: { title: extract('Loan Tranche Details'), breadcrumb: 'Loan Tranche Details', routeParamBreadcrumb: false },
},
{
path: 'overdue-charges',
component: OverdueChargesTabComponent,
data: { title: extract('Overdue Charges'), breadcrumb: 'Overdue Charges', routeParamBreadcrumb: false }
},
{
path: 'floating-interest-rates',
component: FloatingInterestRatesComponent,
data: { title: extract('Floating Interest Rates'), breadcrumb: 'Floating Interest Rates', routeParamBreadcrumb: false },
},
{ {
path: 'charges', path: 'charges',
data: { title: extract('Loans Account Charges'), breadcrumb: 'Charges', routeParamBreadcrumb: false }, data: { title: extract('Loans Account Charges'), breadcrumb: 'Charges', routeParamBreadcrumb: false },
children: [ component: ChargesTabComponent,
{ },
path: '', {
redirectTo: '../charges', pathMatch: 'prefix' path: 'loan-documents',
}, component: LoanDocumentsTabComponent,
{ data: { title: extract('Loan Documents'), breadcrumb: 'Loan Documents', routeParamBreadcrumb: false },
path: ':id', resolve: {
data: { routeParamBreadcrumb: 'id' }, loanDocuments: LoanDocumentsResolver
component: ViewChargeComponent, },
resolve: { },
loansAccountCharge: LoansAccountChargeResolver, {
loanDetailsData: LoanDetailsResolver path: 'notes',
} component: NotesTabComponent,
data: { title: extract('Notes'), breadcrumb: 'Notes', routeParamBreadcrumb: false },
resolve: {
loanNotes: LoanNotesResolver
},
},
{
path: 'standing-instruction',
component: StandingInstructionsTabComponent,
data: { title: extract('Standing Instructions'), breadcrumb: 'Standing Instructions', routeParamBreadcrumb: false }
},
{
path: 'datatables',
children: [{
path: ':datatableName',
component: DatatableTabComponent,
data: { title: extract('Data Table View'), routeParamBreadcrumb: 'datatableName' },
resolve: {
loanDatatable: LoanDatatableResolver
} }
] }]
}, },
],
},
{
path: ':loanId/transactions/:id',
data: { title: extract('Loans Account Transactions'), breadcrumb: 'Transactions', routeParamBreadcrumb: false },
resolve: {
loanDetailsAssociationData: LoanDetailsResolver
},
children: [
{ {
path: 'actions/:action', path: '',
component: LoanAccountActionsComponent, data: { routeParamBreadcrumb: 'id' },
data: { title: extract('Loan Account Actions'), breadcrumb: 'action', routeParamBreadcrumb: 'action' }, component: ViewTransactionComponent,
resolve: { resolve: {
actionButtonData: LoanActionButtonResolver loansAccountTransaction: LoansAccountTransactionResolver
} }
}, },
{ {
path: 'transfer-funds', path: 'edit',
loadChildren: () => import('../account-transfers/account-transfers.module').then(m => m.AccountTransfersModule) component: EditTransactionComponent,
}, data: { breadcrumb: 'Edit', routeParamBreadcrumb: false },
{
path: 'edit-loans-account',
data: { title: extract('Modify Loans Account'), breadcrumb: 'Modify Loans Account', routeParamBreadcrumb: 'Edit' },
component: EditLoansAccountComponent,
resolve: { resolve: {
loansAccountAndTemplate: LoansAccountAndTemplateResolver loansAccountTransactionTemplate: LoansAccountTransactionTemplateResolver
} }
}, },
{
path: 'reciept',
component: ViewRecieptComponent,
data: { breadcrumb: 'Reciept', routeParamBreadcrumb: false },
resolve: {
loansTransactionReciept: LoansTransactionRecieptResolver
}
}
] ]
}, },
{ {
path: 'glim-account', path: ':loanId/edit-loans-account',
data: { title: extract('Modify Loans Account'), breadcrumb: 'Modify Loans Account', routeParamBreadcrumb: 'Edit' },
component: EditLoansAccountComponent,
resolve: {
loansAccountAndTemplate: LoansAccountAndTemplateResolver
}
},
{
path: ':loanId/charges',
data: { title: extract('Loans Account Charges'), breadcrumb: 'Charges', routeParamBreadcrumb: false },
children: [ children: [
{ {
path: 'create', path: '',
data: { title: extract('Create GLIM Application'), breadcrumb: 'Create GLIM Application' }, redirectTo: '../charges', pathMatch: 'prefix'
component: CreateGlimAccountComponent,
resolve: {
loansAccountTemplate: GLIMLoanTemplateResolver,
gsimData: GSIMAccountsResolver,
groupsData: GroupViewResolver,
},
}, },
{ {
path: ':glimId', path: ':id',
data: { title: extract('GSIM Account View'), routeParamBreadcrumb: 'savingAccountId' }, data: { routeParamBreadcrumb: 'id' },
component: GlimAccountComponent, component: ViewChargeComponent,
resolve: { resolve: {
glimData: GLIMViewResolver, loansAccountCharge: LoansAccountChargeResolver,
groupsData: GroupAccountsResolver loanDetailsData: LoanDetailsResolver
}, }
},
{
path: ':id/adjustment',
data: { routeParamBreadcrumb: 'id', breadcrumb: 'Adjustment' },
component: AdjustLoanChargeComponent,
resolve: {
loansAccountCharge: LoansAccountChargeResolver,
loanDetailsData: LoanDetailsResolver
}
} }
] ]
},
{
path: ':loanId/actions/:action',
component: LoanAccountActionsComponent,
data: { title: extract('Loan Account Actions'), breadcrumb: 'action', routeParamBreadcrumb: 'action' },
resolve: {
actionButtonData: LoanActionButtonResolver
}
},
{
path: 'transfer-funds',
loadChildren: () => import('../account-transfers/account-transfers.module').then(m => m.AccountTransfersModule)
},
{
path: 'edit-loans-account',
data: { title: extract('Modify Loans Account'), breadcrumb: 'Modify Loans Account', routeParamBreadcrumb: 'Edit' },
component: EditLoansAccountComponent,
resolve: {
loansAccountAndTemplate: LoansAccountAndTemplateResolver
}
},
]
},
{
path: 'glim-account',
children: [
{
path: 'create',
data: { title: extract('Create GLIM Application'), breadcrumb: 'Create GLIM Application' },
component: CreateGlimAccountComponent,
resolve: {
loansAccountTemplate: GLIMLoanTemplateResolver,
gsimData: GSIMAccountsResolver,
groupsData: GroupViewResolver,
},
},
{
path: ':glimId',
data: { title: extract('GSIM Account View'), routeParamBreadcrumb: 'savingAccountId' },
component: GlimAccountComponent,
resolve: {
glimData: GLIMViewResolver,
groupsData: GroupAccountsResolver
},
} }
] ]
} }
@@ -1,83 +1,93 @@
<div class="tab-container"> <div class="tab-container">
<table mat-table [dataSource]="dataSource" matSort> <table mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="name"> <ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th> <th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>
<td mat-cell *matCellDef="let charge"> {{ charge.name }} </td> <td mat-cell *matCellDef="let charge"> {{ charge.name }} </td>
</ng-container> </ng-container>
<ng-container matColumnDef="feepenalty"> <ng-container matColumnDef="feepenalty">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Fee/Penalty </th> <th mat-header-cell *matHeaderCellDef mat-sort-header> Fee/Penalty </th>
<td mat-cell *matCellDef="let charge"> <td mat-cell *matCellDef="let charge">
<span *ngIf="charge.penalty">Penalty</span> <span *ngIf="charge.penalty">Penalty</span>
<span *ngIf="!charge.penalty">Fee</span> <span *ngIf="!charge.penalty">Fee</span>
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="paymentdueat"> <ng-container matColumnDef="paymentdueat">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Payment due at </th> <th mat-header-cell *matHeaderCellDef mat-sort-header> Payment due at </th>
<td mat-cell *matCellDef="let charge"> {{ charge.chargeTimeType.value }} </td> <td mat-cell *matCellDef="let charge"> {{ charge.chargeTimeType.value }} </td>
</ng-container> </ng-container>
<ng-container matColumnDef="dueDate"> <ng-container matColumnDef="dueDate">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Due as of </th> <th mat-header-cell *matHeaderCellDef mat-sort-header> Due as of </th>
<td mat-cell *matCellDef="let charge"> {{ charge.dueDate | dateFormat }} </td> <td mat-cell *matCellDef="let charge"> {{ charge.dueDate | dateFormat }} </td>
</ng-container> </ng-container>
<ng-container matColumnDef="calculationtype"> <ng-container matColumnDef="calculationtype">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Calculation Type </th> <th mat-header-cell *matHeaderCellDef mat-sort-header> Calculation Type </th>
<td mat-cell *matCellDef="let charge"> {{ charge.chargeCalculationType.value }} </td> <td mat-cell *matCellDef="let charge"> {{ charge.chargeCalculationType.value }} </td>
</ng-container> </ng-container>
<ng-container matColumnDef="due"> <ng-container matColumnDef="due">
<th mat-header-cell class="r-amount" *matHeaderCellDef mat-sort-header> Due </th> <th mat-header-cell class="r-amount" *matHeaderCellDef mat-sort-header> Due </th>
<td mat-cell class="r-amount" *matCellDef="let charge"> {{ charge.currency.displaySymbol }} {{ charge.amount| number }} </td> <td mat-cell class="r-amount" *matCellDef="let charge"> {{ charge.currency.displaySymbol }} {{ charge.amount|
</ng-container> number }} </td>
</ng-container>
<ng-container matColumnDef="paid"> <ng-container matColumnDef="paid">
<th mat-header-cell class="r-amount" *matHeaderCellDef mat-sort-header> Paid </th> <th mat-header-cell class="r-amount" *matHeaderCellDef mat-sort-header> Paid </th>
<td mat-cell class="r-amount" *matCellDef="let charge"> {{ charge.currency.displaySymbol }}{{ charge.amountPaid| number }} </td> <td mat-cell class="r-amount" *matCellDef="let charge"> {{ charge.currency.displaySymbol }}{{ charge.amountPaid|
</ng-container> number }} </td>
</ng-container>
<ng-container matColumnDef="waived"> <ng-container matColumnDef="waived">
<th mat-header-cell class="r-amount" *matHeaderCellDef mat-sort-header> Waived </th> <th mat-header-cell class="r-amount" *matHeaderCellDef mat-sort-header> Waived </th>
<td mat-cell class="r-amount" *matCellDef="let charge"> {{ charge.currency.displaySymbol }}{{ charge.amountWaived| number }} </td> <td mat-cell class="r-amount" *matCellDef="let charge"> {{ charge.currency.displaySymbol }}{{ charge.amountWaived|
</ng-container> number }} </td>
</ng-container>
<ng-container matColumnDef="outstanding"> <ng-container matColumnDef="outstanding">
<th mat-header-cell class="r-amount" *matHeaderCellDef mat-sort-header> Outstanding </th> <th mat-header-cell class="r-amount" *matHeaderCellDef mat-sort-header> Outstanding </th>
<td mat-cell class="r-amount" *matCellDef="let charge"> {{ charge.currency.displaySymbol }}{{ charge.amountOutstanding| number }} </td> <td mat-cell class="r-amount" *matCellDef="let charge"> {{ charge.currency.displaySymbol }}{{
</ng-container> charge.amountOutstanding| number }} </td>
</ng-container>
<ng-container matColumnDef="actions"> <ng-container matColumnDef="actions">
<th mat-header-cell class="center" *matHeaderCellDef mat-sort-header> Actions </th> <th mat-header-cell class="center" *matHeaderCellDef mat-sort-header> Actions </th>
<td mat-cell class="center" *matCellDef="let charge"> <td mat-cell class="center" *matCellDef="let charge">
<span *ngIf="status === 'Submitted and pending approval'"> <span *ngIf="status === 'Submitted and pending approval'">
<button class="account-action-button" mat-raised-button color="primary" matTooltip="Edit Charge" <button class="account-action-button" mat-raised-button color="primary" matTooltip="Edit Charge"
(click)="routeEdit($event); editCharge(charge)"> (click)="routeEdit($event); editCharge(charge)">
<i class="fa fa-pencil"></i> <i class="fa fa-pencil"></i>
</button> </button>
<button class="account-action-button" mat-raised-button color="warn" matTooltip="Delete Charge" <button class="account-action-button" mat-raised-button color="warn" matTooltip="Delete Charge"
(click)="routeEdit($event); deleteCharge(charge.id)"> (click)="routeEdit($event); deleteCharge(charge.id)">
<i class="fa fa-trash"></i> <i class="fa fa-trash"></i>
</button> </button>
</span> </span>
<button class="account-action-button" mat-raised-button color="primary" matTooltip="Pay Charge" *ngIf="charge.chargePayable && !charge.paid && status=='Active'" <button class="account-action-button" mat-raised-button color="accent" matTooltip="Adjust Charge"
(click)="routeEdit($event); payCharge(charge.id)"> *ngIf="!charge.paid && status=='Active'"
<i class="fa fa-dollar"></i> (click)="routeEdit($event); adjustCharge(charge.id)">
</button> <i class="fa fa-pencil"></i>
<button class="account-action-button" mat-raised-button color="primary" matTooltip="Waive Charge" *ngIf="!charge.actionFlag" </button>
(click)="routeEdit($event); waiveCharge(charge.id)"> <button class="account-action-button" mat-raised-button color="primary" matTooltip="Pay Charge"
<i class="fa fa-flag"></i> *ngIf="charge.chargePayable && !charge.paid && status=='Active'"
</button> (click)="routeEdit($event); payCharge(charge.id)">
</td> <i class="fa fa-dollar"></i>
</ng-container> </button>
<button class="account-action-button" mat-raised-button color="primary" matTooltip="Waive Charge"
*ngIf="!charge.actionFlag" (click)="routeEdit($event); waiveCharge(charge.id)">
<i class="fa fa-flag"></i>
</button>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" class="select-row" [routerLink]="[row.id]"></tr> <tr mat-row *matRowDef="let row; columns: displayedColumns;" class="select-row" [routerLink]="[row.id]"></tr>
</table> </table>
<mat-paginator [pageSizeOptions]="[10, 25, 50, 100]" showFirstLastButtons></mat-paginator> <mat-paginator [pageSizeOptions]="[10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
</div> </div>
@@ -60,7 +60,6 @@ export class ChargesTabComponent implements OnInit {
}); });
} }
ngOnInit() { ngOnInit() {
this.chargesData = this.loanDetails.charges; this.chargesData = this.loanDetails.charges;
this.status = this.loanDetails.status.value; this.status = this.loanDetails.status.value;
@@ -78,6 +77,14 @@ export class ChargesTabComponent implements OnInit {
this.dataSource.sort = this.sort; this.dataSource.sort = this.sort;
} }
/**
* Asjust the Loan charge.
* @param {any} chargeId Charge Id
*/
adjustCharge(chargeId: string) {
this.router.navigate([`${chargeId}/adjustment`], { relativeTo: this.route });
}
/** /**
* Pays the charge. * Pays the charge.
* @param {any} chargeId Charge Id * @param {any} chargeId Charge Id
@@ -58,7 +58,7 @@ export class AddCollateralComponent implements OnInit {
this.collateralForm.patchValue({ this.collateralForm.patchValue({
'collateralTypeId': collateralTypeId 'collateralTypeId': collateralTypeId
}); });
const loanId = this.route.parent.snapshot.params['loanId']; const loanId = this.route.snapshot.params['loanId'];
const collateralForm = this.collateralForm.value; const collateralForm = this.collateralForm.value;
collateralForm.locale = 'en'; collateralForm.locale = 'en';
this.loanService.createLoanCollateral(loanId, collateralForm).subscribe((response: any) => { this.loanService.createLoanCollateral(loanId, collateralForm).subscribe((response: any) => {
@@ -60,7 +60,7 @@ export class AddLoanChargeComponent implements OnInit {
this.route.data.subscribe((data: { actionButtonData: any }) => { this.route.data.subscribe((data: { actionButtonData: any }) => {
this.loanChargeOptions = data.actionButtonData.chargeOptions; this.loanChargeOptions = data.actionButtonData.chargeOptions;
}); });
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
/** /**
@@ -0,0 +1,91 @@
<div class="container mat-elevation-z8">
<mat-card>
<form [formGroup]="adjustLoanChargeForm" (ngSubmit)="submit()">
<mat-card-content>
<div fxLayout="column">
<mat-form-field appearance="fill">
<mat-label>Amount</mat-label>
<span matTextSuffix class="m-l-10">{{ loanDetailsData.currency.code }}</span>
<span fxFlex="auto"></span>
<input type="number" matInput required class="right-input" formControlName="amount">
<mat-error *ngIf="adjustLoanChargeForm.controls.amount.hasError('required')">
Amount <strong>is required</strong>
</mat-error>
</mat-form-field>
<mat-form-field>
<mat-label>External Id</mat-label>
<input matInput formControlName="externalId">
</mat-form-field>
<mat-form-field>
<mat-label>Payment Type</mat-label>
<mat-select formControlName="paymentTypeId">
<mat-option *ngFor="let paymentType of paymentTypes" [value]="paymentType.id">
{{ paymentType.name }}
</mat-option>
</mat-select>
</mat-form-field>
<div fxFlexFill>
<span fxFlex="75%" class="expandcollapsebutton m-l-10 m-t-40" (click)="addPaymentDetails()">
<mat-slide-toggle>
<div [className]="showPaymentDetails ? 'enabled' : 'disabled'">
<span class="m-l-10">Show Payment Details</span>
</div>
</mat-slide-toggle>
</span>
</div>
<ng-container *ngIf="showPaymentDetails">
<mat-form-field>
<mat-label> Account #</mat-label>
<input matInput formControlName="accountNumber">
</mat-form-field>
<mat-form-field>
<mat-label>Cheque #</mat-label>
<input matInput formControlName="checkNumber">
</mat-form-field>
<mat-form-field>
<mat-label>Routing Code</mat-label>
<input matInput formControlName="routingCode">
</mat-form-field>
<mat-form-field>
<mat-label>Reciept #</mat-label>
<input matInput formControlName="receiptNumber">
</mat-form-field>
<mat-form-field>
<mat-label>Bank #</mat-label>
<input matInput formControlName="bankNumber">
</mat-form-field>
</ng-container>
<mat-form-field>
<mat-label>Note</mat-label>
<textarea matInput formControlName="note" cdkTextareaAutosize cdkAutosizeMinRows="2"></textarea>
</mat-form-field>
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../..']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!adjustLoanChargeForm.valid"
*mifosxHasPermission="'ADJUSTMENT_LOANCHARGE'">Submit</button>
</mat-card-actions>
</mat-card-content>
</form>
</mat-card>
</div>
@@ -0,0 +1,15 @@
.expandcollapsebutton {
margin-top: -7px;
}
.container {
max-width: 37rem;
}
.right-input {
text-align: right;
}
.right-label {
padding-right: 25px !important;
}
@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AdjustLoanChargeComponent } from './adjust-loan-charge.component';
describe('AdjustLoanChargeComponent', () => {
let component: AdjustLoanChargeComponent;
let fixture: ComponentFixture<AdjustLoanChargeComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ AdjustLoanChargeComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(AdjustLoanChargeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,116 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { LoansService } from 'app/loans/loans.service';
import { OrganizationService } from 'app/organization/organization.service';
import { SettingsService } from 'app/settings/settings.service';
@Component({
selector: 'mifosx-adjust-loan-charge',
templateUrl: './adjust-loan-charge.component.html',
styleUrls: ['./adjust-loan-charge.component.scss']
})
export class AdjustLoanChargeComponent implements OnInit {
/** Loan Id */
loanId: string;
chargeId: string;
/** Payment Type Options */
paymentTypes: any = [];
chargeData: any = [];
loanDetailsData: any = [];
/** Show payment details */
showPaymentDetails = false;
/** Minimum Date allowed. */
minDate = new Date(2000, 0, 1);
/** Maximum Date allowed. */
maxDate = new Date();
/** Repayment Loan Form */
adjustLoanChargeForm: FormGroup;
/**
* @param {FormBuilder} formBuilder Form Builder.
* @param {LoansService} loanService Loan Service.
* @param {ActivatedRoute} route Activated Route.
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: FormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService,
private organizationService: OrganizationService) {
this.loanId = this.route.snapshot.params['loanId'];
this.chargeId = this.route.snapshot.params['id'];
this.route.data.subscribe((data: { loansAccountCharge: any, loanDetailsData: any }) => {
this.chargeData = data.loansAccountCharge;
this.loanDetailsData = data.loanDetailsData;
});
}
/**
* Creates the repayment loan form
* and initialize with the required values
*/
ngOnInit() {
this.maxDate = this.settingsService.maxAllowedDate;
this.createAdjustLoanChargeForm();
this.setRepaymentLoanDetails();
}
/**
* Creates the create close form.
*/
createAdjustLoanChargeForm() {
this.adjustLoanChargeForm = this.formBuilder.group({
'amount': [this.chargeData.amount, Validators.required],
'externalId': '',
'paymentTypeId': '',
'note': ''
});
}
setRepaymentLoanDetails() {
this.organizationService.getPaymentTypes().subscribe((paymentTypes: any) => {
this.paymentTypes = paymentTypes;
});
}
/**
* Add payment detail fields to the UI.
*/
addPaymentDetails() {
this.showPaymentDetails = !this.showPaymentDetails;
if (this.showPaymentDetails) {
this.adjustLoanChargeForm.addControl('accountNumber', new FormControl(''));
this.adjustLoanChargeForm.addControl('checkNumber', new FormControl(''));
this.adjustLoanChargeForm.addControl('routingCode', new FormControl(''));
this.adjustLoanChargeForm.addControl('receiptNumber', new FormControl(''));
this.adjustLoanChargeForm.addControl('bankNumber', new FormControl(''));
} else {
this.adjustLoanChargeForm.removeControl('accountNumber');
this.adjustLoanChargeForm.removeControl('checkNumber');
this.adjustLoanChargeForm.removeControl('routingCode');
this.adjustLoanChargeForm.removeControl('receiptNumber');
this.adjustLoanChargeForm.removeControl('bankNumber');
}
}
/** Submits the repayment form */
submit() {
const adjustLoanChargeFormData = this.adjustLoanChargeForm.value;
const locale = this.settingsService.language.code;
const data = {
...adjustLoanChargeFormData,
locale
};
const command = 'adjustment';
this.loanService.executeLoansAccountChargesCommand(this.loanId, command, data, this.chargeId)
.subscribe((response: any) => {
this.router.navigate(['../..'], { relativeTo: this.route });
});
}
}
@@ -47,7 +47,7 @@ export class ApproveLoanComponent implements OnInit {
this.route.data.subscribe((data: { actionButtonData: any }) => { this.route.data.subscribe((data: { actionButtonData: any }) => {
this.loanData = data.actionButtonData; this.loanData = data.actionButtonData;
}); });
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
ngOnInit() { ngOnInit() {
@@ -38,7 +38,7 @@ export class AssignLoanOfficerComponent implements OnInit {
private router: Router, private router: Router,
private dateUtils: Dates, private dateUtils: Dates,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
/** /**
@@ -38,7 +38,7 @@ export class CloseAsRescheduledComponent implements OnInit {
private router: Router, private router: Router,
private dateUtils: Dates, private dateUtils: Dates,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
/** /**
@@ -51,7 +51,7 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
private dateUtils: Dates, private dateUtils: Dates,
private clientsService: ClientsService, private clientsService: ClientsService,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
ngOnInit() { ngOnInit() {
@@ -72,7 +72,7 @@ export class DisburseToSavingsAccountComponent implements OnInit {
dateFormat, dateFormat,
locale locale
}; };
const loanId = this.route.parent.snapshot.params['loanId']; const loanId = this.route.snapshot.params['loanId'];
this.loanService.loanActionButtons(loanId, 'disbursetosavings', data).subscribe((response: any) => { this.loanService.loanActionButtons(loanId, 'disbursetosavings', data).subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route }); this.router.navigate(['../../general'], { relativeTo: this.route });
}); });
@@ -45,7 +45,7 @@ export class DisburseComponent implements OnInit {
private router: Router, private router: Router,
private dateUtils: Dates, private dateUtils: Dates,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
@@ -42,7 +42,7 @@ export class EditRepaymentScheduleComponent implements OnInit {
private dialog: MatDialog, private dialog: MatDialog,
private dateUtils: Dates, private dateUtils: Dates,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
this.getRepaymentSchedule(); this.getRepaymentSchedule();
} }
@@ -36,7 +36,7 @@ export class ForeclosureComponent implements OnInit {
private router: Router, private router: Router,
private dateUtils: Dates, private dateUtils: Dates,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
ngOnInit() { ngOnInit() {
@@ -35,7 +35,7 @@ export class LoanCreditBalanceRefundComponent implements OnInit {
private router: Router, private router: Router,
private dateUtils: Dates, private dateUtils: Dates,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
/** /**
@@ -42,7 +42,7 @@ export class LoanRescheduleComponent implements OnInit {
private router: Router, private router: Router,
private dateUtils: Dates, private dateUtils: Dates,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
ngOnInit() { ngOnInit() {
@@ -43,7 +43,7 @@ export class LoanScreenReportsComponent implements OnInit {
private route: ActivatedRoute, private route: ActivatedRoute,
private sanitizer: DomSanitizer, private sanitizer: DomSanitizer,
private renderer: Renderer2) { private renderer: Renderer2) {
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
/** /**
@@ -39,7 +39,7 @@ export class LoansAccountCloseComponent implements OnInit {
private router: Router, private router: Router,
private dateUtils: Dates, private dateUtils: Dates,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
/** /**
@@ -45,7 +45,7 @@ export class MakeRepaymentComponent implements OnInit {
private router: Router, private router: Router,
private dateUtils: Dates, private dateUtils: Dates,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
/** /**
@@ -63,7 +63,7 @@ export class MakeRepaymentComponent implements OnInit {
*/ */
createRepaymentLoanForm() { createRepaymentLoanForm() {
this.repaymentLoanForm = this.formBuilder.group({ this.repaymentLoanForm = this.formBuilder.group({
'transactionDate': [new Date(), Validators.required], 'transactionDate': [this.settingsService.businessDate, Validators.required],
'transactionAmount': ['', Validators.required], 'transactionAmount': ['', Validators.required],
'externalId': '', 'externalId': '',
'paymentTypeId': '', 'paymentTypeId': '',
@@ -83,7 +83,6 @@ export class MakeRepaymentComponent implements OnInit {
*/ */
addPaymentDetails() { addPaymentDetails() {
this.showPaymentDetails = !this.showPaymentDetails; this.showPaymentDetails = !this.showPaymentDetails;
console.log(this.showPaymentDetails);
if (this.showPaymentDetails) { if (this.showPaymentDetails) {
this.repaymentLoanForm.addControl('accountNumber', new FormControl('')); this.repaymentLoanForm.addControl('accountNumber', new FormControl(''));
this.repaymentLoanForm.addControl('checkNumber', new FormControl('')); this.repaymentLoanForm.addControl('checkNumber', new FormControl(''));
@@ -52,7 +52,7 @@ export class PrepayLoanComponent implements OnInit {
private router: Router, private router: Router,
private dateUtils: Dates, private dateUtils: Dates,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
/** /**
@@ -45,7 +45,7 @@ export class RecoveryRepaymentComponent implements OnInit {
private router: Router, private router: Router,
private dateUtils: Dates, private dateUtils: Dates,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
/** /**
@@ -40,7 +40,7 @@ export class RejectLoanComponent implements OnInit {
private loanService: LoansService, private loanService: LoansService,
private dateUtils: Dates, private dateUtils: Dates,
private settingsService: SettingsService ) { private settingsService: SettingsService ) {
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
ngOnInit() { ngOnInit() {
@@ -36,7 +36,7 @@ export class UndoApprovalComponent implements OnInit {
* Submits undo approval form. * Submits undo approval form.
*/ */
submit() { submit() {
const loanId = this.route.parent.snapshot.params['loanId']; const loanId = this.route.snapshot.params['loanId'];
this.loanService.loanActionButtons(loanId, 'undoapproval', { 'note': this.note.value }).subscribe((response: any) => { this.loanService.loanActionButtons(loanId, 'undoapproval', { 'note': this.note.value }).subscribe((response: any) => {
this.router.navigate(['../../general'], {relativeTo: this.route}); this.router.navigate(['../../general'], {relativeTo: this.route});
}); });
@@ -33,7 +33,7 @@ export class UndoDisbursalComponent implements OnInit {
private loansService: LoansService, private loansService: LoansService,
private router: Router, private router: Router,
private route: ActivatedRoute) { private route: ActivatedRoute) {
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
/** /**
@@ -37,7 +37,7 @@ export class ViewGuarantorsComponent implements OnInit {
public loansService: LoansService, public loansService: LoansService,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router) { private router: Router) {
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
ngOnInit() { ngOnInit() {
@@ -73,7 +73,7 @@ export class WaiveInterestComponent implements OnInit {
dateFormat, dateFormat,
locale locale
}; };
const loanId = this.route.parent.snapshot.params['loanId']; const loanId = this.route.snapshot.params['loanId'];
this.loanService.submitLoanActionButton(loanId, data, 'waiveinterest').subscribe((response: any) => { this.loanService.submitLoanActionButton(loanId, data, 'waiveinterest').subscribe((response: any) => {
this.router.navigate(['../../general'], {relativeTo: this.route}); this.router.navigate(['../../general'], {relativeTo: this.route});
}); });
@@ -41,7 +41,7 @@ export class WithdrawnByClientComponent implements OnInit {
private router: Router, private router: Router,
private dateUtils: Dates, private dateUtils: Dates,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.loanId = this.route.parent.snapshot.params['loanId']; this.loanId = this.route.snapshot.params['loanId'];
} }
/** /**
@@ -76,7 +76,7 @@ export class WriteOffPageComponent implements OnInit {
dateFormat, dateFormat,
locale locale
}; };
const loanId = this.route.parent.snapshot.params['loanId']; const loanId = this.route.snapshot.params['loanId'];
delete data.amount; delete data.amount;
this.loanService.submitLoanActionButton(loanId, data, 'writeoff').subscribe((response: any) => { this.loanService.submitLoanActionButton(loanId, data, 'writeoff').subscribe((response: any) => {
this.router.navigate(['../../general'], {relativeTo: this.route}); this.router.navigate(['../../general'], {relativeTo: this.route});
@@ -30,7 +30,7 @@ export class LoanDocumentsTabComponent implements OnInit {
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private loansService: LoansService, private loansService: LoansService,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.entityId = this.route.parent.snapshot.params['loanId']; this.entityId = this.route.snapshot.params['loanId'];
this.route.data.subscribe((data: { loanDocuments: any }) => { this.route.data.subscribe((data: { loanDocuments: any }) => {
this.getLoanDocumentsData(data.loanDocuments); this.getLoanDocumentsData(data.loanDocuments);
@@ -23,7 +23,7 @@ export class NotesTabComponent implements OnInit {
private authenticationService: AuthenticationService) { private authenticationService: AuthenticationService) {
const savedCredentials = this.authenticationService.getCredentials(); const savedCredentials = this.authenticationService.getCredentials();
this.username = savedCredentials.username; this.username = savedCredentials.username;
this.entityId = this.route.parent.snapshot.params['loanId']; this.entityId = this.route.snapshot.params['loanId'];
this.route.data.subscribe((data: { loanNotes: any }) => { this.route.data.subscribe((data: { loanNotes: any }) => {
this.entityNotes = data.loanNotes; this.entityNotes = data.loanNotes;
}); });
@@ -91,9 +91,10 @@ export class TransactionsTabComponent implements OnInit {
* MERCHANT_ISSUED_REFUND:21 * MERCHANT_ISSUED_REFUND:21
* PAYOUT_REFUND:22 * PAYOUT_REFUND:22
* GOODWILL_CREDIT:23 * GOODWILL_CREDIT:23
* CHARGE_ADJUSTMENT:26
*/ */
showTransactions(transactionsData: any) { showTransactions(transactionsData: any) {
if ([1, 2, 4, 9, 20, 21, 22, 23].includes(transactionsData.type.id)) { if ([1, 2, 4, 9, 20, 21, 22, 23, 26].includes(transactionsData.type.id)) {
this.router.navigate([transactionsData.id], { relativeTo: this.route }); this.router.navigate([transactionsData.id], { relativeTo: this.route });
} }
} }
@@ -39,11 +39,14 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<div fxLayoutGap="5px" fxLayout="row" fxLayout.xs="column"> <div fxFlexFill>
<mat-label fxFlexAlign="center">Show Payment Details</mat-label> <span fxFlex="75%" class="expandcollapsebutton m-l-10 m-t-40" (click)="addPaymentDetails()">
<button type="button" mat-mini-fab color="primary" (click)="addPaymentDetails()"> <mat-slide-toggle>
<fa-icon [icon]="!addPaymentDetailsFlag ? 'plus-circle' : 'minus-circle'" size="lg"></fa-icon> <div [className]="showPaymentDetails ? 'enabled' : 'disabled'">
</button> <span class="m-l-10">Show Payment Details</span>
</div>
</mat-slide-toggle>
</span>
</div> </div>
<mat-form-field *ngIf="editTransactionForm.controls['accountNumber']"> <mat-form-field *ngIf="editTransactionForm.controls['accountNumber']">
@@ -33,7 +33,7 @@ export class EditTransactionComponent implements OnInit {
position: number position: number
}[]; }[];
/** Flag to enable payment details fields. */ /** Flag to enable payment details fields. */
addPaymentDetailsFlag: Boolean = false; showPaymentDetails: Boolean = false;
/** loan account's Id */ /** loan account's Id */
loanAccountId: string; loanAccountId: string;
/** Transaction Template */ /** Transaction Template */
@@ -58,7 +58,7 @@ export class EditTransactionComponent implements OnInit {
this.transactionTemplateData = data.loansAccountTransactionTemplate; this.transactionTemplateData = data.loansAccountTransactionTemplate;
this.paymentTypeOptions = this.transactionTemplateData.paymentTypeOptions; this.paymentTypeOptions = this.transactionTemplateData.paymentTypeOptions;
}); });
this.loanAccountId = this.route.parent.parent.parent.snapshot.params['loanId']; this.loanAccountId = this.route.snapshot.params['loanId'];
} }
/** /**
@@ -91,8 +91,8 @@ export class EditTransactionComponent implements OnInit {
* Method to add payment detail fields to the UI. * Method to add payment detail fields to the UI.
*/ */
addPaymentDetails() { addPaymentDetails() {
this.addPaymentDetailsFlag = !this.addPaymentDetailsFlag; this.showPaymentDetails = !this.showPaymentDetails;
if (this.addPaymentDetailsFlag) { if (this.showPaymentDetails) {
this.editTransactionForm.addControl('accountNumber', new FormControl('')); this.editTransactionForm.addControl('accountNumber', new FormControl(''));
this.editTransactionForm.addControl('checkNumber', new FormControl('')); this.editTransactionForm.addControl('checkNumber', new FormControl(''));
this.editTransactionForm.addControl('routingCode', new FormControl('')); this.editTransactionForm.addControl('routingCode', new FormControl(''));
@@ -119,7 +119,7 @@ export class ViewTransactionComponent implements OnInit {
* Undo the loans transaction * Undo the loans transaction
*/ */
undoTransaction() { undoTransaction() {
const accountId = this.route.parent.parent.parent.snapshot.params['loanId']; const accountId = this.route.snapshot.params['loanId'];
const undoTransactionAccountDialogRef = this.dialog.open(ConfirmationDialogComponent, { const undoTransactionAccountDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: 'Undo Transaction', dialogContext: `Are you sure you want undo the transaction ${this.transactionData.id}` } data: { heading: 'Undo Transaction', dialogContext: `Are you sure you want undo the transaction ${this.transactionData.id}` }
}); });
@@ -141,7 +141,7 @@ export class ViewTransactionComponent implements OnInit {
} }
chargebackTransaction() { chargebackTransaction() {
const accountId = this.route.parent.parent.parent.snapshot.params['loanId']; const accountId = this.route.snapshot.params['loanId'];
const formfields: FormfieldBase[] = [ const formfields: FormfieldBase[] = [
new SelectBase({ new SelectBase({
controlName: 'paymentTypeId', controlName: 'paymentTypeId',
@@ -11,11 +11,19 @@
</button> </button>
</span> </span>
<span *ngIf="allowWaive"> <span *ngIf="allowWaive">
<button mat-raised-button color="primary" *mifosxHasPermission="'WAIVE_SAVINGSACCOUNTCHARGE'" (click)="waiveCharge()"> <button mat-raised-button color="primary" *mifosxHasPermission="'WAIVE_SAVINGSACCOUNTCHARGE'"
(click)="waiveCharge()">
<fa-icon icon="flag" class="m-r-10"></fa-icon> <fa-icon icon="flag" class="m-r-10"></fa-icon>
Waive Waive
</button> </button>
</span> </span>
<span>
<button mat-raised-button color="accent" *mifosxHasPermission="'ADJUSTMENT_LOANCHARGE'"
(click)="adjustmentCharge()">
<fa-icon icon="pen" class="m-r-10"></fa-icon>
Adjustment
</button>
</span>
</div> </div>
<div *ngIf="loansAccountData.status.value === 'Submitted and pending approval'" fxLayout="row" fxLayoutAlign="end" <div *ngIf="loansAccountData.status.value === 'Submitted and pending approval'" fxLayout="row" fxLayoutAlign="end"
@@ -178,6 +178,10 @@ export class ViewChargeComponent {
return this.chargeData.paid ? 'paid' : 'not-paid'; return this.chargeData.paid ? 'paid' : 'not-paid';
} }
adjustmentCharge(): void {
this.router.navigate(['adjustment'], { relativeTo: this.route});
}
/** /**
* Refetches data fot the component * Refetches data fot the component
* TODO: Replace by a custom reload component instead of hard-coded back-routing. * TODO: Replace by a custom reload component instead of hard-coded back-routing.
+3 -1
View File
@@ -73,6 +73,7 @@ import { EditRepaymentScheduleComponent } from './loans-view/loan-account-action
import { DisburseToSavingsAccountComponent } from './loans-view/loan-account-actions/disburse-to-savings-account/disburse-to-savings-account.component'; import { DisburseToSavingsAccountComponent } from './loans-view/loan-account-actions/disburse-to-savings-account/disburse-to-savings-account.component';
import { LoansAccountDatatableStepComponent } from './loans-account-stepper/loans-account-datatable-step/loans-account-datatable-step.component'; import { LoansAccountDatatableStepComponent } from './loans-account-stepper/loans-account-datatable-step/loans-account-datatable-step.component';
import { RescheduleLoanTabComponent } from './loans-view/reschedule-loan-tab/reschedule-loan-tab.component'; import { RescheduleLoanTabComponent } from './loans-view/reschedule-loan-tab/reschedule-loan-tab.component';
import { AdjustLoanChargeComponent } from './loans-view/loan-account-actions/adjust-loan-charge/adjust-loan-charge.component';
/** /**
* Loans Module * Loans Module
@@ -144,7 +145,8 @@ import { RescheduleLoanTabComponent } from './loans-view/reschedule-loan-tab/res
EditRepaymentScheduleComponent, EditRepaymentScheduleComponent,
DisburseToSavingsAccountComponent, DisburseToSavingsAccountComponent,
LoansAccountDatatableStepComponent, LoansAccountDatatableStepComponent,
RescheduleLoanTabComponent RescheduleLoanTabComponent,
AdjustLoanChargeComponent
], ],
providers: [ ], providers: [ ],
}) })
+1 -1
View File
@@ -215,7 +215,7 @@ const routes: Routes = [
component: CreateSavingProductComponent, component: CreateSavingProductComponent,
data: { title: extract('Create Saving Product'), breadcrumb: 'Create' }, data: { title: extract('Create Saving Product'), breadcrumb: 'Create' },
resolve: { resolve: {
savingProductDatatables: SavingProductDatatablesResolver savingProductsTemplate: SavingProductsTemplateResolver
} }
}, },
{ {
@@ -41,7 +41,7 @@ export class ActivateSavingsAccountComponent implements OnInit {
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.accountId = this.route.parent.snapshot.params['savingAccountId']; this.accountId = this.route.snapshot.params['savingAccountId'];
} }
/** /**
@@ -49,7 +49,7 @@ export class AddChargeSavingsAccountComponent implements OnInit {
this.route.data.subscribe((data: { savingsAccountActionData: any }) => { this.route.data.subscribe((data: { savingsAccountActionData: any }) => {
this.savingsChargeOptions = data.savingsAccountActionData.chargeOptions; this.savingsChargeOptions = data.savingsAccountActionData.chargeOptions;
}); });
this.savingAccountId = this.route.parent.snapshot.params['savingAccountId']; this.savingAccountId = this.route.snapshot.params['savingAccountId'];
} }
/** /**
@@ -45,7 +45,7 @@ export class ApplyAnnualFeesSavingsAccountComponent implements OnInit {
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.accountId = this.route.parent.snapshot.params['savingAccountId']; this.accountId = this.route.snapshot.params['savingAccountId'];
this.route.data.subscribe((data: { savingsAccountActionData: any }) => { this.route.data.subscribe((data: { savingsAccountActionData: any }) => {
this.savingsAccountData = data.savingsAccountActionData; this.savingsAccountData = data.savingsAccountActionData;
}); });
@@ -41,7 +41,7 @@ export class ApproveSavingsAccountComponent implements OnInit {
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.accountId = this.route.parent.snapshot.params['savingAccountId']; this.accountId = this.route.snapshot.params['savingAccountId'];
} }
/** /**
@@ -51,7 +51,7 @@ export class CloseSavingsAccountComponent implements OnInit {
this.paymentTypeOptions = data.savingsAccountActionData[0].paymentTypeOptions; this.paymentTypeOptions = data.savingsAccountActionData[0].paymentTypeOptions;
this.transactionAmount = data.savingsAccountActionData[1].summary.accountBalance; this.transactionAmount = data.savingsAccountActionData[1].summary.accountBalance;
}); });
this.accountId = this.route.parent.snapshot.params['savingAccountId']; this.accountId = this.route.snapshot.params['savingAccountId'];
} }
/** /**
@@ -49,7 +49,7 @@ export class ManageSavingsAccountComponent implements OnInit {
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.transactionCommand = this.route.snapshot.params['name'].toLowerCase().replaceAll(' ', ''); this.transactionCommand = this.route.snapshot.params['name'].toLowerCase().replaceAll(' ', '');
this.transactionType[this.transactionCommand] = true; this.transactionType[this.transactionCommand] = true;
this.savingAccountId = this.route.parent.snapshot.params['savingAccountId']; this.savingAccountId = this.route.snapshot.params['savingAccountId'];
} }
/** /**
@@ -41,7 +41,7 @@ export class PostInterestAsOnSavingsAccountComponent implements OnInit {
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.accountId = this.route.parent.snapshot.params['savingAccountId']; this.accountId = this.route.snapshot.params['savingAccountId'];
} }
/** /**
@@ -41,7 +41,7 @@ export class RejectSavingsAccountComponent implements OnInit {
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.accountId = this.route.parent.snapshot.params['savingAccountId']; this.accountId = this.route.snapshot.params['savingAccountId'];
} }
/** /**
@@ -7,7 +7,7 @@
<mifosx-savings-account-unassign-staff *ngIf="actions['Unassign Staff']"></mifosx-savings-account-unassign-staff> <mifosx-savings-account-unassign-staff *ngIf="actions['Unassign Staff']"></mifosx-savings-account-unassign-staff>
<mifosx-withdraw-by-client-savings-account *ngIf="actions['Withdraw By Client']"></mifosx-withdraw-by-client-savings-account> <mifosx-withdraw-by-client-savings-account *ngIf="actions['Withdraw By Client']"></mifosx-withdraw-by-client-savings-account>
<mifosx-add-charge-savings-account *ngIf="actions['Add Charge']"></mifosx-add-charge-savings-account> <mifosx-add-charge-savings-account *ngIf="actions['Add Charge']"></mifosx-add-charge-savings-account>
<mifosx-savings-transactions *ngIf="actions['Withdrawal'] || actions['Deposit']"></mifosx-savings-transactions> <mifosx-savings-transactions [currencyCode]="currencyCode" *ngIf="actions['Withdrawal'] || actions['Deposit']"></mifosx-savings-transactions>
<mifosx-close-savings-account *ngIf="actions['Close']"></mifosx-close-savings-account> <mifosx-close-savings-account *ngIf="actions['Close']"></mifosx-close-savings-account>
<mifosx-apply-annual-fees-savings-account *ngIf="actions['Apply Annual Fees']"></mifosx-apply-annual-fees-savings-account> <mifosx-apply-annual-fees-savings-account *ngIf="actions['Apply Annual Fees']"></mifosx-apply-annual-fees-savings-account>
<mifosx-manage-savings-account *ngIf="actions['Hold Amount'] || actions['Block Account']"></mifosx-manage-savings-account> <mifosx-manage-savings-account *ngIf="actions['Hold Amount'] || actions['Block Account']"></mifosx-manage-savings-account>
@@ -49,10 +49,15 @@ export class SavingAccountActionsComponent {
'Unblock Account': false 'Unblock Account': false
}; };
currencyCode: string;
/** /**
* @param {ActivatedRoute} route Activated Route * @param {ActivatedRoute} route Activated Route
*/ */
constructor(private route: ActivatedRoute) { constructor(private route: ActivatedRoute) {
this.route.data.subscribe((data: { savingsAccountActionData: any }) => {
this.currencyCode = data.savingsAccountActionData.currency.code;
});
const name = this.route.snapshot.params['name']; const name = this.route.snapshot.params['name'];
this.actions[name] = true; this.actions[name] = true;
} }
@@ -45,7 +45,7 @@ export class SavingsAccountAssignStaffComponent implements OnInit {
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.accountId = this.route.parent.snapshot.params['savingAccountId']; this.accountId = this.route.snapshot.params['savingAccountId'];
this.route.data.subscribe((data: { savingsAccountActionData: any }) => { this.route.data.subscribe((data: { savingsAccountActionData: any }) => {
this.savingsAccountData = data.savingsAccountActionData; this.savingsAccountData = data.savingsAccountActionData;
}); });
@@ -20,9 +20,11 @@
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field appearance="fill">
<mat-label>Transaction Amount</mat-label> <mat-label>Transaction Amount</mat-label>
<input type="number" formControlName="transactionAmount" required matInput /> <span matTextSuffix class="m-l-10">{{ currencyCode }}</span>
<span fxFlex="auto"></span>
<input type="number" class="right-input" formControlName="transactionAmount" required matInput />
<mat-error *ngIf="savingAccountTransactionForm.controls.transactionAmount.hasError('required')"> <mat-error *ngIf="savingAccountTransactionForm.controls.transactionAmount.hasError('required')">
Transaction Amount is <strong>required</strong> Transaction Amount is <strong>required</strong>
</mat-error> </mat-error>
@@ -30,7 +32,7 @@
<mat-form-field> <mat-form-field>
<mat-label>Payment Type</mat-label> <mat-label>Payment Type</mat-label>
<mat-select formControlName="paymentTypeId"> <mat-select required formControlName="paymentTypeId">
<mat-option *ngFor="let paymentType of paymentTypeOptions" [value]="paymentType.id"> <mat-option *ngFor="let paymentType of paymentTypeOptions" [value]="paymentType.id">
{{ paymentType.name }} {{ paymentType.name }}
</mat-option> </mat-option>
@@ -1,3 +1,15 @@
.expandcollapsebutton {
margin-top: -7px;
}
.container { .container {
width: 37rem; max-width: 37rem;
}
.right-input {
text-align: right;
}
.right-label {
padding-right: 25px !important;
} }
@@ -1,5 +1,5 @@
/** Angular Imports */ /** Angular Imports */
import { Component, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms'; import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
import { Router, ActivatedRoute } from '@angular/router'; import { Router, ActivatedRoute } from '@angular/router';
@@ -18,6 +18,8 @@ import { Dates } from 'app/core/utils/dates';
}) })
export class SavingsAccountTransactionsComponent implements OnInit { export class SavingsAccountTransactionsComponent implements OnInit {
@Input() currencyCode: string;
/** Minimum Due Date allowed. */ /** Minimum Due Date allowed. */
minDate = new Date(2000, 0, 1); minDate = new Date(2000, 0, 1);
/** Maximum Due Date allowed. */ /** Maximum Due Date allowed. */
@@ -61,7 +63,7 @@ export class SavingsAccountTransactionsComponent implements OnInit {
}); });
this.transactionCommand = this.route.snapshot.params['name'].toLowerCase(); this.transactionCommand = this.route.snapshot.params['name'].toLowerCase();
this.transactionType[this.transactionCommand] = true; this.transactionType[this.transactionCommand] = true;
this.savingAccountId = this.route.parent.snapshot.params['savingAccountId']; this.savingAccountId = this.route.snapshot.params['savingAccountId'];
} }
/** /**
@@ -77,8 +79,8 @@ export class SavingsAccountTransactionsComponent implements OnInit {
*/ */
createSavingAccountTransactionForm() { createSavingAccountTransactionForm() {
this.savingAccountTransactionForm = this.formBuilder.group({ this.savingAccountTransactionForm = this.formBuilder.group({
'transactionDate': ['', Validators.required], 'transactionDate': [this.settingsService.businessDate, Validators.required],
'transactionAmount': ['', Validators.required], 'transactionAmount': [0, Validators.required],
'paymentTypeId': [''], 'paymentTypeId': [''],
'note': [''] 'note': ['']
}); });
@@ -89,7 +91,6 @@ export class SavingsAccountTransactionsComponent implements OnInit {
*/ */
addPaymentDetails() { addPaymentDetails() {
this.addPaymentDetailsFlag = !this.addPaymentDetailsFlag; this.addPaymentDetailsFlag = !this.addPaymentDetailsFlag;
/*
if (this.addPaymentDetailsFlag) { if (this.addPaymentDetailsFlag) {
this.savingAccountTransactionForm.addControl('accountNumber', new FormControl('')); this.savingAccountTransactionForm.addControl('accountNumber', new FormControl(''));
this.savingAccountTransactionForm.addControl('checkNumber', new FormControl('')); this.savingAccountTransactionForm.addControl('checkNumber', new FormControl(''));
@@ -103,8 +104,6 @@ export class SavingsAccountTransactionsComponent implements OnInit {
this.savingAccountTransactionForm.removeControl('receiptNumber'); this.savingAccountTransactionForm.removeControl('receiptNumber');
this.savingAccountTransactionForm.removeControl('bankNumber'); this.savingAccountTransactionForm.removeControl('bankNumber');
} }
*/
} }
/** /**
@@ -41,7 +41,7 @@ export class SavingsAccountUnassignStaffComponent implements OnInit {
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.accountId = this.route.parent.snapshot.params['savingAccountId']; this.accountId = this.route.snapshot.params['savingAccountId'];
} }
/** /**
@@ -31,7 +31,7 @@ export class UndoApprovalSavingsAccountComponent implements OnInit {
private savingsService: SavingsService, private savingsService: SavingsService,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router) { private router: Router) {
this.accountId = this.route.parent.snapshot.params['savingAccountId']; this.accountId = this.route.snapshot.params['savingAccountId'];
} }
/** /**
@@ -41,7 +41,7 @@ export class WithdrawByClientSavingsAccountComponent implements OnInit {
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.accountId = this.route.parent.snapshot.params['savingAccountId']; this.accountId = this.route.snapshot.params['savingAccountId'];
} }
/** /**
@@ -38,11 +38,6 @@
<span fxFlex="60%">{{ savingsAccountTermsForm.get('decimal').value }}</span> <span fxFlex="60%">{{ savingsAccountTermsForm.get('decimal').value }}</span>
</div> </div>
<div fxFlexFill>
<span fxFlex="40%">Currency in multiples of</span>
<span fxFlex="60%">{{ savingsAccountTermsForm.get('currencyMultiple').value }}</span>
</div>
<div fxFlexFill> <div fxFlexFill>
<span fxFlex="40%">Nominal Annual Interest Rate:</span> <span fxFlex="40%">Nominal Annual Interest Rate:</span>
<span fxFlex="60%">{{ savingsAccount.nominalAnnualInterestRate }}</span> <span fxFlex="60%">{{ savingsAccount.nominalAnnualInterestRate }}</span>
@@ -12,11 +12,6 @@
<input type="number" matInput formControlName="decimal"> <input type="number" matInput formControlName="decimal">
</mat-form-field> </mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Currency in multiples of</mat-label>
<input type="number" matInput formControlName="currencyMultiple" >
</mat-form-field>
<mat-form-field fxFlex="48%"> <mat-form-field fxFlex="48%">
<mat-label>Nominal Annual Interest Rate</mat-label> <mat-label>Nominal Annual Interest Rate</mat-label>
<input type="number" matInput formControlName="nominalAnnualInterestRate" required> <input type="number" matInput formControlName="nominalAnnualInterestRate" required>
@@ -50,7 +50,6 @@ export class SavingsAccountTermsStepComponent implements OnChanges, OnInit {
this.savingsAccountTermsForm.patchValue({ this.savingsAccountTermsForm.patchValue({
'currencyCode': this.savingsAccountProductTemplate.currency.code, 'currencyCode': this.savingsAccountProductTemplate.currency.code,
'decimal': this.savingsAccountProductTemplate.currency.decimalPlaces, 'decimal': this.savingsAccountProductTemplate.currency.decimalPlaces,
'currencyMultiple': this.savingsAccountProductTemplate.currency.inMultiplesOf,
'minBalanceForInterestCalculation': this.savingsAccountProductTemplate.minBalanceForInterestCalculation, 'minBalanceForInterestCalculation': this.savingsAccountProductTemplate.minBalanceForInterestCalculation,
'nominalAnnualInterestRate': this.savingsAccountProductTemplate.nominalAnnualInterestRate, 'nominalAnnualInterestRate': this.savingsAccountProductTemplate.nominalAnnualInterestRate,
'interestCompoundingPeriodType': this.savingsAccountProductTemplate.interestCompoundingPeriodType.id, 'interestCompoundingPeriodType': this.savingsAccountProductTemplate.interestCompoundingPeriodType.id,
@@ -99,7 +98,6 @@ export class SavingsAccountTermsStepComponent implements OnChanges, OnInit {
'decimal': [{value: '', disabled: true}], 'decimal': [{value: '', disabled: true}],
'nominalAnnualInterestRate': ['', Validators.required], 'nominalAnnualInterestRate': ['', Validators.required],
'interestCompoundingPeriodType': ['', Validators.required], 'interestCompoundingPeriodType': ['', Validators.required],
'currencyMultiple': [{value: '', disabled: true}],
'interestPostingPeriodType': ['', Validators.required], 'interestPostingPeriodType': ['', Validators.required],
'interestCalculationType': ['', Validators.required], 'interestCalculationType': ['', Validators.required],
'interestCalculationDaysInYearType': ['', Validators.required], 'interestCalculationDaysInYearType': ['', Validators.required],
@@ -146,7 +144,10 @@ export class SavingsAccountTermsStepComponent implements OnChanges, OnInit {
* Returns savings account terms form value. * Returns savings account terms form value.
*/ */
get savingsAccountTerms() { get savingsAccountTerms() {
return this.savingsAccountTermsForm.getRawValue(); const payload = this.savingsAccountTermsForm.getRawValue();
delete payload.currencyCode;
delete payload.decimal;
return payload;
} }
} }
@@ -135,7 +135,7 @@ export class ChargesTabComponent implements OnInit {
dateFormat, dateFormat,
locale locale
}; };
this.savingsService.executeSavingsAccountChargesCommand(this.savingsAccountData.id, 'pay', dataObject, chargeId) this.savingsService.executeSavingsAccountChargesCommand(this.savingsAccountData.id, 'paycharge', dataObject, chargeId)
.subscribe(() => { .subscribe(() => {
this.reload(); this.reload();
}); });
@@ -19,7 +19,7 @@ export class NotesTabComponent implements OnInit {
private authenticationService: AuthenticationService) { private authenticationService: AuthenticationService) {
const savedCredentials = this.authenticationService.getCredentials(); const savedCredentials = this.authenticationService.getCredentials();
this.username = savedCredentials.username; this.username = savedCredentials.username;
this.entityId = this.route.parent.snapshot.params['savingAccountId']; this.entityId = this.route.snapshot.params['savingAccountId'];
this.route.data.subscribe((data: { savingAccountNotes: any }) => { this.route.data.subscribe((data: { savingAccountNotes: any }) => {
this.entityNotes = data.savingAccountNotes; this.entityNotes = data.savingAccountNotes;
}); });
@@ -75,7 +75,7 @@
<div class="savings-account-tables" fxLayout="row" fxLayoutGap="2%"> <div class="savings-account-tables" fxLayout="row" fxLayoutGap="2%">
<div fxFlex="49%" <div fxFlex="49%"
*ngIf="!savingsAccountData.status.rejected && !savingsAccountData.status.submittedAndPendingApproval; else alternateSummary"> *ngIf="isActive; else alternateSummary">
<h4 class="table-headers">Account Summary</h4> <h4 class="table-headers">Account Summary</h4>
<table> <table>
<tbody> <tbody>
@@ -301,7 +301,7 @@
</div> </div>
<nav mat-tab-nav-bar class="navigation-tabs"> <nav mat-tab-nav-bar class="navigation-tabs" *ngIf="isActive">
<a mat-tab-link [routerLink]="['./transactions']" routerLinkActive #transactions="routerLinkActive" <a mat-tab-link [routerLink]="['./transactions']" routerLinkActive #transactions="routerLinkActive"
[active]="transactions.isActive"> [active]="transactions.isActive">
Transactions Transactions
@@ -33,6 +33,8 @@ export class SavingsAccountViewComponent implements OnInit {
/** Entity Type */ /** Entity Type */
entityType: string; entityType: string;
isActive = false;
/** /**
* Fetches savings account data from `resolve` * Fetches savings account data from `resolve`
* @param {ActivatedRoute} route Activated Route * @param {ActivatedRoute} route Activated Route
@@ -65,6 +67,7 @@ export class SavingsAccountViewComponent implements OnInit {
*/ */
setConditionalButtons() { setConditionalButtons() {
const status = this.savingsAccountData.status.value; const status = this.savingsAccountData.status.value;
this.isActive = (status === 'Active');
const subStatus = this.savingsAccountData.subStatus; const subStatus = this.savingsAccountData.subStatus;
this.buttonConfig = new SavingsButtonsConfiguration(status, subStatus); this.buttonConfig = new SavingsButtonsConfiguration(status, subStatus);
if (this.savingsAccountData.clientId) { if (this.savingsAccountData.clientId) {
@@ -30,7 +30,7 @@ export class SavingsDocumentsTabComponent implements OnInit {
this.route.data.subscribe((data: { savingsDocuments: any }) => { this.route.data.subscribe((data: { savingsDocuments: any }) => {
this.setSavingsDocumentsData(data.savingsDocuments); this.setSavingsDocumentsData(data.savingsDocuments);
}); });
this.entityId = this.route.parent.snapshot.params['savingAccountId']; this.entityId = this.route.snapshot.params['savingAccountId'];
} }
ngOnInit() { ngOnInit() {
@@ -1,16 +1,16 @@
<div class="tab-container mat-typography"> <div class="tab-container mat-typography">
<div fxLayout="row" fxLayoutAlign="start"> <div class="mat-elevation-z1 m-b-25" [hidden]="!accountWithTransactions">
<div class="m-b-10">
<h3>All Transactions</h3>
</div>
<div class="action-button m-b-20" fxLayout="row" fxLayoutGap="20px" *ngIf="checkStatus()">
<button mat-raised-button color="primary" [routerLink]="['/accounting', 'journal-entries']">View Journal Entries</button>
<button mat-raised-button color="primary" [routerLink]="['export']">Export</button>
</div>
</div>
<div class="mat-elevation-z1 m-b-25"> <div fxLayout="row" fxLayoutAlign="start">
<div class="m-b-10">
<h3>All Transactions</h3>
</div>
<div class="action-button m-b-20" fxLayout="row" fxLayoutGap="20px" *ngIf="checkStatus()">
<button mat-raised-button color="primary" [routerLink]="['/accounting', 'journal-entries']">View Journal Entries</button>
<button mat-raised-button color="primary" [routerLink]="['export']">Export</button>
</div>
</div>
<table mat-table [dataSource]="dataSource" matSort> <table mat-table [dataSource]="dataSource" matSort>
@@ -62,4 +62,10 @@
</div> </div>
<div class="alert" [hidden]="accountWithTransactions">
<div class="message">
<i class="fa fa-exclamation-circle alert-check"></i>
No transaction was found
</div>
</div>
</div> </div>
@@ -20,12 +20,14 @@ export class TransactionsTabComponent implements OnInit {
/** Transactions Data */ /** Transactions Data */
transactionsData: any; transactionsData: any;
/** Columns to be displayed in transactions table. */ /** Columns to be displayed in transactions table. */
displayedColumns: string[] = ['id', 'transactionDate', 'transactionType', 'debit', 'credit', 'balance', 'viewReciept']; displayedColumns: string[] = ['id', 'date', 'transactionType', 'debit', 'credit', 'balance', 'viewReciept'];
/** Data source for transactions table. */ /** Data source for transactions table. */
dataSource: MatTableDataSource<any>; dataSource: MatTableDataSource<any>;
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
@ViewChild(MatSort, { static: true }) sort: MatSort; @ViewChild(MatSort, { static: true }) sort: MatSort;
accountWithTransactions = false;
/** /**
* Retrieves savings account data from `resolve`. * Retrieves savings account data from `resolve`.
* @param {ActivatedRoute} route Activated Route. * @param {ActivatedRoute} route Activated Route.
@@ -40,6 +42,7 @@ export class TransactionsTabComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.dataSource = new MatTableDataSource(this.transactionsData); this.dataSource = new MatTableDataSource(this.transactionsData);
this.accountWithTransactions = (this.transactionsData.length > 0);
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort; this.dataSource.sort = this.sort;
} }
@@ -34,11 +34,14 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<div fxLayoutGap="5px" fxLayout="row" fxLayout.xs="column"> <div fxFlexFill>
<mat-label fxFlexAlign="center">Show Payment Details</mat-label> <span fxFlex="75%" class="expandcollapsebutton m-l-10 m-t-40" (click)="addPaymentDetails()">
<button type="button" mat-mini-fab color="primary" (click)="addPaymentDetails()"> <mat-slide-toggle>
<fa-icon [icon]="!addPaymentDetailsFlag ? 'plus-circle' : 'minus-circle'" size="lg"></fa-icon> <div [className]="showPaymentDetails ? 'enabled' : 'disabled'">
</button> <span class="m-l-10">Show Payment Details</span>
</div>
</mat-slide-toggle>
</span>
</div> </div>
<mat-form-field *ngIf="editTransactionForm.controls['accountNumber']"> <mat-form-field *ngIf="editTransactionForm.controls['accountNumber']">
@@ -72,10 +75,9 @@
</mat-card-actions> </mat-card-actions>
</mat-card-content> </mat-card-content>
</form> </form>
</mat-card> </mat-card>
</div> </div>
@@ -33,7 +33,7 @@ export class EditTransactionComponent implements OnInit {
position: number position: number
}[]; }[];
/** Flag to enable payment details fields. */ /** Flag to enable payment details fields. */
addPaymentDetailsFlag: Boolean = false; showPaymentDetails: Boolean = false;
/** saving account's Id */ /** saving account's Id */
savingAccountId: string; savingAccountId: string;
/** Transaction Template */ /** Transaction Template */
@@ -58,7 +58,7 @@ export class EditTransactionComponent implements OnInit {
this.transactionTemplateData = data.savingsAccountTransactionTemplate; this.transactionTemplateData = data.savingsAccountTransactionTemplate;
this.paymentTypeOptions = this.transactionTemplateData.paymentTypeOptions; this.paymentTypeOptions = this.transactionTemplateData.paymentTypeOptions;
}); });
this.savingAccountId = this.route.parent.snapshot.params['savingAccountId']; this.savingAccountId = this.route.snapshot.params['savingAccountId'];
} }
/** /**
@@ -89,8 +89,8 @@ export class EditTransactionComponent implements OnInit {
* Method to add payment detail fields to the UI. * Method to add payment detail fields to the UI.
*/ */
addPaymentDetails() { addPaymentDetails() {
this.addPaymentDetailsFlag = !this.addPaymentDetailsFlag; this.showPaymentDetails = !this.showPaymentDetails;
if (this.addPaymentDetailsFlag) { if (this.showPaymentDetails) {
this.editTransactionForm.addControl('accountNumber', new FormControl('')); this.editTransactionForm.addControl('accountNumber', new FormControl(''));
this.editTransactionForm.addControl('checkNumber', new FormControl('')); this.editTransactionForm.addControl('checkNumber', new FormControl(''));
this.editTransactionForm.addControl('routingCode', new FormControl('')); this.editTransactionForm.addControl('routingCode', new FormControl(''));
@@ -50,14 +50,6 @@
{{ transactionData.date | dateFormat }} {{ transactionData.date | dateFormat }}
</div> </div>
<div fxFlex="50%" class="mat-body-strong">
Amount
</div>
<div fxFlex="50%">
{{ transactionData.currency.displaySymbol }} {{ transactionData.amount | number }} ({{ transactionData.currency.code }})
</div>
<div fxFlex="50%" class="mat-body-strong"> <div fxFlex="50%" class="mat-body-strong">
Currency Currency
</div> </div>
@@ -66,6 +58,14 @@
{{ transactionData.currency.name }} {{ transactionData.currency.name }}
</div> </div>
<div fxFlex="50%" class="mat-body-strong">
Amount
</div>
<div fxFlex="50%">
{{ transactionData.amount | currency }} {{ transactionData.currency.code }}
</div>
<div fxFlex="50%" class="mat-body-strong"> <div fxFlex="50%" class="mat-body-strong">
Note Note
</div> </div>
@@ -44,7 +44,7 @@ export class ViewTransactionComponent {
public dialog: MatDialog, public dialog: MatDialog,
private settingsService: SettingsService) { private settingsService: SettingsService) {
this.route.data.subscribe((data: { savingsAccountTransaction: any }) => { this.route.data.subscribe((data: { savingsAccountTransaction: any }) => {
this.accountId = this.route.parent.snapshot.params['savingAccountId']; this.accountId = this.route.snapshot.params['savingAccountId'];
this.transactionData = data.savingsAccountTransaction; this.transactionData = data.savingsAccountTransaction;
}); });
} }
@@ -91,7 +91,7 @@
</div> </div>
<div fxFlex="50%"> <div fxFlex="50%">
{{ chargeData.amount }} {{ chargeData.amount | number }}
</div> </div>
<div fxFlex="50%" class="mat-body-strong"> <div fxFlex="50%" class="mat-body-strong">
@@ -99,7 +99,7 @@
</div> </div>
<div fxFlex="50%"> <div fxFlex="50%">
{{ chargeData.amountPaid }} {{ chargeData.amountPaid | number }}
</div> </div>
<div fxFlex="50%" class="mat-body-strong"> <div fxFlex="50%" class="mat-body-strong">
@@ -107,7 +107,7 @@
</div> </div>
<div fxFlex="50%"> <div fxFlex="50%">
{{ chargeData.amountWaived }} {{ chargeData.amountWaived | number }}
</div> </div>
<div fxFlex="50%" class="mat-body-strong"> <div fxFlex="50%" class="mat-body-strong">
@@ -115,11 +115,14 @@
</div> </div>
<div fxFlex="50%"> <div fxFlex="50%">
{{ chargeData.amountOutstanding }} {{ chargeData.amountOutstanding | number }}
</div> </div>
</div> </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-content>
</mat-card> </mat-card>
+116 -155
View File
@@ -59,82 +59,16 @@ const routes: Routes = [
{ {
path: ':savingAccountId', path: ':savingAccountId',
data: { title: extract('Saving Account View'), routeParamBreadcrumb: 'savingAccountId' }, data: { title: extract('Saving Account View'), routeParamBreadcrumb: 'savingAccountId' },
component: SavingsAccountViewComponent,
resolve: {
savingsAccountData: SavingsAccountViewResolver,
savingsDatatables: SavingsDatatablesResolver
},
children: [ children: [
{ {
path: '', path: '',
component: SavingsAccountViewComponent, redirectTo: 'transactions',
resolve: { pathMatch: 'full'
savingsAccountData: SavingsAccountViewResolver,
savingsDatatables: SavingsDatatablesResolver
},
children: [
{
path: '',
redirectTo: 'transactions',
pathMatch: 'full'
},
{
path: 'transactions',
data: { title: extract('Savings Account Transactions'), breadcrumb: 'Transactions', routeParamBreadcrumb: false },
children: [
{
path: '',
component: TransactionsTabComponent
},
{
path: 'export',
component: ExportTransactionsComponent
}
]
},
{
path: 'charges',
component: ChargesTabComponent,
data: { title: extract('Savings Account Charges'), breadcrumb: 'Charges', routeParamBreadcrumb: false }
},
{
path: 'standing-instructions',
component: StandingInstructionsTabComponent,
data: { title: extract('Savings Account SIH'), breadcrumb: 'Standing Instructions', routeParamBreadcrumb: false }
},
{
path: 'notes',
component: NotesTabComponent,
data: { title: extract('Savings Account Notes'), breadcrumb: 'Notes', routeParamBreadcrumb: false },
resolve: {
savingAccountNotes: SavingNotesResolver
}
},
{
path: 'documents',
component: SavingsDocumentsTabComponent,
data: { title: extract('Savings Account Documents'), breadcrumb: 'Documents', routeParamBreadcrumb: false },
resolve: {
savingsDocuments: SavingDocumentsResolver
}
},
{
path: 'datatables',
children: [
{
path: ':datatableName',
component: DatatableTabsComponent,
data: { title: extract('View Data Table'), routeParamBreadcrumb: 'datatableName' },
resolve: {
savingsDatatable: SavingsDatatableResolver
}
}
]
}
]
},
{
path: 'edit',
data: { title: extract('Edit Savings Account'), breadcrumb: 'Edit', routeParamBreadcrumb: false },
component: EditSavingsAccountComponent,
resolve: {
savingsAccountAndTemplate: SavingsAccountAndTemplateResolver
}
}, },
{ {
path: 'transactions', path: 'transactions',
@@ -142,102 +76,129 @@ const routes: Routes = [
children: [ children: [
{ {
path: '', path: '',
redirectTo: '../transactions', pathMatch: 'prefix' component: TransactionsTabComponent
}, },
{ {
path: 'account-transfers', path: 'export',
loadChildren: () => import('../account-transfers/account-transfers.module').then(m => m.AccountTransfersModule) component: ExportTransactionsComponent
},
{
path: ':id',
data: { routeParamBreadcrumb: 'id' },
children: [
{
path: '',
component: ViewTransactionComponent,
resolve: {
savingsAccountTransaction: SavingsAccountTransactionResolver
}
},
{
path: 'edit',
component: EditTransactionComponent,
data: { breadcrumb: 'Edit', routeParamBreadcrumb: false },
resolve: {
savingsAccountTransactionTemplate: SavingsAccountTransactionTemplateResolver
}
},
{
path: 'reciept',
component: ViewRecieptComponent,
data: { breadcrumb: 'Reciept', routeParamBreadcrumb: false },
resolve: {
savingsTransactionReciept: SavingsTransactionRecieptResolver
}
}
]
} }
] ]
}, },
{ {
path: 'charges', path: 'charges',
data: { title: extract('Savings Account Charges'), breadcrumb: 'Charges', routeParamBreadcrumb: false }, component: ChargesTabComponent,
children: [ data: { title: extract('Savings Account Charges'), breadcrumb: 'Charges', routeParamBreadcrumb: false }
{
path: '',
redirectTo: '../charges', pathMatch: 'prefix'
},
{
path: ':id',
data: { routeParamBreadcrumb: 'id' },
component: ViewChargeComponent,
resolve: {
savingsAccountData: SavingsAccountViewResolver,
savingsAccountCharge: SavingsAccountChargeResolver
}
}
]
}, },
{ {
path: 'actions/:name', path: 'standing-instructions',
data: { title: extract('Savings Account Actions'), breadcrumb: 'Savings Account Actions', routeParamBreadcrumb: 'name' }, component: StandingInstructionsTabComponent,
component: SavingAccountActionsComponent, data: { title: extract('Savings Account SIH'), breadcrumb: 'Standing Instructions', routeParamBreadcrumb: false }
},
{
path: 'notes',
component: NotesTabComponent,
data: { title: extract('Savings Account Notes'), breadcrumb: 'Notes', routeParamBreadcrumb: false },
resolve: { resolve: {
savingsAccountActionData: SavingsAccountActionsResolver savingAccountNotes: SavingNotesResolver
} }
}, },
{ {
path: 'documents', path: 'documents',
component: SavingsDocumentsTabComponent,
data: { title: extract('Savings Account Documents'), breadcrumb: 'Documents', routeParamBreadcrumb: false }, data: { title: extract('Savings Account Documents'), breadcrumb: 'Documents', routeParamBreadcrumb: false },
children: [ resolve: {
{ savingsDocuments: SavingDocumentsResolver
path: '', }
redirectTo: '../documents', pathMatch: 'prefix'
},
]
}, },
{ {
path: 'notes', path: 'datatables',
data: { title: extract('Savings Account Notes'), breadcrumb: 'Notes', routeParamBreadcrumb: false },
children: [ children: [
{ {
path: '', path: ':datatableName',
redirectTo: '../notes', pathMatch: 'prefix' component: DatatableTabsComponent,
}, data: { title: extract('View Data Table'), routeParamBreadcrumb: 'datatableName' },
resolve: {
savingsDatatable: SavingsDatatableResolver
}
}
] ]
},
{
path: 'transfer-funds',
loadChildren: () => import('../account-transfers/account-transfers.module').then(m => m.AccountTransfersModule)
} }
] ]
}, },
{
path: ':savingAccountId/edit',
data: { title: extract('Edit Savings Account'), breadcrumb: 'Edit', routeParamBreadcrumb: false },
component: EditSavingsAccountComponent,
resolve: {
savingsAccountAndTemplate: SavingsAccountAndTemplateResolver
}
},
{
path: ':savingAccountId/transactions/:id',
data: { title: extract('Savings Account Transactions'), breadcrumb: 'Transactions', routeParamBreadcrumb: false },
children: [
{
path: '',
component: ViewTransactionComponent,
resolve: {
savingsAccountTransaction: SavingsAccountTransactionResolver
}
},
{
path: 'edit',
component: EditTransactionComponent,
data: { breadcrumb: 'Edit', routeParamBreadcrumb: false },
resolve: {
savingsAccountTransactionTemplate: SavingsAccountTransactionTemplateResolver
}
},
{
path: 'reciept',
component: ViewRecieptComponent,
data: { breadcrumb: 'Reciept', routeParamBreadcrumb: false },
resolve: {
savingsTransactionReciept: SavingsTransactionRecieptResolver
}
}
]
},
{
path: ':savingAccountId/charges',
data: { title: extract('Savings Account Charges'), breadcrumb: 'Charges', routeParamBreadcrumb: false },
children: [
{
path: '',
redirectTo: '../charges', pathMatch: 'prefix'
},
{
path: ':id',
data: { routeParamBreadcrumb: 'id' },
component: ViewChargeComponent,
resolve: {
savingsAccountData: SavingsAccountViewResolver,
savingsAccountCharge: SavingsAccountChargeResolver
}
}
]
},
{
path: ':savingAccountId/actions/:name',
data: { title: extract('Savings Account Actions'), breadcrumb: 'Savings Account Actions', routeParamBreadcrumb: 'name' },
component: SavingAccountActionsComponent,
resolve: {
savingsAccountActionData: SavingsAccountActionsResolver
}
},
{
path: 'transfer-funds',
loadChildren: () => import('../account-transfers/account-transfers.module').then(m => m.AccountTransfersModule)
},
{ {
path: 'gsim-account', path: 'gsim-account',
children: [ children: [
{ {
path: 'create', path: 'create',
data: { title: extract('Create GSIM Application'), breadcrumb: 'Create GSIM Application'}, data: { title: extract('Create GSIM Application'), breadcrumb: 'Create GSIM Application' },
component: CreateGsimAccountComponent, component: CreateGsimAccountComponent,
resolve: { resolve: {
groupsData: GroupViewResolver, groupsData: GroupViewResolver,
@@ -246,7 +207,7 @@ const routes: Routes = [
}, },
{ {
path: ':savingAccountId', path: ':savingAccountId',
data: { title: extract('GSIM Account View'), routeParamBreadcrumb: 'savingAccountId'}, data: { title: extract('GSIM Account View'), routeParamBreadcrumb: 'savingAccountId' },
children: [ children: [
{ {
path: '', path: '',
@@ -269,17 +230,17 @@ const routes: Routes = [
exports: [RouterModule], exports: [RouterModule],
declarations: [], declarations: [],
providers: [SavingsAccountViewResolver, providers: [SavingsAccountViewResolver,
SavingsDatatablesResolver, SavingsDatatablesResolver,
SavingsDatatableResolver, SavingsDatatableResolver,
SavingsAccountTemplateResolver, SavingsAccountTemplateResolver,
SavingsAccountAndTemplateResolver, SavingsAccountAndTemplateResolver,
SavingsAccountTransactionResolver, SavingsAccountTransactionResolver,
SavingsAccountChargeResolver, SavingsAccountChargeResolver,
SavingsAccountActionsResolver, SavingsAccountActionsResolver,
SavingsTransactionRecieptResolver, SavingsTransactionRecieptResolver,
SavingsAccountTransactionTemplateResolver, SavingsAccountTransactionTemplateResolver,
GSIMAccountsResolver, GSIMAccountsResolver,
GroupAccountsResolver, GroupAccountsResolver,
GSIMViewResolver] GSIMViewResolver]
}) })
export class SavingsRoutingModule {} export class SavingsRoutingModule { }