Merge pull request #2853 from budaidev/WEB-455/full-term-tranches-configuration

WEB-455: add full term tranches configuration
This commit is contained in:
Jose Alberto Hernandez
2025-12-04 12:56:48 -05:00
committed by GitHub
8 changed files with 53 additions and 3 deletions
@@ -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>
@@ -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;
}
}
@@ -4,6 +4,11 @@
<span class="flex-60">{{ loanDetails.maxOutstandingLoanBalance | formatNumber }}</span>
</div>
<div class="flex-fill" *ngIf="loanDetails.allowFullTermForTranche">
<span class="flex-40">{{ 'labels.inputs.Allow full term for each tranche' | translate }}:</span>
<span class="flex-60">{{ loanDetails.allowFullTermForTranche | yesNo }}</span>
</div>
<h3>{{ 'labels.heading.Loan Tranche Details' | translate }}</h3>
<div class="layout-row margin-t layout-xs-column layout-align-end gap-2percent">
@@ -27,6 +27,7 @@ import {
import { MatTooltip } from '@angular/material/tooltip';
import { DateFormatPipe } from '../../../pipes/date-format.pipe';
import { FormatNumberPipe } from '../../../pipes/format-number.pipe';
import { YesnoPipe } from '../../../pipes/yesno.pipe';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
@Component({
@@ -49,7 +50,8 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
MatRowDef,
MatRow,
DateFormatPipe,
FormatNumberPipe
FormatNumberPipe,
YesnoPipe
]
})
export class LoanTrancheDetailsComponent implements OnInit {
@@ -157,6 +157,16 @@
<mat-checkbox class="flex-48 margin-v" labelPosition="before" formControlName="disallowExpectedDisbursements">
{{ 'labels.inputs.Disallow Expected Disbursements' | translate }}
</mat-checkbox>
<mat-checkbox
*ngIf="loanProductSettingsForm.value.loanScheduleType === 'PROGRESSIVE'"
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>
<h3 class="mat-h3 flex-96">{{ 'labels.heading.Down Payment' | translate }}</h3>
@@ -146,6 +146,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
multiDisburseLoan: this.loanProductsTemplate.multiDisburseLoan,
maxTrancheCount: this.loanProductsTemplate.maxTrancheCount,
outstandingLoanBalance: this.loanProductsTemplate.outstandingLoanBalance,
allowFullTermForTranche: this.loanProductsTemplate.allowFullTermForTranche,
enableDownPayment: this.loanProductsTemplate.enableDownPayment,
enableInstallmentLevelDelinquency: this.loanProductsTemplate.enableInstallmentLevelDelinquency,
loanScheduleType: this.loanProductsTemplate.loanScheduleType.code,
@@ -314,6 +315,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
isInterestRecalculationEnabled: [false],
holdGuaranteeFunds: [false],
multiDisburseLoan: [false],
allowFullTermForTranche: [false],
allowAttributeConfiguration: [true],
allowPartialPeriodInterestCalculation: [false],
allowAttributeOverrides: this.formBuilder.group({
@@ -553,7 +555,10 @@ export class LoanProductSettingsStepComponent implements OnInit {
} else {
this.loanProductSettingsForm.removeControl('maxTrancheCount');
this.loanProductSettingsForm.removeControl('outstandingLoanBalance');
this.loanProductSettingsForm.patchValue({ disallowExpectedDisbursements: false });
this.loanProductSettingsForm.patchValue({
disallowExpectedDisbursements: false,
allowFullTermForTranche: false
});
}
});
@@ -646,6 +651,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
this.advancedTransactionProcessingStrategyDisabled = false;
this.isAdvancedTransactionProcessingStrategy = false;
this.loanProductSettingsForm.removeControl('chargeOffBehaviour');
this.loanProductSettingsForm.patchValue({ allowFullTermForTranche: false });
} else {
// Only Advanced Payment Allocation Strategy
this.transactionProcessingStrategyDataBase.some((cn: CodeName) => {
@@ -97,6 +97,7 @@ export interface LoanProduct {
creditAllocationAllocationTypes: OptionData[];
multiDisburseLoan: boolean;
maxTrancheCount: number;
allowFullTermForTranche: boolean;
disallowExpectedDisbursements: boolean;
allowApprovedDisbursedAmountsOverApplied: boolean;
overAppliedNumber: number;
+2
View File
@@ -1599,6 +1599,7 @@
"Enable Dormancy Tracking": "Enable Dormancy Tracking",
"Enable Down Payment": "Enable Down Payment",
"Enable Multiple Disbursals": "Enable Multiple Disbursals",
"Allow full term for each tranche": "Allow full term for each tranche",
"Enabled": "Enabled",
"End Date": "End Date",
"End Point": "End Point",
@@ -3566,6 +3567,7 @@
"Keyboard Shortcuts": "Keyboard Shortcuts",
"Leave this checkbox checked if the loan has Down Payment": "Leave this checkbox checked if the loan has Down Payment, A Down Payment is a sum a buyer pays upfront when purchasing a good. It represents a percentage of the total purchase price, and the balance is usually financed",
"Leave this checkbox unchecked": "Leave this checkbox unchecked if the loan is a single disburse loan. Check this checkbox if the loan is a multi disburse loan. See additional fields for additional information required for this type of loan.",
"Allow full term length for each tranche disbursement": "When enabled, each tranche disbursement will follow the full loan term schedule instead of fitting within the remaining term. Only available for PROGRESSIVE loan schedule type.",
"Loan Account": "Loan Account",
"Loan Product can be used to apply for Topup Loans": "If selected, the Loan Product can be used to apply for Top Up Loans.",
"Loan products may be assigned": "Loan products may be assigned to a fund set up by your financial institution. If available, the fund field can be used for tracking and reporting on groups of loans.",