Skip to content

Commit 9e6aae0

Browse files
author
Jose Alberto Hernandez
committed
Merge branch 'upstream_master' into advancly
2 parents be746a6 + f643b15 commit 9e6aae0

File tree

40 files changed

+433
-86
lines changed

40 files changed

+433
-86
lines changed

src/app/account-transfers/edit-standing-instructions/edit-standing-instructions.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class EditStandingInstructionsComponent implements OnInit {
3939
/** Minimum date allowed. */
4040
minDate = new Date(2000, 0, 1);
4141
/** Maximum date allowed. */
42-
maxDate = new Date(2100,0,1);
42+
maxDate = new Date(2100, 0, 1);
4343

4444
/**
4545
* Retrieves the standing instructions template from `resolve`.

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

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

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

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

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

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

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

503503
</table>
504504

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

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

531531
<!-- Shares overview Table -->

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

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

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

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

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

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

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

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

src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.html

+12
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,18 @@ <h3 class="mat-h3" fxFlexFill>Loan Schedule</h3>
356356
</span>
357357
</div>
358358

359+
<div fxFlexFill *ngIf="isAdvancedPaymentAllocation">
360+
<span fxFlex="47%">Advanced Credit Allocation Transactions:</span>
361+
<span fxFlex="53%">
362+
<mat-accordion>
363+
<mifosx-view-advance-paymeny-allocation *ngFor="let creditAllocation of creditAllocations"
364+
[creditAllocation]="creditAllocation"
365+
[advancePaymentAllocationData]="advancePaymentAllocationData">
366+
</mifosx-view-advance-paymeny-allocation>
367+
</mat-accordion>
368+
</span>
369+
</div>
370+
359371
<h3 class="mat-h3" fxFlexFill>Down Payments</h3>
360372

361373
<mat-divider [inset]="true"></mat-divider>

src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.ts

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
22
import { DelinquencyBucket, LoanProduct } from '../../models/loan-product.model';
33
import { AccountingMapping, Charge, ChargeToIncomeAccountMapping, GLAccount, PaymentChannelToFundSourceMapping, PaymentType, PaymentTypeOption } from '../../../../shared/models/general.model';
4-
import { AdvancePaymentAllocationData, PaymentAllocation } from '../../loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model';
4+
import { AdvancePaymentAllocationData, CreditAllocation, PaymentAllocation } from '../../loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model';
55
import { LoanProducts } from '../../loan-products';
66
import { CodeName, OptionData } from '../../../../shared/models/option-data.model';
77

@@ -17,6 +17,7 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges {
1717
@Input() loanProductsTemplate: any | null;
1818
@Input() useDueForRepaymentsConfigurations: boolean;
1919
@Input() paymentAllocations: PaymentAllocation | null;
20+
@Input() creditAllocations: CreditAllocation | null;
2021

2122
variationsDisplayedColumns: string[] = ['valueConditionType', 'borrowerCycleNumber', 'minValue', 'defaultValue', 'maxValue'];
2223
chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType'];
@@ -185,15 +186,23 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges {
185186
}
186187

187188
if (this.loanProduct.advancedPaymentAllocationTransactionTypes) {
189+
const advancedAllocationTransactionTypes: OptionData[] = this.loanProduct.advancedPaymentAllocationTransactionTypes
190+
.concat(this.loanProduct.creditAllocationTransactionTypes);
191+
const advancedPaymentAllocationTypes: OptionData[] = this.loanProduct.advancedPaymentAllocationTypes
192+
.concat(this.loanProduct.creditAllocationAllocationTypes);
188193
this.advancePaymentAllocationData = {
189-
transactionTypes: this.loanProduct.advancedPaymentAllocationTransactionTypes,
190-
allocationTypes: this.loanProduct.advancedPaymentAllocationTypes,
194+
transactionTypes: advancedAllocationTransactionTypes,
195+
allocationTypes: advancedPaymentAllocationTypes,
191196
futureInstallmentAllocationRules: this.loanProduct.advancedPaymentAllocationFutureInstallmentAllocationRules
192197
};
193198
} else {
199+
const advancedAllocationTransactionTypes: OptionData[] = this.loanProductsTemplate.advancedPaymentAllocationTransactionTypes
200+
.concat(this.loanProductsTemplate.creditAllocationTransactionTypes);
201+
const advancedPaymentAllocationTypes: OptionData[] = this.loanProductsTemplate.advancedPaymentAllocationTypes
202+
.concat(this.loanProductsTemplate.creditAllocationAllocationTypes);
194203
this.advancePaymentAllocationData = {
195-
transactionTypes: this.loanProductsTemplate.advancedPaymentAllocationTransactionTypes,
196-
allocationTypes: this.loanProductsTemplate.advancedPaymentAllocationTypes,
204+
transactionTypes: advancedAllocationTransactionTypes,
205+
allocationTypes: advancedPaymentAllocationTypes,
197206
futureInstallmentAllocationRules: this.loanProductsTemplate.advancedPaymentAllocationFutureInstallmentAllocationRules
198207
};
199208
}

src/app/products/loan-products/create-loan-product/create-loan-product.component.html

+4
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,13 @@
6565

6666
<mifosx-loan-product-payment-strategy-step
6767
[advancedPaymentAllocations]="advancedPaymentAllocations"
68+
[advancedCreditAllocations]="advancedCreditAllocations"
6869
[advancedPaymentAllocationTransactionTypes]="loanProductsTemplate.advancedPaymentAllocationTransactionTypes"
6970
[paymentAllocationOrderDefault]="loanProductsTemplate.advancedPaymentAllocationTypes"
71+
[advancedCreditAllocationTransactionTypes]="loanProductsTemplate.creditAllocationTransactionTypes"
72+
[creditAllocationOrderDefault]="loanProductsTemplate.creditAllocationAllocationTypes"
7073
(setPaymentAllocation)="setPaymentAllocation($event)"
74+
(setCreditAllocation)="setCreditAllocation($event)"
7175
>
7276
</mifosx-loan-product-payment-strategy-step>
7377

src/app/products/loan-products/create-loan-product/create-loan-product.component.ts

+7
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export class CreateLoanProductComponent implements OnInit {
3535

3636
isAdvancedPaymentStrategy = false;
3737
paymentAllocation: PaymentAllocation[] = [];
38+
creditAllocation: PaymentAllocation[] = [];
3839
advancedPaymentAllocations: AdvancedPaymentAllocation[] = [];
40+
advancedCreditAllocations: AdvancedPaymentAllocation[] = [];
3941

4042
/**
4143
* @param {ActivatedRoute} route Activated Route.
@@ -90,6 +92,10 @@ export class CreateLoanProductComponent implements OnInit {
9092
this.paymentAllocation = paymentAllocation;
9193
}
9294

95+
setCreditAllocation(paymentAllocation: PaymentAllocation[]): void {
96+
this.creditAllocation = paymentAllocation;
97+
}
98+
9399
get loanProductSettingsForm() {
94100
return this.loanProductSettingsStep.loanProductSettingsForm;
95101
}
@@ -119,6 +125,7 @@ export class CreateLoanProductComponent implements OnInit {
119125
};
120126
if (this.isAdvancedPaymentStrategy) {
121127
loanProduct['paymentAllocation'] = this.paymentAllocation;
128+
loanProduct['creditAllocation'] = this.creditAllocation;
122129
}
123130
return loanProduct;
124131
}

src/app/products/loan-products/edit-loan-product/edit-loan-product.component.html

+4
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,13 @@
6565

6666
<mifosx-loan-product-payment-strategy-step
6767
[advancedPaymentAllocations]="advancedPaymentAllocations"
68+
[advancedCreditAllocations]="advancedCreditAllocations"
6869
[advancedPaymentAllocationTransactionTypes]="loanProductAndTemplate.advancedPaymentAllocationTransactionTypes"
6970
[paymentAllocationOrderDefault]="loanProductAndTemplate.advancedPaymentAllocationTypes"
71+
[advancedCreditAllocationTransactionTypes]="loanProductAndTemplate.creditAllocationTransactionTypes"
72+
[creditAllocationOrderDefault]="loanProductAndTemplate.creditAllocationAllocationTypes"
7073
(setPaymentAllocation)="setPaymentAllocation($event)"
74+
(setCreditAllocation)="setCreditAllocation($event)"
7175
>
7276
</mifosx-loan-product-payment-strategy-step>
7377

src/app/products/loan-products/edit-loan-product/edit-loan-product.component.ts

+13-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { LoanProductAccountingStepComponent } from '../loan-product-stepper/loan
1414
import { ProductsService } from 'app/products/products.service';
1515
import { GlobalConfiguration } from 'app/system/configurations/global-configurations-tab/configuration.model';
1616
import { LoanProducts } from '../loan-products';
17-
import { AdvancedPaymentAllocation, AdvancedPaymentStrategy, PaymentAllocation, PaymentAllocationOrder, PaymentAllocationTransactionTypes } from '../loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model';
17+
import { AdvancedPaymentAllocation, AdvancedPaymentStrategy, CreditAllocation, PaymentAllocation, PaymentAllocationOrder, PaymentAllocationTransactionTypes } from '../loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model';
1818

1919
@Component({
2020
selector: 'mifosx-edit-loan-product',
@@ -37,7 +37,9 @@ export class EditLoanProductComponent implements OnInit {
3737
isAdvancedPaymentStrategy = false;
3838
wasPaymentAllocationChanged = false;
3939
paymentAllocation: PaymentAllocation[] = [];
40+
creditAllocation: CreditAllocation[] = [];
4041
advancedPaymentAllocations: AdvancedPaymentAllocation[] = [];
42+
advancedCreditAllocations: AdvancedPaymentAllocation[] = [];
4143

4244
/**
4345
* @param {ActivatedRoute} route Activated Route.
@@ -68,6 +70,7 @@ export class EditLoanProductComponent implements OnInit {
6870
this.advancePaymentStrategy(this.loanProductAndTemplate.transactionProcessingStrategyCode);
6971
if (this.isAdvancedPaymentStrategy) {
7072
this.paymentAllocation = this.loanProductAndTemplate.paymentAllocation;
73+
this.creditAllocation = this.loanProductAndTemplate.creditAllocation;
7174
}
7275
}
7376

@@ -93,13 +96,20 @@ export class EditLoanProductComponent implements OnInit {
9396

9497
buildAdvancedPaymentAllocation(): void {
9598
this.advancedPaymentAllocations = this.advancedPaymentStrategy.buildAdvancedPaymentAllocationList(this.loanProductAndTemplate);
99+
this.advancedCreditAllocations = this.advancedPaymentStrategy.buildAdvancedCreditAllocationList(this.loanProductAndTemplate);
100+
console.log(this.advancedCreditAllocations);
96101
}
97102

98103
setPaymentAllocation(paymentAllocation: PaymentAllocation[]): void {
99104
this.paymentAllocation = paymentAllocation;
100105
this.wasPaymentAllocationChanged = true;
101106
}
102107

108+
setCreditAllocation(creditAllocation: CreditAllocation[]): void {
109+
this.creditAllocation = creditAllocation;
110+
this.wasPaymentAllocationChanged = true;
111+
}
112+
103113
paymentAllocationChanged(value: boolean): void {
104114
this.wasPaymentAllocationChanged = value;
105115
}
@@ -138,8 +148,10 @@ export class EditLoanProductComponent implements OnInit {
138148
};
139149
// Default empty array
140150
loanProduct['paymentAllocation'] = [];
151+
loanProduct['creditAllocation'] = [];
141152
if (this.isAdvancedPaymentStrategy) {
142153
loanProduct['paymentAllocation'] = this.paymentAllocation;
154+
loanProduct['creditAllocation'] = this.creditAllocation;
143155
}
144156
return loanProduct;
145157
}

src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/advance-payment-allocation-tab/advance-payment-allocation-tab.component.html

+33-7
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ <h4 class="m-b-15 right" fxFlex="90%">You can drag and drop the rows to set a Pa
88
</button>
99
</div>
1010

11-
<div class="mat-elevation-z8 container m-t-15">
11+
<div class="mat-elevation-z8 container m-t-15" *ngIf="paymentAllocationsData">
1212
<table mat-table [dataSource]="paymentAllocationsData" #table cdkDropList
13-
[cdkDropListData]="paymentAllocationsData" (cdkDropListDropped)="dropTable($event)">
13+
[cdkDropListData]="paymentAllocationsData" (cdkDropListDropped)="dropTable($event, false)">
1414

1515
<ng-container matColumnDef="actions">
1616
<th mat-header-cell *matHeaderCellDef> </th>
@@ -20,12 +20,12 @@ <h4 class="m-b-15 right" fxFlex="90%">You can drag and drop the rows to set a Pa
2020
</ng-container>
2121

2222
<ng-container matColumnDef="order">
23-
<th mat-header-cell *matHeaderCellDef> Order </th>
23+
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Order' | translate }}</th>
2424
<td mat-cell *matCellDef="let paymentAllocation; let rowIndex = index"> {{ (rowIndex + 1) }} </td>
2525
</ng-container>
2626

2727
<ng-container matColumnDef="paymentAllocation">
28-
<th mat-header-cell *matHeaderCellDef> Payment Allocation </th>
28+
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Payment Allocation' | translate }}</th>
2929
<td mat-cell *matCellDef="let paymentAllocation"> {{ paymentAllocation.value }} </td>
3030
</ng-container>
3131

@@ -34,12 +34,38 @@ <h4 class="m-b-15 right" fxFlex="90%">You can drag and drop the rows to set a Pa
3434
</table>
3535
</div>
3636

37-
<mat-form-field fxFlex="33%" class="m-t-20">
38-
<mat-label>Future Installment Allocation Rule</mat-label>
37+
<div class="mat-elevation-z8 container m-t-15" *ngIf="creditAllocationsData">
38+
<table mat-table [dataSource]="creditAllocationsData" #table cdkDropList
39+
[cdkDropListData]="creditAllocationsData" (cdkDropListDropped)="dropTable($event, true)">
40+
41+
<ng-container matColumnDef="actions">
42+
<th mat-header-cell *matHeaderCellDef> </th>
43+
<td mat-cell *matCellDef="let creditAllocation">
44+
<fa-icon icon="bars"></fa-icon>
45+
</td>
46+
</ng-container>
47+
48+
<ng-container matColumnDef="order">
49+
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Order' | translate }}</th>
50+
<td mat-cell *matCellDef="let creditAllocation; let rowIndex = index"> {{ (rowIndex + 1) }} </td>
51+
</ng-container>
52+
53+
<ng-container matColumnDef="paymentAllocation">
54+
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Payment Allocation' | translate }}</th>
55+
<td mat-cell *matCellDef="let creditAllocation"> {{ creditAllocation.value }} </td>
56+
</ng-container>
57+
58+
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
59+
<tr mat-row cdkDrag [cdkDragData]="row" *matRowDef="let row; columns: displayedColumns;"></tr>
60+
</table>
61+
</div>
62+
63+
<mat-form-field fxFlex="33%" class="m-t-20" *ngIf="advancedPaymentAllocation && advancedPaymentAllocation.futureInstallmentAllocationRules">
64+
<mat-label>{{ 'labels.inputs.Future Installment Allocation Rule' | translate }}</mat-label>
3965
<mat-select [formControl]="futureInstallmentAllocationRule">
4066
<mat-option *ngFor="let futureInstallmentAllocationRule of advancedPaymentAllocation.futureInstallmentAllocationRules"
4167
[value]="futureInstallmentAllocationRule.code">
42-
{{ futureInstallmentAllocationRule.value | translate}}
68+
{{ futureInstallmentAllocationRule.value | translate }}
4369
</mat-option>
4470
</mat-select>
4571
</mat-form-field>

0 commit comments

Comments
 (0)