Skip to content

Commit

Permalink
Add loan charge-off behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
magyari-adam authored and alberto-art3ch committed Nov 28, 2024
1 parent 497fc3b commit fb692d4
Show file tree
Hide file tree
Showing 18 changed files with 102 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ <h3> {{"labels.heading.Loan Details" | translate}} </h3>
<span fxFlex="50%">{{ loanDetails.enableDownPayment | yesNo }}</span>
</div>

<div fxFlexFill>
<span fxFlex="50%">{{ 'labels.inputs.Loan Charge-off behaviour' | translate}}:</span>
<span fxFlex="50%">{{ loanDetails.chargeOffBehaviour.value | translateKey: 'catalogs' }}</span>
</div>

<div fxFlexFill>
<span fxFlex="50%"> {{"labels.inputs.Grace: On Principal Payment" | translate}}</span>
<span fxFlex="50%"> {{loanDetails.graceOnPrincipalPayment}} </span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,17 @@ <h3 class="mat-h3" fxFlexFill>{{ 'labels.inputs.Down Payments' | translate}}</h3
<span fxFlex="53%">{{ loanProduct.enableAutoRepaymentForDownPayment | yesNo }}</span>
</div>

<div fxFlexFill *ngIf="isAdvancedPaymentAllocation" fxLayout="row wrap" fxLayout.lt-md="column">
<h3 class="mat-h3" fxFlexFill>{{ 'labels.inputs.Loan Charge-off behaviour' | translate}}</h3>

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

<div fxFlexFill>
<span fxFlex="47%">{{ 'labels.inputs.Loan Charge-off behaviour' | translate}}:</span>
<span fxFlex="53%">{{ loanProduct.chargeOffBehaviour.value | translateKey:'catalogs' }}</span>
</div>
</div>

<h3 class="mat-h3" fxFlexFill>{{ 'labels.heading.Moratorium' | translate}}</h3>

<div fxFlexFill *ngIf="loanProduct.delinquencyBucket">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges {
this.loanProduct.loanScheduleProcessingType = this.optionDataLookUpByCode(this.loanProduct.loanScheduleProcessingType,
this.loanProductsTemplate.loanScheduleProcessingTypeOptions);
}
if (!this.loanProduct.chargeOffBehaviour.value) {
this.loanProduct.chargeOffBehaviour = this.stringEnumOptionDataLookUp(this.loanProduct.chargeOffBehaviour, this.loanProductsTemplate.chargeOffBehaviourOptions);
}
}
}

Expand Down Expand Up @@ -242,6 +245,20 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges {
return optionData;
}

stringEnumOptionDataLookUp(itemId: any, optionsData: any[]): StringEnumOptionData {
let optionData: StringEnumOptionData | null;
optionsData.some((o: any) => {
if (o.id === itemId) {
optionData = {
id: o.id,
code: o.code,
value: o.value
};
}
});
return optionData;
}

