Block undo Loan Interest Refund transaction
This commit is contained in:
committed by
Jose Alberto Hernandez
parent
aa3e70e5c5
commit
a736f4bf74
@@ -133,9 +133,10 @@ export class TransactionsTabComponent implements OnInit {
|
|||||||
* DOWN_PAYMENT:28
|
* DOWN_PAYMENT:28
|
||||||
* REAGE:29
|
* REAGE:29
|
||||||
* REAMORTIZE:30
|
* REAMORTIZE:30
|
||||||
|
* INTEREST REFUND:33
|
||||||
*/
|
*/
|
||||||
showTransactions(transactionsData: LoanTransaction) {
|
showTransactions(transactionsData: LoanTransaction) {
|
||||||
if ([1, 2, 4, 9, 20, 21, 22, 23, 26, 28, 29, 30, 31].includes(transactionsData.type.id)) {
|
if ([1, 2, 4, 9, 20, 21, 22, 23, 26, 28, 29, 30, 31, 33].includes(transactionsData.type.id)) {
|
||||||
this.router.navigate([transactionsData.id], { relativeTo: this.route });
|
this.router.navigate([transactionsData.id], { relativeTo: this.route });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -144,7 +145,9 @@ export class TransactionsTabComponent implements OnInit {
|
|||||||
if (transaction.manuallyReversed) {
|
if (transaction.manuallyReversed) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return !(transaction.type.disbursement || transaction.type.chargeoff || this.isReAgoeOrReAmortize(transaction.type) );
|
return !(transaction.type.disbursement || transaction.type.chargeoff || this.isReAgoeOrReAmortize(transaction.type)
|
||||||
|
|| transaction.type.interestRefund
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
loanTransactionColor(transaction: LoanTransaction): string {
|
loanTransactionColor(transaction: LoanTransaction): string {
|
||||||
|
|||||||
+11
-1
@@ -75,7 +75,7 @@ export class ViewTransactionComponent implements OnInit {
|
|||||||
this.transactionData = data.loansAccountTransaction;
|
this.transactionData = data.loansAccountTransaction;
|
||||||
this.transactionType = this.transactionData.type;
|
this.transactionType = this.transactionData.type;
|
||||||
this.allowEdition = !this.transactionData.manuallyReversed && !this.allowTransactionEdition(this.transactionData.type.id);
|
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;
|
this.allowChargeback = this.allowChargebackTransaction(this.transactionType) && !this.transactionData.manuallyReversed;
|
||||||
let transactionsChargebackRelated = false;
|
let transactionsChargebackRelated = false;
|
||||||
if (this.transactionData.transactionRelations) {
|
if (this.transactionData.transactionRelations) {
|
||||||
@@ -128,6 +128,16 @@ export class ViewTransactionComponent implements OnInit {
|
|||||||
|| transactionType.merchantIssuedRefund || transactionType.downPayment);
|
|| 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
|
* Undo the loans transaction
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { LoanTransactionType } from 'app/loans/models/loan-transaction-type.model';
|
||||||
import { Currency } from 'app/shared/models/general.model';
|
import { Currency } from 'app/shared/models/general.model';
|
||||||
|
|
||||||
export interface LoanTransaction {
|
export interface LoanTransaction {
|
||||||
@@ -24,38 +25,3 @@ export interface LoanTransaction {
|
|||||||
numberOfRepayments: number;
|
numberOfRepayments: number;
|
||||||
transactionRelations: any[];
|
transactionRelations: any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export interface LoanTransactionType {
|
|
||||||
id: number;
|
|
||||||
code: string;
|
|
||||||
value: string;
|
|
||||||
disbursement: boolean;
|
|
||||||
repaymentAtDisbursement: boolean;
|
|
||||||
repayment: boolean;
|
|
||||||
merchantIssuedRefund: boolean;
|
|
||||||
payoutRefund: boolean;
|
|
||||||
goodwillCredit: boolean;
|
|
||||||
interestPaymentWaiver: boolean;
|
|
||||||
chargeRefund: boolean;
|
|
||||||
contra: boolean;
|
|
||||||
waiveInterest: boolean;
|
|
||||||
waiveCharges: boolean;
|
|
||||||
accrual: boolean;
|
|
||||||
writeOff: boolean;
|
|
||||||
recoveryRepayment: boolean;
|
|
||||||
initiateTransfer: boolean;
|
|
||||||
approveTransfer: boolean;
|
|
||||||
withdrawTransfer: boolean;
|
|
||||||
rejectTransfer: boolean;
|
|
||||||
chargePayment: boolean;
|
|
||||||
refund: boolean;
|
|
||||||
refundForActiveLoans: boolean;
|
|
||||||
creditBalanceRefund: boolean;
|
|
||||||
chargeAdjustment: boolean;
|
|
||||||
chargeback: boolean;
|
|
||||||
chargeoff: boolean;
|
|
||||||
downPayment: boolean;
|
|
||||||
reAge: boolean;
|
|
||||||
reAmortize: boolean;
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user