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 <noreply@anthropic.com>
This commit is contained in:
@@ -7,16 +7,6 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="container m-b-20 align-end gap-2px">
|
|
||||||
@if (!viewAccountTransferData.reversed) {
|
|
||||||
<span>
|
|
||||||
<button mat-raised-button color="warn" *mifosxHasPermission="'ADJUST_ACCOUNTTRANSFER'">
|
|
||||||
<fa-icon icon="undo" class="m-r-10"></fa-icon>{{ 'labels.buttons.Undo' | translate }}
|
|
||||||
</button>
|
|
||||||
</span>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<mat-card>
|
<mat-card>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<div class="transfer-container">
|
<div class="transfer-container">
|
||||||
|
|||||||
-12
@@ -135,18 +135,6 @@
|
|||||||
<mat-icon><fa-icon icon="eye" size="sm"></fa-icon></mat-icon>
|
<mat-icon><fa-icon icon="eye" size="sm"></fa-icon></mat-icon>
|
||||||
<span>{{ 'labels.text.View Transaction' | translate }}</span>
|
<span>{{ 'labels.text.View Transaction' | translate }}</span>
|
||||||
</button>
|
</button>
|
||||||
@if (!transaction.reversed) {
|
|
||||||
<span>
|
|
||||||
<button
|
|
||||||
mat-menu-item
|
|
||||||
*mifosxHasPermission="'ADJUSTTRANSACTION_CURRENTACCOUNT'"
|
|
||||||
(click)="undoTransaction(transaction, $event)"
|
|
||||||
>
|
|
||||||
<mat-icon><fa-icon icon="undo" size="sm"></fa-icon></mat-icon>
|
|
||||||
<span>{{ 'tooltips.Undo Transaction' | translate }}</span>
|
|
||||||
</button>
|
|
||||||
</span>
|
|
||||||
}
|
|
||||||
<button
|
<button
|
||||||
mat-menu-item
|
mat-menu-item
|
||||||
class="account-action-button"
|
class="account-action-button"
|
||||||
|
|||||||
-12
@@ -40,18 +40,6 @@
|
|||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
@if (allowUndo()) {
|
|
||||||
<span>
|
|
||||||
<button
|
|
||||||
mat-raised-button
|
|
||||||
color="warn"
|
|
||||||
*mifosxHasPermission="'UNDOTRANSACTION_CURRENTACCOUNT'"
|
|
||||||
(click)="undoTransaction()"
|
|
||||||
>
|
|
||||||
<fa-icon icon="undo" class="m-r-10"></fa-icon>{{ 'labels.buttons.Undo' | translate }}
|
|
||||||
</button>
|
|
||||||
</span>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
-6
@@ -130,12 +130,6 @@
|
|||||||
<mat-icon><fa-icon icon="eye" size="sm"></fa-icon></mat-icon>
|
<mat-icon><fa-icon icon="eye" size="sm"></fa-icon></mat-icon>
|
||||||
<span>{{ 'labels.text.View Transaction' | translate }}</span>
|
<span>{{ 'labels.text.View Transaction' | translate }}</span>
|
||||||
</button>
|
</button>
|
||||||
@if (!isFirstTransaction(idx)) {
|
|
||||||
<button mat-menu-item (click)="undoTransaction(transaction)">
|
|
||||||
<mat-icon><fa-icon icon="undo" size="sm"></fa-icon></mat-icon>
|
|
||||||
<span>{{ 'tooltips.Undo Transaction' | translate }}</span>
|
|
||||||
</button>
|
|
||||||
}
|
|
||||||
<button
|
<button
|
||||||
mat-menu-item
|
mat-menu-item
|
||||||
(click)="routeEdit($event)"
|
(click)="routeEdit($event)"
|
||||||
|
|||||||
+1
-14
@@ -6,20 +6,7 @@
|
|||||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<div class="container m-b-20 align-end-center gap-2percent">
|
<div class="container m-b-20 align-end-center gap-2percent"></div>
|
||||||
@if (allowUndo()) {
|
|
||||||
<span>
|
|
||||||
<button
|
|
||||||
mat-raised-button
|
|
||||||
color="warn"
|
|
||||||
*mifosxHasPermission="'UNDOTRANSACTION_SAVINGSACCOUNT'"
|
|
||||||
(click)="undoTransaction()"
|
|
||||||
>
|
|
||||||
<fa-icon icon="undo" class="m-r-10"></fa-icon>Undo
|
|
||||||
</button>
|
|
||||||
</span>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<mat-card>
|
<mat-card>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
|
|||||||
-8
@@ -15,14 +15,6 @@
|
|||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
<button
|
|
||||||
mat-raised-button
|
|
||||||
color="warn"
|
|
||||||
*mifosxHasPermission="'UNDOTRANSACTION_SAVINGSACCOUNT'"
|
|
||||||
(click)="undoTransaction()"
|
|
||||||
>
|
|
||||||
<fa-icon icon="undo" class="m-r-10"></fa-icon>{{ 'labels.buttons.Undo' | translate }}
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -177,10 +177,6 @@
|
|||||||
}
|
}
|
||||||
@if (allowUndoTransaction(transaction)) {
|
@if (allowUndoTransaction(transaction)) {
|
||||||
<span>
|
<span>
|
||||||
<button mat-menu-item *mifosxHasPermission="'ADJUST_LOAN'" (click)="undoTransaction(transaction, $event)">
|
|
||||||
<mat-icon><fa-icon icon="undo" size="sm"></fa-icon></mat-icon>
|
|
||||||
<span>{{ 'tooltips.Undo Transaction' | translate }}</span>
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
mat-menu-item
|
mat-menu-item
|
||||||
class="account-action-button"
|
class="account-action-button"
|
||||||
|
|||||||
@@ -12,9 +12,6 @@
|
|||||||
<button mat-raised-button color="primary" [routerLink]="'edit'" [disabled]="!allowEdition">
|
<button mat-raised-button color="primary" [routerLink]="'edit'" [disabled]="!allowEdition">
|
||||||
<fa-icon icon="edit" class="m-r-10"></fa-icon>{{ 'Edit' | translate }}
|
<fa-icon icon="edit" class="m-r-10"></fa-icon>{{ 'Edit' | translate }}
|
||||||
</button>
|
</button>
|
||||||
<button mat-raised-button color="warn" (click)="undoTransaction()" [disabled]="!allowUndo">
|
|
||||||
<fa-icon icon="undo" class="m-r-10"></fa-icon>{{ 'Undo' | translate }}
|
|
||||||
</button>
|
|
||||||
</span>
|
</span>
|
||||||
<span *mifosxHasPermission="'CHARGEBACK_LOAN'">
|
<span *mifosxHasPermission="'CHARGEBACK_LOAN'">
|
||||||
<button mat-raised-button color="warn" [disabled]="!allowChargeback" (click)="chargebackTransaction()">
|
<button mat-raised-button color="warn" [disabled]="!allowChargeback" (click)="chargebackTransaction()">
|
||||||
|
|||||||
@@ -128,18 +128,6 @@
|
|||||||
<mat-icon><fa-icon icon="eye" size="sm"></fa-icon></mat-icon>
|
<mat-icon><fa-icon icon="eye" size="sm"></fa-icon></mat-icon>
|
||||||
<span>{{ 'labels.text.View Transaction' | translate }}</span>
|
<span>{{ 'labels.text.View Transaction' | translate }}</span>
|
||||||
</button>
|
</button>
|
||||||
@if (!transaction.reversed) {
|
|
||||||
<span>
|
|
||||||
<button
|
|
||||||
mat-menu-item
|
|
||||||
*mifosxHasPermission="'ADJUSTTRANSACTION_SAVINGSACCOUNT'"
|
|
||||||
(click)="undoTransaction(transaction, $event)"
|
|
||||||
>
|
|
||||||
<mat-icon><fa-icon icon="undo" size="sm"></fa-icon></mat-icon>
|
|
||||||
<span>{{ 'tooltips.Undo Transaction' | translate }}</span>
|
|
||||||
</button>
|
|
||||||
</span>
|
|
||||||
}
|
|
||||||
<button
|
<button
|
||||||
mat-menu-item
|
mat-menu-item
|
||||||
class="account-action-button"
|
class="account-action-button"
|
||||||
|
|||||||
-10
@@ -66,16 +66,6 @@
|
|||||||
<fa-icon icon="lock-open" class="m-r-6"></fa-icon>{{ 'labels.buttons.Release Amount' | translate }}
|
<fa-icon icon="lock-open" class="m-r-6"></fa-icon>{{ 'labels.buttons.Release Amount' | translate }}
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
@if (allowUndo()) {
|
|
||||||
<button
|
|
||||||
mat-flat-button
|
|
||||||
class="txn__btn txn__btn--undo"
|
|
||||||
*mifosxHasPermission="'UNDOTRANSACTION_SAVINGSACCOUNT'"
|
|
||||||
(click)="undoTransaction()"
|
|
||||||
>
|
|
||||||
<fa-icon icon="undo" class="m-r-6"></fa-icon>{{ 'labels.buttons.Undo' | translate }}
|
|
||||||
</button>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
-18
@@ -24,24 +24,6 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="txn-header-bar__actions">
|
|
||||||
@if (dataSource?.data[0].manualEntry) {
|
|
||||||
<button
|
|
||||||
mat-raised-button
|
|
||||||
color="warn"
|
|
||||||
(click)="revertTransaction()"
|
|
||||||
*mifosxHasPermission="'REVERSE_JOURNALENTRY'"
|
|
||||||
[disabled]="dataSource?.data[0].reversed"
|
|
||||||
class="txn-revert-btn"
|
|
||||||
>
|
|
||||||
@if (!dataSource.data[0].reversed) {
|
|
||||||
<span><fa-icon icon="undo" class="m-r-6"></fa-icon>Revert Transaction</span>
|
|
||||||
} @else {
|
|
||||||
<span><fa-icon icon="check-circle" class="m-r-6"></fa-icon>Reverted</span>
|
|
||||||
}
|
|
||||||
</button>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Transaction Info Cards -->
|
<!-- Transaction Info Cards -->
|
||||||
|
|||||||
+1
-29
@@ -8,10 +8,8 @@
|
|||||||
|
|
||||||
import { Component, OnInit, ViewChild, inject } from '@angular/core';
|
import { Component, OnInit, ViewChild, inject } from '@angular/core';
|
||||||
import { ViewJournalEntryComponent } from '../view-journal-entry/view-journal-entry.component';
|
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 { MatDialog } from '@angular/material/dialog';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { MatSort, MatSortHeader } from '@angular/material/sort';
|
import { MatSort, MatSortHeader } from '@angular/material/sort';
|
||||||
import { MatPaginator } from '@angular/material/paginator';
|
import { MatPaginator } from '@angular/material/paginator';
|
||||||
import {
|
import {
|
||||||
@@ -65,9 +63,7 @@ import { MatTooltipModule } from '@angular/material/tooltip';
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class ViewJournalEntryTransactionComponent implements OnInit {
|
export class ViewJournalEntryTransactionComponent implements OnInit {
|
||||||
private accountingService = inject(AccountingService);
|
|
||||||
private route = inject(ActivatedRoute);
|
private route = inject(ActivatedRoute);
|
||||||
private router = inject(Router);
|
|
||||||
dialog = inject(MatDialog);
|
dialog = inject(MatDialog);
|
||||||
private location = inject(Location);
|
private location = inject(Location);
|
||||||
|
|
||||||
@@ -147,30 +143,6 @@ export class ViewJournalEntryTransactionComponent implements OnInit {
|
|||||||
this.dialog.open(ViewJournalEntryComponent, { data: { journalEntry } });
|
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 {
|
goBack(): void {
|
||||||
this.location.back();
|
this.location.back();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user