Skip to content

Commit b9d8bd2

Browse files
Merge pull request #2561 from mariiaKraievska/WEB-255/disable-automatic-interest-refund-calculation
WEB-255: Disable automatic Interest Refund calculation
2 parents a08af71 + 2ed69b2 commit b9d8bd2

File tree

16 files changed

+44
-15
lines changed

16 files changed

+44
-15
lines changed

src/app/loans/loans-view/loan-account-actions/make-repayment/make-repayment.component.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@
118118
<mat-label> {{ 'labels.inputs.Note' | translate }}</mat-label>
119119
<textarea matInput formControlName="note" cdkTextareaAutosize cdkAutosizeMinRows="2"></textarea>
120120
</mat-form-field>
121+
122+
<mat-checkbox formControlName="skipInterestRefund" *ngIf="showInterestRefundCheckbox()">
123+
{{ 'labels.inputs.Skip Interest Refund Transaction Posting' | translate }}
124+
</mat-checkbox>
121125
</div>
122126

123127
<mat-card-actions class="layout-row align-center gap-5px responsive-column">

src/app/loans/loans-view/loan-account-actions/make-repayment/make-repayment.component.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ export class MakeRepaymentComponent implements OnInit {
9292
],
9393
externalId: '',
9494
paymentTypeId: '',
95-
note: ''
95+
note: '',
96+
skipInterestRefund: [false]
9697
});
9798

9899
if (this.isCapitalizedIncome()) {
@@ -157,6 +158,11 @@ export class MakeRepaymentComponent implements OnInit {
157158
].includes(this.command);
158159
}
159160

