WEB-455: add full term tranches configuration
This commit is contained in:
+9
@@ -487,6 +487,15 @@
|
||||
<div class="flex-100 layout-row" *ngIf="allowAddDisbursementDetails()">
|
||||
<h4 class="mat-h4 flex-98">{{ 'labels.heading.Loan Tranche Details' | translate }}</h4>
|
||||
</div>
|
||||
<mat-checkbox
|
||||
*ngIf="isFullTermTrancheEditable()"
|
||||
class="flex-48 margin-v"
|
||||
labelPosition="before"
|
||||
formControlName="allowFullTermForTranche"
|
||||
matTooltip="{{ 'tooltips.Allow full term length for each tranche disbursement' | translate }}"
|
||||
>
|
||||
{{ 'labels.inputs.Allow full term for each tranche' | translate }}
|
||||
</mat-checkbox>
|
||||
<div class="flex-100 layout-row">
|
||||
<mat-form-field class="flex-48">
|
||||
<mat-label>{{ 'labels.inputs.Maximum allowed outstanding balance' | translate }}</mat-label>
|
||||
|
||||
+16
-1
@@ -255,6 +255,12 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
|
||||
this.loansAccountTermsForm.addControl('enableDownPayment', new UntypedFormControl(enableDownPayment));
|
||||
}
|
||||
|
||||
if (this.isFullTermTrancheEditable()) {
|
||||
const allowFullTermForTranche =
|
||||
this.loansAccountTermsData.allowFullTermForTranche ?? this.loanProduct?.allowFullTermForTranche ?? false;
|
||||
this.loansAccountTermsForm.patchValue({ allowFullTermForTranche });
|
||||
}
|
||||
|
||||
const allowAttributeOverrides = this.loansAccountTermsData.product.allowAttributeOverrides;
|
||||
if (!allowAttributeOverrides.repaymentEvery) {
|
||||
this.loansAccountTermsForm.controls.repaymentEvery.disable();
|
||||
@@ -517,7 +523,8 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
|
||||
multiDisburseLoan: [false],
|
||||
interestRateFrequencyType: [''],
|
||||
balloonRepaymentAmount: [''],
|
||||
interestRecognitionOnDisbursementDate: [false]
|
||||
interestRecognitionOnDisbursementDate: [false],
|
||||
allowFullTermForTranche: [false]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -700,4 +707,12 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
|
||||
collateral: this.collateralDataSource
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if full term tranche option should be editable at loan level.
|
||||
* Only available if the loan product has it enabled and is PROGRESSIVE schedule type.
|
||||
*/
|
||||
isFullTermTrancheEditable(): boolean {
|
||||
return this.isProgressive && this.loanProduct?.allowFullTermForTranche === true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user