Skip to content

Commit a08af71

Browse files
authored
Merge pull request #2555 from alberto-art3ch/enhancement/loan_buy_down_fee_transaction_fix
WEB-249: fix Loan Buy Down Fee duplicate methods
2 parents ade91f7 + 248d8f4 commit a08af71

File tree

1 file changed

+0
-68
lines changed

1 file changed

+0
-68
lines changed

src/app/loans/loans-view/transactions-tab/transactions-tab.component.ts

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,6 @@ export class TransactionsTabComponent implements OnInit {
421421
);
422422
}
423423

424-
private isBuyDownFee(transactionType: LoanTransactionType): boolean {
425-
return transactionType.buyDownFee || transactionType.code === 'loanTransactionType.buyDownFee';
426-
}
427-
428424
private isReAgoeOrReAmortize(transactionType: LoanTransactionType): boolean {
429425
return this.isReAmortize(transactionType) || this.isReAge(transactionType);
430426
}
@@ -450,70 +446,6 @@ export class TransactionsTabComponent implements OnInit {
450446
return true;
451447
}
452448

453-
buyDownFeeAdjustmentTransaction(transaction: LoanTransaction) {
454-
const accountId = `${this.loanId}`;
455-
this.loansService
456-
.getLoanTransactionActionTemplate(accountId, 'buyDownFeeAdjustment', `${transaction.id}`)
457-
.subscribe((response: any) => {
458-
const transactionDate = response.date || transaction.date;
459-
if (response.amount == 0) {
460-
this.displayAlertMessage('Buy Down Fee amount adjusted already adjusted', transaction.amount);
461-
} else {
462-
const transactionAmount = response.amount || transaction.amount;
463-
const formfields: FormfieldBase[] = [
464-
new DatepickerBase({
465-
controlName: 'transactionDate',
466-
label: 'Date',
467-
value: this.dateUtils.parseDate(transactionDate),
468-
type: 'datetime-local',
469-
required: true,
470-
minDate: this.dateUtils.parseDate(transaction.date),
471-
order: 1
472-
}),
473-
new InputBase({
474-
controlName: 'amount',
475-
label: 'Amount',
476-
value: transactionAmount,
477-
type: 'number',
478-
required: true,
479-
max: transactionAmount,
480-
min: 0.001,
481-
order: 2
482-
})
483-
484-
];
485-
const data = {
486-
title: `Adjustment ${transaction.type.value} Transaction`,
487-
layout: { addButtonText: 'Adjustment' },
488-
formfields: formfields
489-
};
490-
const chargebackDialogRef = this.dialog.open(FormDialogComponent, { data });
491-
chargebackDialogRef.afterClosed().subscribe((response: { data: any }) => {
492-
if (response.data) {
493-
const dateFormat = this.settingsService.dateFormat;
494-
495-
if (response.data.value.amount <= transactionAmount) {
496-
const locale = this.settingsService.language.code;
497-
const payload = {
498-
transactionDate: this.dateUtils.formatDate(response.data.value.transactionDate, dateFormat),
499-
transactionAmount: response.data.value.amount,
500-
locale,
501-
dateFormat
502-
};
503-
this.loansService
504-
.executeLoansAccountTransactionsCommand(accountId, 'buyDownFeeAdjustment', payload, transaction.id)
505-
.subscribe(() => {
506-
this.reload();
507-
});
508-
} else {
509-
this.displayAlertMessage('Buy Down Fee Adjustment amount must be lower or equal to', transactionAmount);
510-
}
511-
}
512-
});
513-
}
514-
});
515-
}
516-
517449
capitalizedIncomeAdjustmentTransaction(transaction: LoanTransaction) {
518450
const accountId = `${this.loanId}`;
519451
this.loansService

0 commit comments

Comments
 (0)