161+
showInterestRefundCheckbox(): boolean {
162+
const code = this.dataObject?.type?.code?.toLowerCase() || '';
163+
return code.includes('merchantissuedrefund') || code.includes('payoutrefund');
164+
}
165+
160166
/** Submits the repayment form */
161167
submit() {
162168
const repaymentLoanFormData = this.repaymentLoanForm.value;
@@ -166,12 +172,16 @@ export class MakeRepaymentComponent implements OnInit {
166172
if (repaymentLoanFormData.transactionDate instanceof Date) {
167173
repaymentLoanFormData.transactionDate = this.dateUtils.formatDate(prevTransactionDate, dateFormat);
168174
}
169-
const data = {
175+
const data: any = {
170176
...repaymentLoanFormData,
171177
dateFormat,
172178
locale
173179
};
174180
data['transactionAmount'] = data['transactionAmount'] * 1;
181+
if (repaymentLoanFormData.skipInterestRefund) {
182+
data.interestRefundCalculation = false;
183+
}
184+
delete data.skipInterestRefund;
175185
this.loanService.submitLoanActionButton(this.loanId, data, this.command).subscribe((response: any) => {
176186
this.router.navigate(['../../transactions'], { relativeTo: this.route });
177187
});

src/app/standalone-shared.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { MatSelect } from '@angular/material/select';
1212
import { MatOption } from '@angular/material/core';
1313
import { MatDatepickerInput, MatDatepickerToggle, MatDatepicker } from '@angular/material/datepicker';
1414
import { MatButton } from '@angular/material/button';
15+
import { MatCheckbox } from '@angular/material/checkbox';
1516
import { DateFormatPipe } from '@pipes/date-format.pipe';
1617
import { TranslatePipe as NgxTranslatePipe } from '@ngx-translate/core';
1718
import { TranslatePipe } from '@pipes/translate.pipe';
@@ -39,6 +40,7 @@ export const STANDALONE_SHARED_IMPORTS = [
3940
MatDatepickerToggle,
4041
MatDatepicker,
4142
MatButton,
43+
MatCheckbox,
4244
DateFormatPipe,
4345
HasPermissionDirective,
4446

src/assets/translations/cs-CS.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2487,7 +2487,8 @@
24872487
"Buy down fee income type": "Typ příjmu z poplatku za odkup",
24882488
"Buy down fees": "Poplatky za odkup",
24892489
"Income from Buy down fees": "Příjmy z poplatků za odkup",
2490-
"Buy down fee Expense": "Náklady na poplatek za odkup"
2490+
"Buy down fee Expense": "Náklady na poplatek za odkup",
2491+
"Skip Interest Refund Transaction Posting": "Přeskočit zaúčtování vrácení úroků"
24912492
},
24922493
"links": {
24932494
"Community": "Společenství",

src/assets/translations/de-DE.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2487,7 +2487,8 @@
24872487
"Buy down fee income type": "Einnahmeart der Buy-Down-Gebühr",
24882488
"Buy down fees": "Buy-Down-Gebühren",
24892489
"Income from Buy down fees": "Einnahmen aus Buy-Down-Gebühren",
2490-
"Buy down fee Expense": "Aufwendungen aus Buy-Down-Gebühren"
2490+
"Buy down fee Expense": "Aufwendungen aus Buy-Down-Gebühren",
2491+
"Skip Interest Refund Transaction Posting": "Buchung der Zinsrückerstattung überspringen"
24912492
},
24922493
"links": {
24932494
"Community": "Gemeinschaft",

src/assets/translations/en-US.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2494,7 +2494,8 @@
24942494
"Buy down fee income type": "Buy down fee income type",
24952495
"Buy down fees": "Buy down fees",
24962496
"Income from Buy down fees": "Income from Buy down fees",
2497-
"Buy down fee Expense": "Buy down fee Expense"
2497+
"Buy down fee Expense": "Buy down fee Expense",
2498+
"Skip Interest Refund Transaction Posting": "Skip Interest Refund Transaction Posting"
24982499
},
24992500
"links": {
25002501
"Community": "Community",

src/assets/translations/es-CL.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2487,7 +2487,8 @@
24872487
"Buy down fee income type": "Tipo de ingreso de comisión de compra anticipada",
24882488
"Buy down fees": "Tarifas de compra anticipada",
24892489
"Income from Buy down fees": "Ingresos por comisiones de compra inicial",
2490-
"Buy down fee Expense": "Gastos por comisiones de compra inicial"
2490+
"Buy down fee Expense": "Gastos por comisiones de compra inicial",
2491+
"Skip Interest Refund Transaction Posting": "Omitir el registro de la devolución de intereses"
24912492
},
24922493
"links": {
24932494
"Community": "Comunidad",

src/assets/translations/es-MX.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2487,7 +2487,8 @@
24872487
"Buy down fee income type": "Tipo de ingreso de comisión de compra anticipada",
24882488
"Buy down fees": "Tarifas de compra anticipada",
24892489
"Income from Buy down fees": "Ingresos por comisiones de compra inicial",
2490-
"Buy down fee Expense": "Gastos por comisiones de compra inicial"
2490+
"Buy down fee Expense": "Gastos por comisiones de compra inicial",
2491+
"Skip Interest Refund Transaction Posting": "Omitir el registro de la devolución de intereses"
24912492
},
24922493
"links": {
24932494
"Community": "Comunidad",

src/assets/translations/fr-FR.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2487,7 +2487,8 @@
24872487
"Buy down fee income type": "Type de revenu des frais de rachat",
24882488
"Buy down fees": "Frais d'achat",
24892489
"Income from Buy down fees": "Revenus des commissions de rachat",
2490-
"Buy down fee Expense": "Charges des commissions de rachat"
2490+
"Buy down fee Expense": "Charges des commissions de rachat",
2491+
"Skip Interest Refund Transaction Posting": "Ignorer la comptabilisation du remboursement des intérêts"
24912492
},
24922493
"links": {
24932494
"Community": "Communauté",

src/assets/translations/it-IT.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2487,7 +2487,8 @@
24872487
"Buy down fee income type": "Tipo di ricavo da commissione di buy down",
24882488
"Buy down fees": "Commissioni di acquisto",
24892489
"Income from Buy down fees": "Proventi da commissioni di buy down",
2490-
"Buy down fee Expense": "Spese da commissioni di buy down"
2490+
"Buy down fee Expense": "Spese da commissioni di buy down",
2491+
"Skip Interest Refund Transaction Posting": "Salta la registrazione del rimborso degli interessi"
24912492
},
24922493
"links": {
24932494
"Community": "Comunità",

0 commit comments

Comments
 (0)