Skip to content

Commit

Permalink
Display Loan interest refund transaction relations
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Alberto Hernandez authored and alberto-art3ch committed Nov 18, 2024
1 parent e02dd05 commit aa3e70e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/app/loans/models/loan-transaction-type.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface LoanTransactionType {
payoutRefund: boolean;
goodwillCredit: boolean;
interestPaymentWaiver: boolean;
interestRefund: boolean;
chargeRefund: boolean;
contra: boolean;
waiveInterest: boolean;
Expand Down

0 comments on commit aa3e70e

Please sign in to comment.