Block undo Loan Interest Refund transaction

This commit is contained in:
Jose Alberto Hernandez
2024-11-18 11:35:41 -06:00
committed by Jose Alberto Hernandez
parent aa3e70e5c5
commit a736f4bf74
3 changed files with 17 additions and 38 deletions
@@ -75,7 +75,7 @@ export class ViewTransactionComponent implements OnInit {
this.transactionData = data.loansAccountTransaction;
this.transactionType = this.transactionData.type;
this.allowEdition = !this.transactionData.manuallyReversed && !this.allowTransactionEdition(this.transactionData.type.id);
this.allowUndo = !this.transactionData.manuallyReversed;
this.allowUndo = this.allowUndoTransaction(this.transactionData.manuallyReversed, this.transactionType);
this.allowChargeback = this.allowChargebackTransaction(this.transactionType) && !this.transactionData.manuallyReversed;
let transactionsChargebackRelated = false;
if (this.transactionData.transactionRelations) {
@@ -128,6 +128,16 @@ export class ViewTransactionComponent implements OnInit {
|| transactionType.merchantIssuedRefund || transactionType.downPayment);
}
allowUndoTransaction(manuallyReversed: boolean, transactionType: LoanTransactionType): boolean {
if (manuallyReversed) {
return false;
}
if (transactionType.interestRefund) {
return false;
}
return true;
}
/**
* Undo the loans transaction
*/