WEB-295: change transaction to undowriteoff for writeoff transaction instead of undo
This commit is contained in:
@@ -335,6 +335,14 @@ export class TransactionsTabComponent implements OnInit {
|
||||
command = 'undo-charge-off';
|
||||
operationDate = this.settingsService.businessDate;
|
||||
payload = {};
|
||||
} else if (this.isWriteOff(transaction.type)) {
|
||||
command = 'undowriteoff';
|
||||
payload = {
|
||||
transactionDate: this.dateUtils.formatDate(operationDate && new Date(operationDate), dateFormat),
|
||||
transactionAmount: 0,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
} else {
|
||||
payload = {
|
||||
transactionDate: this.dateUtils.formatDate(operationDate && new Date(operationDate), dateFormat),
|
||||
@@ -357,7 +365,7 @@ export class TransactionsTabComponent implements OnInit {
|
||||
undoTransactionAccountDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
|
||||
if (response.confirm) {
|
||||
let transactionId = transaction.id;
|
||||
if (this.isChargeOff(transaction.type)) {
|
||||
if (this.isChargeOff(transaction.type) || command === 'undowriteoff' || this.isWriteOff(transaction.type)) {
|
||||
transactionId = null;
|
||||
}
|
||||
this.loansService
|
||||
@@ -399,6 +407,10 @@ export class TransactionsTabComponent implements OnInit {
|
||||
return transactionType.chargeoff || transactionType.code === 'loanTransactionType.chargeOff';
|
||||
}
|
||||
|
||||
isWriteOff(transactionType: LoanTransactionType): boolean {
|
||||
return transactionType.writeOff || transactionType.code === 'loanTransactionType.writeOff';
|
||||
}
|
||||
|
||||
private isDownPayment(transactionType: LoanTransactionType): boolean {
|
||||
return transactionType.downPayment || transactionType.code === 'loanTransactionType.downPayment';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user