Display Loan interest refund transaction relations
This commit is contained in:
committed by
Jose Alberto Hernandez
parent
e02dd0509a
commit
aa3e70e5c5
+13
-15
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user