WEB-295: change transaction to undowriteoff for writeoff transaction instead of undo

This commit is contained in:
Attila Budai
2025-09-08 19:12:12 +02:00
parent 9697d90367
commit c353eb8a9c
2 changed files with 20 additions and 2 deletions
@@ -200,6 +200,10 @@ export class ViewTransactionComponent implements OnInit {
return true;
}
isWriteOff(transactionType: LoanTransactionType): boolean {
return transactionType.writeOff || transactionType.code === 'loanTransactionType.writeOff';
}
/**
* Undo the loans transaction
*/
@@ -267,8 +271,10 @@ export class ViewTransactionComponent implements OnInit {
dateFormat,
locale
};
const command = this.isWriteOff(this.transactionType) ? 'undowriteoff' : 'undo';
const transactionId = command === 'undowriteoff' ? null : this.transactionData.id;
this.loansService
.executeLoansAccountTransactionsCommand(accountId, 'undo', data, this.transactionData.id)
.executeLoansAccountTransactionsCommand(accountId, command, data, transactionId)
.subscribe(() => {
this.router.navigate(['../'], { relativeTo: this.route });
});