optionDataLookUpByCode(currentValue: any, optionsData: any[]): OptionData {
let optionData: OptionData | null;
optionsData.some((o: any) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,19 @@ <h3 fxFlex="96%" class="mat-h3">{{'labels.heading.Down Payment' | translate}}</h

<span fxFlex="48%" fxHide.lt-md></span>

<div *ngIf="isAdvancedTransactionProcessingStrategy" fxFlexFill fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<h3 fxFlex="98%" class="mat-h4">{{'labels.inputs.Loan Charge-off behaviour' | translate}}</h3>

<mat-form-field fxFlex="30%">
<mat-label>{{'labels.inputs.Loan Charge-off behaviour' | translate}}</mat-label>
<mat-select formControlName="chargeOffBehaviour" required>
<mat-option *ngFor="let chargeOffBehaviour of chargeOffBehaviourData" [value]="chargeOffBehaviour.id">
{{ chargeOffBehaviour.value | translateKey:'catalogs' }}
</mat-option>
</mat-select>
</mat-form-field>
</div>

<h4 fxFlex="98%" class="mat-h4 m-r-10">{{'labels.inputs.Moratorium' | translate}} <i class="fas fa-question" matTooltip="{{ 'tooltips.The moratorium information' | translate}}"></i></h4>

<mat-form-field fxFlex="48%">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { UntypedFormGroup, UntypedFormBuilder, Validators, UntypedFormControl }
import { LoanProducts } from '../../loan-products';
import { rangeValidator } from 'app/shared/validators/percentage.validator';
import { GlobalConfiguration } from 'app/system/configurations/global-configurations-tab/configuration.model';
import { CodeName, OptionData } from 'app/shared/models/option-data.model';
import { CodeName, OptionData, StringEnumOptionData } from 'app/shared/models/option-data.model';
import { ProcessingStrategyService } from '../../services/processing-strategy.service';


Expand Down Expand Up @@ -46,6 +46,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
advancedTransactionProcessingStrategyDisabled = true;
useDueForRepaymentsConfigurations = false;
rescheduleStrategyTypeDisabled = false;
chargeOffBehaviourData: StringEnumOptionData[] = [];

/** Values to Days for Repayments */
defaultConfigValues: GlobalConfiguration[] = [];
Expand Down Expand Up @@ -85,6 +86,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
this.delinquencyBucketData = this.loanProductsTemplate.delinquencyBucketOptions;
this.loanScheduleTypeData = this.loanProductsTemplate.loanScheduleTypeOptions;
this.loanScheduleProcessingTypeData = this.loanProductsTemplate.loanScheduleProcessingTypeOptions;
this.chargeOffBehaviourData = this.loanProductsTemplate.chargeOffBehaviourOptions;

// this.useDueForRepaymentsConfigurations = (!this.loanProduct.dueDaysForRepaymentEvent && !this.loanProduct.overDueDaysForRepaymentEvent);

Expand Down Expand Up @@ -121,7 +123,8 @@ export class LoanProductSettingsStepComponent implements OnInit {
'enableInstallmentLevelDelinquency': this.loanProductsTemplate.enableInstallmentLevelDelinquency,
'loanScheduleType': this.loanProductsTemplate.loanScheduleType.code,
'useDueForRepaymentsConfigurations': this.loanProductsTemplate.useDueForRepaymentsConfigurations,
'allowAccrualPostingInArrears': this.loanProductsTemplate.allowAccrualPostingInArrears
'allowAccrualPostingInArrears': this.loanProductsTemplate.allowAccrualPostingInArrears,
'chargeOffBehaviour': this.loanProductsTemplate.chargeOffBehaviour.id
});

this.isAdvancedTransactionProcessingStrategy = LoanProducts.isAdvancedPaymentAllocationStrategy(transactionProcessingStrategyCode);
Expand Down Expand Up @@ -474,6 +477,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
}
this.advancedTransactionProcessingStrategyDisabled = false;
this.isAdvancedTransactionProcessingStrategy = false;
this.loanProductSettingsForm.removeControl('chargeOffBehaviour');
} else {
// Only Advanced Payment Allocation Strategy
this.transactionProcessingStrategyDataBase.some(
Expand All @@ -487,6 +491,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
'transactionProcessingStrategyCode': this.transactionProcessingStrategyData[0].code
});
this.isAdvancedTransactionProcessingStrategy = true;
this.loanProductSettingsForm.addControl('chargeOffBehaviour', new UntypedFormControl(this.loanProductsTemplate.chargeOffBehaviour.id));
}
if (this.loanProductSettingsForm.value.isInterestRecalculationEnabled) {
this.setRescheduleStrategies();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export interface LoanProduct {
chargeOffReasonToGLAccountMappings?: ChargeOffReasonsToGLAccountMapping[];
enableAccrualActivityPosting?: boolean;
supportedInterestRefundTypes?: StringEnumOptionData[];
chargeOffBehaviour?: StringEnumOptionData;
}


Expand Down
5 changes: 4 additions & 1 deletion src/assets/translations/cs-CS.json
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,9 @@
"Add periodic accrual entries": "Přidejte pravidelné položky časového rozlišení",
"Accrual Activity Posting on Installment Due Date": "Účtování akruální činnosti v den splatnosti splátky",
"Check loan repayment due": "Zkontrolujte splatnost půjčky",
"Transfer to Savings": "Převod do Úspory"
"Transfer to Savings": "Převod do Úspory",
"Zero interest after charge-off": "Nulový úrok po nabití",
"Accelerate maturity to charge-off date": "Urychlete splatnost do data odúčtování"
},
"commons": {
"50 characters long": "50 znaků dlouhé",
Expand Down Expand Up @@ -1791,6 +1793,7 @@
"Loan Amount and Balance": "Výše a zůstatek půjčky",
"Loan Approval": "Schválení půjčky",
"Loan Balance": "Zůstatek půjčky",
"Loan Charge-off behaviour": "Chování při odúčtování půjčky",
"Loan Collateral Details": "Podrobnosti o zajištění úvěru",
"Loan Cycle": "Úvěrový cyklus",
"Loan Disbursal": "Vyplacení půjčky",
Expand Down
5 changes: 4 additions & 1 deletion src/assets/translations/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,9 @@
"Add periodic accrual entries": "Fügen Sie periodische Abgrenzungsposten hinzu",
"Accrual Activity Posting on Installment Due Date": "Buchung der Abgrenzungsaktivität am Fälligkeitsdatum der Rate",
"Check loan repayment due": "Prüfen Sie, ob die Kreditrückzahlung fällig ist",
"Transfer to Savings": "Übertragen auf Ersparnisse"
"Transfer to Savings": "Übertragen auf Ersparnisse",
"Zero interest after charge-off": "Null Zinsen nach Abschreibung",
"Accelerate maturity to charge-off date": "Fälligkeit bis zum Abschreibungsdatum beschleunigen"
},
"commons": {
"50 characters long": "50 Zeichen lang",
Expand Down Expand Up @@ -1791,6 +1793,7 @@
"Loan Amount and Balance": "Kreditbetrag und Saldo",
"Loan Approval": "Kreditgenehmigung",
"Loan Balance": "Kreditsaldo",
"Loan Charge-off behaviour": "Kreditabschreibungsverhalten",
"Loan Collateral Details": "Details zur Kreditsicherheit",
"Loan Cycle": "Kreditzyklus",
"Loan Disbursal": "Kreditauszahlung",
Expand Down
5 changes: 4 additions & 1 deletion src/assets/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,9 @@
"Add periodic accrual entries": "Add periodic accrual entries",
"Accrual Activity Posting on Installment Due Date": "Accrual Activity Posting on Installment Due Date",
"Check loan repayment due": "Check loan repayment due",
"Transfer to Savings": "Transfer to Savings"
"Transfer to Savings": "Transfer to Savings",
"Zero interest after charge-off": "Zero interest after charge-off",
"Accelerate maturity to charge-off date": "Accelerate maturity to charge-off date"
},
"commons": {
"50 characters long": "50 characters long",
Expand Down Expand Up @@ -1792,6 +1794,7 @@
"Loan Amount and Balance": "Loan Amount and Balance",
"Loan Approval": "Loan Approval",
"Loan Balance": "Loan Balance",
"Loan Charge-off behaviour": "Loan Charge-off behaviour",
"Loan Collateral Details": "Loan Collateral Details",
"Loan Cycle": "Loan Cycle",
"Loan Disbursal": "Loan Disbursal",
Expand Down
5 changes: 4 additions & 1 deletion src/assets/translations/es-MX.json
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,9 @@
"Add periodic accrual entries": "Agregar entradas de devengo periódico",
"Accrual Activity Posting on Installment Due Date": "Contabilización de devengo acumulado en la fecha de vencimiento del pago",
"Check loan repayment due": "Verificar pagos a vencer de préstamos",
"Transfer to Savings": "Transferir a Ahorros"
"Transfer to Savings": "Transferir a Ahorros",
"Zero interest after charge-off": "Cero intereses después de la cancelación",
"Accelerate maturity to charge-off date": "Acelerar el vencimiento hasta la fecha de amortización"
},
"commons": {
"50 characters long": "50 caracteres de largo",
Expand Down Expand Up @@ -1789,6 +1791,7 @@
"Loan Amount and Balance": "Monto y saldo del Crédito",
"Loan Approval": "Aprobación de Crédito",
"Loan Balance": "Balance de Crédito",
"Loan Charge-off behaviour": "Comportamiento de cancelación de préstamos",
"Loan Collateral Details": "Detalles de la garantía del Crédito",
"Loan Cycle": "Ciclo de Crédito",
"Loan Disbursal": "Desembolso del Crédito",
Expand Down
5 changes: 4 additions & 1 deletion src/assets/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,9 @@
"Add periodic accrual entries": "Ajouter des entrées de régularisation périodiques",
"Accrual Activity Posting on Installment Due Date": "Comptabilisation d'activité de régularisation à la date d'échéance du versement",
"Check loan repayment due": "Vérifier le remboursement du prêt dû",
"Transfer to Savings": "Transfert vers l'épargne"
"Transfer to Savings": "Transfert vers l'épargne",
"Zero interest after charge-off": "Zéro intérêt après radiation",
"Accelerate maturity to charge-off date": "Accélérer la maturité jusqu'à la date de radiation"
},
"commons": {
"50 characters long": "50 caractères",
Expand Down Expand Up @@ -1791,6 +1793,7 @@
"Loan Amount and Balance": "Montant et solde du prêt",
"Loan Approval": "Approbation du prêt",
"Loan Balance": "Solde du prêt",
"Loan Charge-off behaviour": "Comportement en matière de radiation de prêts",
"Loan Collateral Details": "Détails de la garantie de prêt",
"Loan Cycle": "Cycle de prêt",
"Loan Disbursal": "Décaissement du prêt",
Expand Down
5 changes: 4 additions & 1 deletion src/assets/translations/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,9 @@
"Add periodic accrual entries": "Aggiungere voci di competenza periodica",
"Accrual Activity Posting on Installment Due Date": "Registrazione dell'attività di competenza alla data di scadenza della rata",
"Check loan repayment due": "Controllare il rimborso del prestito in scadenza",
"Transfer to Savings": "Trasferimento al risparmio"
"Transfer to Savings": "Trasferimento al risparmio",
"Zero interest after charge-off": "Zero interessi dopo la cancellazione",
"Accelerate maturity to charge-off date": "Accelerare la scadenza alla data di cancellazione"
},
"commons": {
"50 characters long": "50 caratteri di lunghezza",
Expand Down Expand Up @@ -1791,6 +1793,7 @@
"Loan Amount and Balance": "Importo e saldo del prestito",
"Loan Approval": "Approvazione del prestito",
"Loan Balance": "Saldo del prestito",
"Loan Charge-off behaviour": "Comportamento di cancellazione del prestito",
"Loan Collateral Details": "Dettagli della garanzia del prestito",
"Loan Cycle": "Ciclo del prestito",
"Loan Disbursal": "Erogazione del prestito",
Expand Down
5 changes: 4 additions & 1 deletion src/assets/translations/ko-KO.json
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,9 @@
"Add periodic accrual entries": "정기 발생 항목 추가",
"Accrual Activity Posting on Installment Due Date": "할부 만기일에 대한 발생 활동 전기",
"Check loan repayment due": "대출 상환 기한 확인",
"Transfer to Savings": "저축으로 이체"
"Transfer to Savings": "저축으로 이체",
"Zero interest after charge-off": "대손충당 후 이자 없음",
"Accelerate maturity to charge-off date": "만기일을 대금상환일로 앞당기세요"
},
"commons": {
"50 characters long": "50자(영문 기준)",
Expand Down Expand Up @@ -1792,6 +1794,7 @@
"Loan Amount and Balance": "대출금액 및 잔액",
"Loan Approval": "대출 승인",
"Loan Balance": "대출 잔액",
"Loan Charge-off behaviour": "대출 상환 거부 행동",
"Loan Collateral Details": "대출 담보 세부정보",
"Loan Cycle": "대출주기",
"Loan Disbursal": "대출금 지급",
Expand Down
5 changes: 4 additions & 1 deletion src/assets/translations/lt-LT.json
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,9 @@
"Add periodic accrual entries": "Pridėkite periodinius kaupimo įrašus",
"Accrual Activity Posting on Installment Due Date": "Kaupimo veiklos registravimas įmokos mokėjimo dieną",
"Check loan repayment due": "Patikrinkite paskolos grąžinimo terminą",
"Transfer to Savings": "Perkėlimas į santaupas"
"Transfer to Savings": "Perkėlimas į santaupas",
"Zero interest after charge-off": "Nulinės palūkanos po apmokestinimo",
"Accelerate maturity to charge-off date": "Paspartinkite terminą iki nurašymo datos"
},
"commons": {
"50 characters long": "50 simbolių ilgio",
Expand Down Expand Up @@ -1791,6 +1793,7 @@
"Loan Amount and Balance": "Paskolos suma ir likutis",
"Loan Approval": "Paskolos patvirtinimas",
"Loan Balance": "Paskolos likutis",
"Loan Charge-off behaviour": "Paskolos nurašymo elgesys",
"Loan Collateral Details": "Paskolos užstato informacija",
"Loan Cycle": "Paskolos ciklas",
"Loan Disbursal": "Paskolos išmokėjimas",
Expand Down
5 changes: 4 additions & 1 deletion src/assets/translations/lv-LV.json
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,9 @@
"Add periodic accrual entries": "Pievienojiet periodiskus uzkrāšanas ierakstus",
"Accrual Activity Posting on Installment Due Date": "Uzkrāšanas darbības grāmatošana iemaksas termiņā",
"Check loan repayment due": "Pārbaudiet aizdevuma atmaksas termiņu",
"Transfer to Savings": "Pārskaitījums uz uzkrājumiem"
"Transfer to Savings": "Pārskaitījums uz uzkrājumiem",
"Zero interest after charge-off": "Nulle procenti pēc atskaitīšanas",
"Accelerate maturity to charge-off date": "Paātriniet dzēšanas termiņu līdz izņemšanas datumam"
},
"commons": {
"50 characters long": "50 rakstzīmes garš",
Expand Down Expand Up @@ -1791,6 +1793,7 @@
"Loan Amount and Balance": "Aizdevuma summa un atlikums",
"Loan Approval": "Aizdevuma apstiprināšana",
"Loan Balance": "Aizdevuma atlikums",
"Loan Charge-off behaviour": "Aizdevuma nomaksas uzvedība",
"Loan Collateral Details": "Sīkāka informācija par aizdevuma nodrošinājumu",
"Loan Cycle": "Aizdevuma cikls",
"Loan Disbursal": "Aizdevuma izsniegšana",
Expand Down
5 changes: 4 additions & 1 deletion src/assets/translations/ne-NE.json
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,9 @@
"Add periodic accrual entries": "आवधिक संचय प्रविष्टिहरू थप्नुहोस्",
"Accrual Activity Posting on Installment Due Date": "किस्ता तिर्ने मितिमा उपार्जन गतिविधि पोस्ट गर्दै",
"Check loan repayment due": "ऋण तिर्न बाँकी जाँच गर्नुहोस्",
"Transfer to Savings": "बचतमा स्थानान्तरण गर्नुहोस्"
"Transfer to Savings": "बचतमा स्थानान्तरण गर्नुहोस्",
"Zero interest after charge-off": "चार्ज अफ पछि शून्य ब्याज",
"Accelerate maturity to charge-off date": "चार्ज अफ मितिमा परिपक्वतालाई गति दिनुहोस्"
},
"commons": {
"50 characters long": "५० वर्ण लामो",
Expand Down Expand Up @@ -1791,6 +1793,7 @@
"Loan Amount and Balance": "ऋण रकम र मौज्दात",
"Loan Approval": "ऋण स्वीकृति",
"Loan Balance": "ऋण शेष",
"Loan Charge-off behaviour": "ऋण चार्ज अफ व्यवहार",
"Loan Collateral Details": "ऋण संपार्श्विक विवरण",
"Loan Cycle": "ऋण चक्र",
"Loan Disbursal": "ऋण वितरण",
Expand Down
5 changes: 4 additions & 1 deletion src/assets/translations/pt-PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,9 @@
"Add periodic accrual entries": "Adicione entradas de acumulação periódicas",
"Accrual Activity Posting on Installment Due Date": "Publicação de atividades de acumulação na data de vencimento da parcela",
"Check loan repayment due": "Verifique o vencimento do empréstimo",
"Transfer to Savings": "Transferência para Poupança"
"Transfer to Savings": "Transferência para Poupança",
"Zero interest after charge-off": "Juros zero após baixa",
"Accelerate maturity to charge-off date": "Acelerar o vencimento até à data de baixa"
},
"commons": {
"50 characters long": "50 caracteres",
Expand Down Expand Up @@ -1791,6 +1793,7 @@
"Loan Amount and Balance": "Valor e saldo do empréstimo",
"Loan Approval": "Aprovação de empréstimo",
"Loan Balance": "Saldo do empréstimo",
"Loan Charge-off behaviour": "Comportamento de cobrança de empréstimos",
"Loan Collateral Details": "Detalhes da garantia do empréstimo",
"Loan Cycle": "Ciclo de Empréstimo",
"Loan Disbursal": "Desembolso de empréstimo",
Expand Down
Loading

0 comments on commit fb692d4

Please sign in to comment.