From 4e3b49a96ac31d58841d342485af1b4759becd96 Mon Sep 17 00:00:00 2001 From: Nitesh Yadav Date: Tue, 13 Oct 2026 18:41:39 +0530 Subject: [PATCH] feat(ui): remove Undo / Revert transaction actions Removes the Undo button and Undo menu item from savings, current, fixed deposit, recurring deposit and loan transactions, the account-transfer Undo, and the Revert Transaction button on the journal entry transaction detail, to prevent accidental reversal of posted entries. Co-Authored-By: Claude Sonnet 5.5 --- .../view-account-transfer.component.html | 10 ------- .../transactions-tab.component.html | 12 -------- ...nts-transaction-general-tab.component.html | 12 -------- .../transactions-tab.component.html | 6 ---- .../view-transaction.component.html | 15 +--------- .../view-transaction.component.html | 8 ----- .../transactions-tab.component.html | 4 --- .../view-transaction.component.html | 3 -- .../transactions-tab.component.html | 12 -------- ...ngs-transaction-general-tab.component.html | 10 ------- ...w-journal-entry-transaction.component.html | 18 ----------- ...iew-journal-entry-transaction.component.ts | 30 +------------------ 12 files changed, 2 insertions(+), 138 deletions(-) diff --git a/src/app/account-transfers/view-account-transfer/view-account-transfer.component.html b/src/app/account-transfers/view-account-transfer/view-account-transfer.component.html index 9d1b9ae34..cac9ad40d 100644 --- a/src/app/account-transfers/view-account-transfer/view-account-transfer.component.html +++ b/src/app/account-transfers/view-account-transfer/view-account-transfer.component.html @@ -7,16 +7,6 @@ -->
-
- @if (!viewAccountTransferData.reversed) { - - - - } -
-
diff --git a/src/app/current-accounts/current-account-view/transactions-tab/transactions-tab.component.html b/src/app/current-accounts/current-account-view/transactions-tab/transactions-tab.component.html index b0a948417..f39e90652 100644 --- a/src/app/current-accounts/current-account-view/transactions-tab/transactions-tab.component.html +++ b/src/app/current-accounts/current-account-view/transactions-tab/transactions-tab.component.html @@ -135,18 +135,6 @@ {{ 'labels.text.View Transaction' | translate }} - @if (!transaction.reversed) { - - - - } - - }
diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions-tab/transactions-tab.component.html b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions-tab/transactions-tab.component.html index 6e447a59c..bef30de6c 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions-tab/transactions-tab.component.html +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions-tab/transactions-tab.component.html @@ -130,12 +130,6 @@ {{ 'labels.text.View Transaction' | translate }} - @if (!isFirstTransaction(idx)) { - - } - - } -
+
diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/view-transaction/view-transaction.component.html b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/view-transaction/view-transaction.component.html index ec66cc45a..e488fdd63 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/view-transaction/view-transaction.component.html +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/view-transaction/view-transaction.component.html @@ -15,14 +15,6 @@ } -
} diff --git a/src/app/loans/loans-view/transactions-tab/transactions-tab.component.html b/src/app/loans/loans-view/transactions-tab/transactions-tab.component.html index 00bf57722..9a138bac5 100644 --- a/src/app/loans/loans-view/transactions-tab/transactions-tab.component.html +++ b/src/app/loans/loans-view/transactions-tab/transactions-tab.component.html @@ -177,10 +177,6 @@ } @if (allowUndoTransaction(transaction)) { - - - @if (!transaction.reversed) { - - - - } } - @if (allowUndo()) { - - }
diff --git a/src/app/shared/accounting/view-journal-entry-transaction/view-journal-entry-transaction.component.html b/src/app/shared/accounting/view-journal-entry-transaction/view-journal-entry-transaction.component.html index 3f6ee9887..4fecc1971 100644 --- a/src/app/shared/accounting/view-journal-entry-transaction/view-journal-entry-transaction.component.html +++ b/src/app/shared/accounting/view-journal-entry-transaction/view-journal-entry-transaction.component.html @@ -24,24 +24,6 @@ } -
- @if (dataSource?.data[0].manualEntry) { - - } -
diff --git a/src/app/shared/accounting/view-journal-entry-transaction/view-journal-entry-transaction.component.ts b/src/app/shared/accounting/view-journal-entry-transaction/view-journal-entry-transaction.component.ts index fa6a999a2..2b3f5c753 100644 --- a/src/app/shared/accounting/view-journal-entry-transaction/view-journal-entry-transaction.component.ts +++ b/src/app/shared/accounting/view-journal-entry-transaction/view-journal-entry-transaction.component.ts @@ -8,10 +8,8 @@ import { Component, OnInit, ViewChild, inject } from '@angular/core'; import { ViewJournalEntryComponent } from '../view-journal-entry/view-journal-entry.component'; -import { RevertTransactionComponent } from 'app/accounting/revert-transaction/revert-transaction.component'; -import { AccountingService } from 'app/accounting/accounting.service'; import { MatDialog } from '@angular/material/dialog'; -import { ActivatedRoute, Router } from '@angular/router'; +import { ActivatedRoute } from '@angular/router'; import { MatSort, MatSortHeader } from '@angular/material/sort'; import { MatPaginator } from '@angular/material/paginator'; import { @@ -65,9 +63,7 @@ import { MatTooltipModule } from '@angular/material/tooltip'; ] }) export class ViewJournalEntryTransactionComponent implements OnInit { - private accountingService = inject(AccountingService); private route = inject(ActivatedRoute); - private router = inject(Router); dialog = inject(MatDialog); private location = inject(Location); @@ -147,30 +143,6 @@ export class ViewJournalEntryTransactionComponent implements OnInit { this.dialog.open(ViewJournalEntryComponent, { data: { journalEntry } }); } - revertTransaction(transactionId?: string) { - const revertTransactionDialogRef = this.dialog.open(RevertTransactionComponent, { - data: { reverted: this.dataSource.data[0].reversed, transactionId } - }); - revertTransactionDialogRef.afterClosed().subscribe((response: any) => { - if (response.revert) { - this.accountingService - .revertTransaction(this.transactionId, response.comments) - .subscribe((reversedTransaction: any) => { - this.dataSource.data[0].reversed = true; - this.revertTransaction(reversedTransaction.transactionId); - }); - } else if (response.redirect) { - this.router.navigate( - [ - '../', - transactionId - ], - { relativeTo: this.route } - ); - } - }); - } - goBack(): void { this.location.back(); }