Skip to content

Commit

Permalink
Advance payment strategy with Adjust last, unpaid period reschedule m…
Browse files Browse the repository at this point in the history
…ethod
  • Loading branch information
Jose Alberto Hernandez committed Aug 15, 2024
1 parent 3788338 commit 0d9cb66
Show file tree
Hide file tree
Showing 26 changed files with 79 additions and 42 deletions.
2 changes: 1 addition & 1 deletion src/app/accounting/accounting.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class AccountingComponent implements OnInit, AfterViewInit {
this.router.navigate(['/accounting/closing-entries']);
}

arrowBooleansToggle(arrowNumber:number) {
arrowBooleansToggle(arrowNumber: number) {
// Toggle the boolean value at the given index
this.arrowBooleans[arrowNumber] = !this.arrowBooleans[arrowNumber];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class ClientAddressStepComponent {
let formfields: FormfieldBase[] = [];

for (let index = 0; index < this.clientTemplate.address[0].addressTypeIdOptions.length; index++) {
this.clientTemplate.address[0].addressTypeIdOptions[index].name = this.translateService.instant(`labels.catalogs.${this.clientTemplate.address[0].addressTypeIdOptions[index].name}`)
this.clientTemplate.address[0].addressTypeIdOptions[index].name = this.translateService.instant(`labels.catalogs.${this.clientTemplate.address[0].addressTypeIdOptions[index].name}`);
}

formfields.push(this.isFieldEnabled('addressType') ? new SelectBase({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class AddressTabComponent {
let formfields: FormfieldBase[] = [];

for (let index = 0; index < this.clientAddressTemplate.addressTypeIdOptions.length; index++) {
this.clientAddressTemplate.addressTypeIdOptions[index].name = this.translateService.instant(`labels.catalogs.${this.clientAddressTemplate.addressTypeIdOptions[index].name}`)
this.clientAddressTemplate.addressTypeIdOptions[index].name = this.translateService.instant(`labels.catalogs.${this.clientAddressTemplate.addressTypeIdOptions[index].name}`);
}

if (formType === 'add') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class IdentitiesTabComponent {
*/
addIdentifier() {
for (let index = 0; index < this.clientIdentifierTemplate.allowedDocumentTypes.length; index++) {
this.clientIdentifierTemplate.allowedDocumentTypes[index].name = this.translateService.instant(`labels.catalogs.${this.clientIdentifierTemplate.allowedDocumentTypes[index].name}`)
this.clientIdentifierTemplate.allowedDocumentTypes[index].name = this.translateService.instant(`labels.catalogs.${this.clientIdentifierTemplate.allowedDocumentTypes[index].name}`);
}
const formfields: FormfieldBase[] = [
new SelectBase({
Expand Down
2 changes: 1 addition & 1 deletion src/app/organization/bulk-import/bulk-import.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class BulkImportComponent implements OnInit {
* @param arrowNumber - The index of the boolean value to toggle.
*/

arrowBooleansToggle(arrowNumber:number) {
arrowBooleansToggle(arrowNumber: number) {
// Toggle the boolean value at the given index
this.arrowBooleans[arrowNumber] = !this.arrowBooleans[arrowNumber];
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/organization/organization.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export class OrganizationComponent implements OnInit, AfterViewInit {
this.router.navigate(['/products/recurring-deposit-products']);
}

arrowBooleansToggle(arrowNumber:number) {
arrowBooleansToggle(arrowNumber: number) {
// Toggle the boolean value at the given index
this.arrowBooleans[arrowNumber] = !this.arrowBooleans[arrowNumber];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ <h3 class="mat-h3" fxFlexFill>{{ 'labels.inputs.Loan Schedule' | translate}}</h3
</span>
</div>

<div fxFlexFill *ngIf="isAdvancedPaymentAllocation && supportedInterestRefundTypes.length > 0">
<div fxFlexFill *ngIf="isAdvancedPaymentAllocation && supportedInterestRefundTypes?.length > 0">
<span fxFlex="47%">{{ 'labels.inputs.Supported Interest Refund Types' | translate}}:</span>
<span fxFlex="53%">
{{mapHumanReadableValueStringEnumOptionDataList(supportedInterestRefundTypes)}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ <h3 fxFlex="96%" class="mat-h3">{{'labels.heading.Interest Recalculation' | tran

<mat-form-field fxFlex="48%">
<mat-label>{{'labels.inputs.Advance payments adjustment type' | translate}}</mat-label>
<mat-select formControlName="rescheduleStrategyMethod" required>
<mat-select formControlName="rescheduleStrategyMethod" required [disabled]="rescheduleStrategyTypeDisabled">
<mat-option *ngFor="let rescheduleStrategyType of rescheduleStrategyTypeData" [value]="rescheduleStrategyType.id">
{{ rescheduleStrategyType.value | translateKey:'catalogs' }}
</mat-option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export class LoanProductSettingsStepComponent implements OnInit {
daysInYearTypeData: any;
daysInMonthTypeData: any;
preClosureInterestCalculationStrategyData: any;
rescheduleStrategyTypeData: any;
rescheduleStrategyTypeData: OptionData[];
rescheduleStrategyTypeDataBase: OptionData[];
interestRecalculationCompoundingTypeData: any;
interestRecalculationFrequencyTypeData: any;
interestRecalculationNthDayTypeData: any;
Expand All @@ -44,6 +45,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
isAdvancedTransactionProcessingStrategy = false;
advancedTransactionProcessingStrategyDisabled = true;
useDueForRepaymentsConfigurations = false;
rescheduleStrategyTypeDisabled = false;

/** Values to Days for Repayments */
defaultConfigValues: GlobalConfiguration[] = [];
Expand Down Expand Up @@ -73,6 +75,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
this.daysInMonthTypeData = this.loanProductsTemplate.daysInMonthTypeOptions;
this.preClosureInterestCalculationStrategyData = this.loanProductsTemplate.preClosureInterestCalculationStrategyOptions;
this.rescheduleStrategyTypeData = this.loanProductsTemplate.rescheduleStrategyTypeOptions;
this.rescheduleStrategyTypeDataBase = this.loanProductsTemplate.rescheduleStrategyTypeOptions;
this.interestRecalculationCompoundingTypeData = this.loanProductsTemplate.interestRecalculationCompoundingTypeOptions;
this.interestRecalculationFrequencyTypeData = this.loanProductsTemplate.interestRecalculationFrequencyTypeOptions;
this.interestRecalculationNthDayTypeData = this.loanProductsTemplate.interestRecalculationNthDayTypeOptions;
Expand Down Expand Up @@ -125,9 +128,6 @@ export class LoanProductSettingsStepComponent implements OnInit {
this.processingStrategyService.initialize(this.isAdvancedTransactionProcessingStrategy);
this.validateAdvancedPaymentStrategyControls();

console.log(this.loanProductsTemplate.dueDaysForRepaymentEvent);
console.log(this.loanProductsTemplate.overDueDaysForRepaymentEvent);

if (this.loanProductsTemplate.dueDaysForRepaymentEvent != null &&
this.loanProductsTemplate.overDueDaysForRepaymentEvent != null) {
this.loanProductSettingsForm.patchValue({
Expand Down Expand Up @@ -283,7 +283,9 @@ export class LoanProductSettingsStepComponent implements OnInit {
this.loanProductSettingsForm.addControl('interestRecalculationCompoundingMethod', new UntypedFormControl(this.interestRecalculationCompoundingTypeData[0].id, Validators.required));
this.loanProductSettingsForm.addControl('recalculationRestFrequencyType', new UntypedFormControl(this.interestRecalculationFrequencyTypeData[0].id, Validators.required));
this.loanProductSettingsForm.addControl('isArrearsBasedOnOriginalSchedule', new UntypedFormControl(''));

if (this.loanProductSettingsForm.value.isInterestRecalculationEnabled) {
this.setRescheduleStrategies();
}
this.loanProductSettingsForm.get('interestRecalculationCompoundingMethod').valueChanges
.subscribe((interestRecalculationCompoundingMethod: any) => {
if (interestRecalculationCompoundingMethod !== 0) {
Expand Down Expand Up @@ -485,10 +487,33 @@ export class LoanProductSettingsStepComponent implements OnInit {
});
this.isAdvancedTransactionProcessingStrategy = true;
}
if (this.loanProductSettingsForm.value.isInterestRecalculationEnabled) {
this.setRescheduleStrategies();
}
this.processingStrategyService.initialize(this.isAdvancedTransactionProcessingStrategy);
});
}

private setRescheduleStrategies() {
if (this.advancedTransactionProcessingStrategyDisabled) {
this.rescheduleStrategyTypeData = this.rescheduleStrategyTypeDataBase.filter(
(o: OptionData) => o.id > 3
);
this.loanProductSettingsForm.patchValue({
'rescheduleStrategyMethod': this.rescheduleStrategyTypeData[0].id
});
this.rescheduleStrategyTypeDisabled = true;
} else {
this.rescheduleStrategyTypeData = this.rescheduleStrategyTypeDataBase.filter(
(o: OptionData) => o.id < 4
);
this.loanProductSettingsForm.patchValue({
'rescheduleStrategyMethod': this.rescheduleStrategyTypeData[0].id
});
this.rescheduleStrategyTypeDisabled = false;
}
}

private getGlobalConfigValue(configName: string): number {
let value: number | null = null;
this.defaultConfigValues.forEach((config: GlobalConfiguration) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class ManageDelinquencyBucketsComponent implements OnInit {
* @param arrowNumber - The index of the boolean value to toggle.
*/

arrowBooleansToggle(arrowNumber:number) {
arrowBooleansToggle(arrowNumber: number) {
// Toggle the boolean value at the given index
this.arrowBooleans[arrowNumber] = !this.arrowBooleans[arrowNumber];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class ManageTaxConfigurationsComponent implements OnInit {
* @param arrowNumber - The index of the boolean value to toggle.
*/

arrowBooleansToggle(arrowNumber:number) {
arrowBooleansToggle(arrowNumber: number) {
// Toggle the boolean value at the given index
this.arrowBooleans[arrowNumber] = !this.arrowBooleans[arrowNumber];
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/products/products.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export class ProductsComponent implements OnInit, AfterViewInit {
this.router.navigate(['/products/fixed-deposit-products']);
}

arrowBooleansToggle(arrowNumber:number) {
arrowBooleansToggle(arrowNumber: number) {
// Toggle the boolean value at the given index
this.arrowBooleans[arrowNumber] = !this.arrowBooleans[arrowNumber];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class ExternalServicesComponent implements OnInit {
* @param arrowNumber - The index of the boolean value to toggle.
*/

arrowBooleansToggle(arrowNumber:number) {
arrowBooleansToggle(arrowNumber: number) {
// Toggle the boolean value at the given index
this.arrowBooleans[arrowNumber] = !this.arrowBooleans[arrowNumber];
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/system/system.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export class SystemComponent implements OnInit, AfterViewInit {
this.router.navigate(['/organization/manage-funds']);
}

arrowBooleansToggle(arrowNumber:number) {
arrowBooleansToggle(arrowNumber: number) {
// Toggle the boolean value at the given index
this.arrowBooleans[arrowNumber] = !this.arrowBooleans[arrowNumber];
}
Expand Down
5 changes: 3 additions & 2 deletions src/assets/translations/cs-CS.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@
"Enable": "Umožnit",
"Expand All": "Rozšířit vše",
"Export": "Vývozní",
"Export to FIle": "Export do FILE",
"Export to File": "Export do FILE",
"Export CSV": "Vývozní CSV",
"Export XLS": "Vývozní XLS",
"Filter": "filtr",
Expand Down Expand Up @@ -664,6 +664,7 @@
"Equal principal payments": "Stejné splátky jistiny",
"Till Pre-Close Date": "Do data předběžného uzavření",
"Till Rest Frequency Date": "Do zbývajícího data frekvence",
"Adjust last, unpaid period": "Upravit poslední nezaplacené období",
"Reduce EMI amount": "Snížit částku",
"Reduce number of installments": "Snížit počet splátek",
"Reschedule next repayments": "Přeplánujte další splátky",
Expand Down Expand Up @@ -1551,7 +1552,7 @@
"Expense Account (DR)": "Výdajový účet (DR)",
"Expenses from Goodwill Credit": "Výdaje z Goodwill Credit",
"Expiry Date": "Datum vypršení platnosti",
"Export to FIle": "Export do FILE",
"Export to File": "Export do FILE",
"Extend Repayment Period": "Prodloužit dobu splácení",
"External Asset Owner": "Externí vlastník aktiv",
"External ID": "Externí ID",
Expand Down
5 changes: 3 additions & 2 deletions src/assets/translations/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@
"Enable": "Aktivieren",
"Expand All": "Alle erweitern",
"Export": "Export",
"Export to FIle": "In eine Datei exportieren",
"Export to File": "In eine Datei exportieren",
"Export CSV": "CSV exportieren",
"Export XLS": "XLS exportieren",
"Filter": "Filter",
Expand Down Expand Up @@ -664,6 +664,7 @@
"Equal principal payments": "Gleiche Kapitalzahlungen",
"Till Pre-Close Date": "Bis zum Vorschlussdatum",
"Till Rest Frequency Date": "Bis Ruhefrequenzdatum",
"Adjust last, unpaid period": "Passen Sie den letzten, unbezahlten Zeitraum an",
"Reduce EMI amount": "Betrag reduzieren",
"Reduce number of installments": "Reduzieren Sie die Anzahl der Raten",
"Reschedule next repayments": "Planen Sie die nächsten Rückzahlungen neu",
Expand Down Expand Up @@ -1551,7 +1552,7 @@
"Expense Account (DR)": "Spesenkonto (DR)",
"Expenses from Goodwill Credit": "Aufwendungen aus Goodwill-Guthaben",
"Expiry Date": "Verfallsdatum",
"Export to FIle": "In eine Datei exportieren",
"Export to File": "In eine Datei exportieren",
"Extend Repayment Period": "Verlängern Sie die Rückzahlungsfrist",
"External Asset Owner": "Externer Asset-Eigentümer",
"External ID": "Externe ID",
Expand Down
5 changes: 3 additions & 2 deletions src/assets/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@
"Enable": "Enable",
"Expand All": "Expand All",
"Export": "Export",
"Export to FIle": "Export to FIle",
"Export to File": "Export to File",
"Export CSV": "Export CSV",
"Export XLS": "Export XLS",
"Filter": "filter",
Expand Down Expand Up @@ -664,6 +664,7 @@
"Equal principal payments": "Equal principal payments",
"Till Pre-Close Date": "Till Pre-Close Date",
"Till Rest Frequency Date": "Till Rest Frequency Date",
"Adjust last, unpaid period": "Adjust last, unpaid period",
"Reduce EMI amount": "Reduce EMI Amount",
"Reduce number of installments": "Reduce number of installments",
"Reschedule next repayments": "Reschedule next repayments",
Expand Down Expand Up @@ -1552,7 +1553,7 @@
"Expense Account (DR)": "Expense Account (DR)",
"Expenses from Goodwill Credit": "Expenses from Goodwill Credit",
"Expiry Date": "Expiry Date",
"Export to FIle": "Export to FIle",
"Export to File": "Export to File",
"Extend Repayment Period": "Extend Repayment Period",
"External Asset Owner": "External Asset Owner",
"External ID": "External ID",
Expand Down
5 changes: 3 additions & 2 deletions src/assets/translations/es-MX.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@
"Enable": "Permitir",
"Expand All": "Expandir Todo",
"Export": "Exportar",
"Export to FIle": "Exportar Archivo",
"Export to File": "Exportar Archivo",
"Export CSV": "Exportar CSV",
"Export XLS": "Exportar XLS",
"Filter": "Filtrar",
Expand Down Expand Up @@ -664,6 +664,7 @@
"Equal principal payments": "Pagos iguales de capital",
"Till Pre-Close Date": "Hasta la fecha de cierre previo",
"Till Rest Frequency Date": "Hasta la Frecuencia Fecha",
"Adjust last, unpaid period": "Ajustar el último período no pagado",
"Reduce EMI amount": "Reducir Monto de Cuota",
"Reduce number of installments": "Reducir el número de cuotas",
"Reschedule next repayments": "Reprogramar próximos pagos",
Expand Down Expand Up @@ -1550,7 +1551,7 @@
"Expense Account (DR)": "Cuenta de gastos (DR)",
"Expenses from Goodwill Credit": "Gastos del crédito de buena voluntad",
"Expiry Date": "Fecha de Caducidad",
"Export to FIle": "Exportar Archivo",
"Export to File": "Exportar Archivo",
"Extend Repayment Period": "Ampliar el período de pago",
"External Asset Owner": "Propietario de activos externos",
"External ID": "Id externo",
Expand Down
5 changes: 3 additions & 2 deletions src/assets/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@
"Enable": "Activer",
"Expand All": "Développer tout",
"Export": "Exporter",
"Export to FIle": "Exporter vers un fichier",
"Export to File": "Exporter vers un fichier",
"Export CSV": "Exporter au format CSV",
"Export XLS": "Exporter au format XLS",
"Filter": "filtre",
Expand Down Expand Up @@ -664,6 +664,7 @@
"Equal principal payments": "Paiements du principal égaux",
"Till Pre-Close Date": "Jusqu'à la date de pré-clôture",
"Till Rest Frequency Date": "Jusqu'à la date de fréquence de repos",
"Adjust last, unpaid period": "Ajuster la dernière période non payée",
"Reduce EMI amount": "Réduire le montant",
"Reduce number of installments": "Réduire le nombre de versements",
"Reschedule next repayments": "Reprogrammer les prochains remboursements",
Expand Down Expand Up @@ -1551,7 +1552,7 @@
"Expense Account (DR)": "Compte de dépenses (DR)",
"Expenses from Goodwill Credit": "Dépenses liées au crédit de bonne volonté",
"Expiry Date": "Date d'expiration",
"Export to FIle": "Exporter vers un fichier",
"Export to File": "Exporter vers un fichier",
"Extend Repayment Period": "Prolonger la période de remboursement",
"External Asset Owner": "Propriétaire de l'actif externe",
"External ID": "ID externe",
Expand Down
5 changes: 3 additions & 2 deletions src/assets/translations/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@
"Enable": "Abilitare",
"Expand All": "Espandi tutto",
"Export": "Esportare",
"Export to FIle": "Esporta su file",
"Export to File": "Esporta su file",
"Export CSV": "Esporta CSV",
"Export XLS": "Esporta XLS",
"Filter": "filtro",
Expand Down Expand Up @@ -664,6 +664,7 @@
"Equal principal payments": "Parità di capitale",
"Till Pre-Close Date": "Fino alla data di pre-chiusura",
"Till Rest Frequency Date": "Fino alla data di frequenza del riposo",
"Adjust last, unpaid period": "Modifica l'ultimo periodo non pagato",
"Reduce EMI amount": "Ridurre l'importo",
"Reduce number of installments": "Ridurre il numero di rate",
"Reschedule next repayments": "Riprogrammare i prossimi rimborsi",
Expand Down Expand Up @@ -1551,7 +1552,7 @@
"Expense Account (DR)": "Conto spese (DR)",
"Expenses from Goodwill Credit": "Spese derivanti dal credito di avviamento",
"Expiry Date": "Data di scadenza",
"Export to FIle": "Esporta su file",
"Export to File": "Esporta su file",
"Extend Repayment Period": "Estendere il periodo di rimborso",
"External Asset Owner": "Proprietario della risorsa esterna",
"External ID": "ID esterno",
Expand Down
5 changes: 3 additions & 2 deletions src/assets/translations/ko-KO.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@
"Enable": "할 수 있게 하다",
"Expand All": "모두 확장",
"Export": "내보내다",
"Export to FIle": "파일로 내보내기",
"Export to File": "파일로 내보내기",
"Export CSV": "CSV 내보내기",
"Export XLS": "XLS 내보내기",
"Filter": "필터",
Expand Down Expand Up @@ -664,6 +664,7 @@
"Equal principal payments": "동일 원금지급",
"Till Pre-Close Date": "마감 전 날짜까지",
"Till Rest Frequency Date": "휴식 빈도 날짜까지",
"Adjust last, unpaid period": "마지막, 무급 기간을 조정하십시오",
"Reduce EMI amount": "금액 감소",
"Reduce number of installments": "할부 횟수 줄이기",
"Reschedule next repayments": "다음 상환 일정 변경",
Expand Down Expand Up @@ -1552,7 +1553,7 @@
"Expense Account (DR)": "비용 계정(DR)",
"Expenses from Goodwill Credit": "영업권 신용으로 인한 비용",
"Expiry Date": "만료일",
"Export to FIle": "파일로 내보내기",
"Export to File": "파일로 내보내기",
"Extend Repayment Period": "상환기간 연장",
"External Asset Owner": "외부 자산 소유자",
"External ID": "외부 ID",
Expand Down
Loading

0 comments on commit 0d9cb66

Please sign in to comment.