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.allowUndo = !this.transactionData.manuallyReversed;
this.allowChargeback = this.allowChargebackTransaction(this.transactionType) && !this.transactionData.manuallyReversed; this.allowChargeback = this.allowChargebackTransaction(this.transactionType) && !this.transactionData.manuallyReversed;
let transactionsChargebackRelated = false; let transactionsChargebackRelated = false;
if (this.allowChargeback) { if (this.transactionData.transactionRelations) {
if (this.transactionData.transactionRelations) { this.transactionRelations.data = this.transactionData.transactionRelations;
this.transactionRelations.data = this.transactionData.transactionRelations; this.existTransactionRelations = (this.transactionData.transactionRelations.length > 0);
this.existTransactionRelations = (this.transactionData.transactionRelations.length > 0); let amountRelations = 0;
let amountRelations = 0; this.transactionData.transactionRelations.forEach((relation: any) => {
this.transactionData.transactionRelations.forEach((relation: any) => { if (relation.relationType === 'CHARGEBACK') {
if (relation.relationType === 'CHARGEBACK') { amountRelations += relation.amount;
amountRelations += relation.amount; transactionsChargebackRelated = true;
transactionsChargebackRelated = true; }
} });
}); this.amountRelationsAllowed = this.transactionData.amount - amountRelations;
this.amountRelationsAllowed = this.transactionData.amount - amountRelations; this.isFullRelated = (this.amountRelationsAllowed === 0);
this.isFullRelated = (this.amountRelationsAllowed === 0); this.allowChargeback = this.allowChargebackTransaction(this.transactionType) && !this.isFullRelated;
this.allowChargeback = this.allowChargebackTransaction(this.transactionType) && !this.isFullRelated;
}
} }
if (!this.allowChargeback) { if (!this.allowChargeback) {
this.allowEdition = false; this.allowEdition = false;
@@ -10,6 +10,7 @@ export interface LoanTransactionType {
payoutRefund: boolean; payoutRefund: boolean;
goodwillCredit: boolean; goodwillCredit: boolean;
interestPaymentWaiver: boolean; interestPaymentWaiver: boolean;
interestRefund: boolean;
chargeRefund: boolean; chargeRefund: boolean;
contra: boolean; contra: boolean;
waiveInterest: boolean; waiveInterest: boolean;