Display Loan interest refund transaction relations

This commit is contained in:
Jose Alberto Hernandez
2024-11-18 06:59:51 -06:00
committed by Jose Alberto Hernandez
parent e02dd0509a
commit aa3e70e5c5
2 changed files with 14 additions and 15 deletions
@@ -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;
@@ -10,6 +10,7 @@ export interface LoanTransactionType {
payoutRefund: boolean;
goodwillCredit: boolean;
interestPaymentWaiver: boolean;
interestRefund: boolean;
chargeRefund: boolean;
contra: boolean;
waiveInterest: boolean;