From aa3e70e5c59668d4f7e861e273df478640282d8a Mon Sep 17 00:00:00 2001 From: Jose Alberto Hernandez Date: Mon, 18 Nov 2024 07:58:36 -0500 Subject: [PATCH] Display Loan interest refund transaction relations --- .../view-transaction.component.ts | 28 +++++++++---------- .../models/loan-transaction-type.model.ts | 1 + 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/app/loans/loans-view/transactions/view-transaction/view-transaction.component.ts b/src/app/loans/loans-view/transactions/view-transaction/view-transaction.component.ts index b20baa766..352d22f8b 100644 --- a/src/app/loans/loans-view/transactions/view-transaction/view-transaction.component.ts +++ b/src/app/loans/loans-view/transactions/view-transaction/view-transaction.component.ts @@ -78,21 +78,19 @@ export class ViewTransactionComponent implements OnInit { this.allowUndo = !this.transactionData.manuallyReversed; this.allowChargeback = this.allowChargebackTransaction(this.transactionType) && !this.transactionData.manuallyReversed; let transactionsChargebackRelated = false; - if (this.allowChargeback) { - if (this.transactionData.transactionRelations) { - this.transactionRelations.data = this.transactionData.transactionRelations; - this.existTransactionRelations = (this.transactionData.transactionRelations.length > 0); - let amountRelations = 0; - this.transactionData.transactionRelations.forEach((relation: any) => { - if (relation.relationType === 'CHARGEBACK') { - amountRelations += relation.amount; - transactionsChargebackRelated = true; - } - }); - this.amountRelationsAllowed = this.transactionData.amount - amountRelations; - this.isFullRelated = (this.amountRelationsAllowed === 0); - this.allowChargeback = this.allowChargebackTransaction(this.transactionType) && !this.isFullRelated; - } + if (this.transactionData.transactionRelations) { + this.transactionRelations.data = this.transactionData.transactionRelations; + this.existTransactionRelations = (this.transactionData.transactionRelations.length > 0); + let amountRelations = 0; + this.transactionData.transactionRelations.forEach((relation: any) => { + if (relation.relationType === 'CHARGEBACK') { + amountRelations += relation.amount; + transactionsChargebackRelated = true; + } + }); + this.amountRelationsAllowed = this.transactionData.amount - amountRelations; + this.isFullRelated = (this.amountRelationsAllowed === 0); + this.allowChargeback = this.allowChargebackTransaction(this.transactionType) && !this.isFullRelated; } if (!this.allowChargeback) { this.allowEdition = false; diff --git a/src/app/loans/models/loan-transaction-type.model.ts b/src/app/loans/models/loan-transaction-type.model.ts index 033611fba..686e19912 100644 --- a/src/app/loans/models/loan-transaction-type.model.ts +++ b/src/app/loans/models/loan-transaction-type.model.ts @@ -10,6 +10,7 @@ export interface LoanTransactionType { payoutRefund: boolean; goodwillCredit: boolean; interestPaymentWaiver: boolean; + interestRefund: boolean; chargeRefund: boolean; contra: boolean; waiveInterest: boolean;