Add Auto Repayment flag for Loan product Down Payment settings (#1845)

Co-authored-by: Jose Alberto Hernandez <alberto@blue-daemon.local>
This commit is contained in:
José Alberto Hernández
2023-08-16 22:24:22 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent ed47d769e3
commit 0c88a37952
2 changed files with 9 additions and 1 deletions
@@ -434,6 +434,11 @@
Disbursed Amount Percentage Down Payment is out <strong>percentage range</strong>
</mat-error>
</mat-form-field>
<mat-checkbox fxFlex="48%" labelPosition="before" formControlName="enableAutoRepaymentForDownPayment" matTooltip="nable or disable the auto repayment of down-payment.
When “auto repayment for the down-payments“ is enabled, the disbursements will trigger an auto down payment transaction for the down payment amount" class="margin-b">
Enable Auto Repayment for Down Payment
</mat-checkbox>
</div>
<mat-divider fxFlex="98%"></mat-divider>
@@ -102,7 +102,8 @@ export class LoanProductSettingsStepComponent implements OnInit {
if (this.loanProductsTemplate.enableDownPayment) {
this.loanProductSettingsForm.patchValue({
'disbursedAmountPercentageForDownPayment': this.loanProductsTemplate.disbursedAmountPercentageForDownPayment || 0
'disbursedAmountPercentageForDownPayment': this.loanProductsTemplate.disbursedAmountPercentageForDownPayment || 0,
'enableAutoRepaymentForDownPayment': this.loanProductsTemplate.enableAutoRepaymentForDownPayment || false
});
}
@@ -345,8 +346,10 @@ export class LoanProductSettingsStepComponent implements OnInit {
.subscribe(enableDownPayment => {
if (enableDownPayment) {
this.loanProductSettingsForm.addControl('disbursedAmountPercentageForDownPayment', new FormControl(0, [Validators.required, rangeValidator(0, 100) ]));
this.loanProductSettingsForm.addControl('enableAutoRepaymentForDownPayment', new FormControl(false, []));
} else {
this.loanProductSettingsForm.removeControl('disbursedAmountPercentageForDownPayment');
this.loanProductSettingsForm.removeControl('enableAutoRepaymentForDownPayment');
}
});