feat: implement cashier dashboard, dividend dashboards, share accounts views, and checker tasks
This commit is contained in:
@@ -47,7 +47,12 @@ export class ErrorHandlerInterceptor implements HttpInterceptor {
|
||||
private handleError(response: HttpErrorResponse, request: HttpRequest<any>): Observable<HttpEvent<any>> {
|
||||
const status = response.status;
|
||||
const errorBody = response.error;
|
||||
let errorMessage = errorBody?.developerMessage || response.message;
|
||||
// defaultUserMessage first: it is the sentence written for the person reading it, while
|
||||
// developerMessage is for the log. Falling back to response.message last, since that is
|
||||
// Angular's own "Http failure response for <url>: 409 Conflict" — a description of the
|
||||
// transport, not of what went wrong, and useless to whoever is looking at the dialog.
|
||||
let errorMessage =
|
||||
errorBody?.defaultUserMessage || errorBody?.developerMessage || errorBody?.message || response.message;
|
||||
if (errorBody?.errors?.[0]) {
|
||||
errorMessage = errorBody.errors[0].defaultUserMessage || errorBody.errors[0].developerMessage;
|
||||
}
|
||||
@@ -104,6 +109,15 @@ export class ErrorHandlerInterceptor implements HttpInterceptor {
|
||||
type: this.translate.instant('error.resource.not.found'),
|
||||
message: errorMessage || 'Resource does not exist!'
|
||||
};
|
||||
} else if (status === 409) {
|
||||
// A 409 is not a failure of permission or of the request itself — the action is simply not
|
||||
// allowed in the record's current state (already approved, maker cannot check their own work,
|
||||
// a guarantee still outstanding). The server always explains which, so its message is shown
|
||||
// as-is under a title that does not contradict it.
|
||||
alert = {
|
||||
type: 'Action Not Allowed',
|
||||
message: errorMessage || 'This action is not allowed in the current state.'
|
||||
};
|
||||
} else if (status === 500) {
|
||||
alert = { type: 'Internal Server Error', message: 'Internal Server Error. Please try again later.' };
|
||||
} else if (status === 501) {
|
||||
|
||||
@@ -173,6 +173,20 @@
|
||||
Today's Activity
|
||||
</a>
|
||||
}
|
||||
<!-- Outside the clerkAccountLoaded block on purpose: an open exception has to be
|
||||
reachable whether or not the clerk currently has an account loaded. -->
|
||||
<a
|
||||
class="cashier-nav__item cashier-nav__item--sec"
|
||||
[class.cashier-nav__item--active]="currentUrl.includes('/cashier/voucher-exceptions')"
|
||||
[routerLink]="['/cashier/voucher-exceptions']"
|
||||
>
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" />
|
||||
<line x1="12" y1="9" x2="12" y2="13" />
|
||||
<line x1="12" y1="17" x2="12.01" y2="17" />
|
||||
</svg>
|
||||
Exceptions
|
||||
</a>
|
||||
<span class="cashier-nav__esc-hint" (click)="onEscapeKey()"> <kbd>ESC</kbd> Show Header </span>
|
||||
</nav>
|
||||
} @else {
|
||||
@@ -234,6 +248,20 @@
|
||||
>
|
||||
<fa-icon icon="history"></fa-icon> Cash History
|
||||
</a>
|
||||
<a
|
||||
class="cashier-nav__item"
|
||||
[routerLink]="['/cashier/day-book']"
|
||||
routerLinkActive="cashier-nav__item--active"
|
||||
>
|
||||
<fa-icon icon="book"></fa-icon> Day Book
|
||||
</a>
|
||||
<a
|
||||
class="cashier-nav__item"
|
||||
[routerLink]="['/cashier/voucher-exceptions']"
|
||||
routerLinkActive="cashier-nav__item--active"
|
||||
>
|
||||
<fa-icon icon="exclamation-triangle"></fa-icon> Exceptions
|
||||
</a>
|
||||
<a
|
||||
class="cashier-nav__item"
|
||||
[routerLink]="['/cashier/closing-report']"
|
||||
@@ -430,14 +458,13 @@
|
||||
<fa-icon icon="money-bill" class="ni-ico"></fa-icon>Cashier
|
||||
<fa-icon icon="caret-down" class="ni-caret"></fa-icon>
|
||||
</a>
|
||||
<a
|
||||
class="ni"
|
||||
tabindex="0"
|
||||
routerLink="/clerk/dashboard"
|
||||
(click)="hideShellLayout = true"
|
||||
*mifosxHasPermission="'MENU_CLERK'"
|
||||
>
|
||||
<a class="ni" tabindex="0" [matMenuTriggerFor]="clerkMenu" *mifosxHasPermission="'MENU_CLERK'">
|
||||
<fa-icon icon="id-card" class="ni-ico"></fa-icon>Clerk
|
||||
<fa-icon icon="caret-down" class="ni-caret"></fa-icon>
|
||||
</a>
|
||||
<a class="ni" tabindex="0" [matMenuTriggerFor]="branchOpsMenu" *mifosxHasPermission="'MENU_BRANCH_OPS'">
|
||||
<fa-icon icon="building" class="ni-ico"></fa-icon>Branch Ops
|
||||
<fa-icon icon="caret-down" class="ni-caret"></fa-icon>
|
||||
</a>
|
||||
<a class="ni" tabindex="0" [matMenuTriggerFor]="clearingMenu" *mifosxHasPermission="'MENU_CLEARING'">
|
||||
<fa-icon icon="exchange" class="ni-ico"></fa-icon>Clearing
|
||||
@@ -582,6 +609,9 @@
|
||||
</mat-menu>
|
||||
|
||||
<mat-menu #reportsMenu="matMenu" [overlapTrigger]="false" class="nav-dropdown">
|
||||
<button mat-menu-item [routerLink]="['/branch-ops/account-register']" tabindex="0">
|
||||
<i class="fa fa-book menu-item-icon"></i> Account Register
|
||||
</button>
|
||||
<button mat-menu-item [routerLink]="['/reports']" tabindex="0">
|
||||
<i class="fa fa-th-list menu-item-icon"></i> All Reports
|
||||
</button>
|
||||
@@ -993,6 +1023,41 @@
|
||||
}
|
||||
|
||||
<!-- Sub Menu Dropdowns -->
|
||||
<!-- Branch-level operations. Starts with the day register; other branch-wide controls belong
|
||||
here rather than under Cashier, which is one role's workspace. -->
|
||||
<mat-menu #branchOpsMenu="matMenu" [overlapTrigger]="false" class="nav-dropdown">
|
||||
<button mat-menu-item tabindex="0" [routerLink]="['/branch-ops/day-register']">
|
||||
<fa-icon icon="calendar-check" class="menu-item-icon"></fa-icon> Day Open / Day Close
|
||||
</button>
|
||||
<button mat-menu-item tabindex="0" [routerLink]="['/branch-ops/missed-close']">
|
||||
<fa-icon icon="exclamation-triangle" class="menu-item-icon"></fa-icon> Missed Close Register
|
||||
</button>
|
||||
</mat-menu>
|
||||
|
||||
<!-- Clerk was a bare link straight into the fullscreen dashboard, which left the clerk's other
|
||||
screens reachable only from inside that fullscreen nav. Anything a clerk needs from the
|
||||
normal shell — an open voucher exception above all — belongs here. -->
|
||||
<mat-menu #clerkMenu="matMenu" [overlapTrigger]="false" class="nav-dropdown">
|
||||
<button mat-menu-item tabindex="0" routerLink="/clerk/dashboard" (click)="hideShellLayout = true">
|
||||
<fa-icon icon="id-card" class="menu-item-icon"></fa-icon> Clerk Dashboard
|
||||
</button>
|
||||
<button mat-menu-item tabindex="0" [routerLink]="['/cashier/voucher-exceptions']">
|
||||
<fa-icon icon="exclamation-triangle" class="menu-item-icon"></fa-icon> Voucher Exceptions
|
||||
</button>
|
||||
<button mat-menu-item tabindex="0" [routerLink]="['/cashier/day-book']">
|
||||
<fa-icon icon="book" class="menu-item-icon"></fa-icon> Day Book
|
||||
</button>
|
||||
<button mat-menu-item tabindex="0" [routerLink]="['/clerk/withdrawal-requests']">
|
||||
<fa-icon icon="money-bill-wave" class="menu-item-icon"></fa-icon> My Withdrawal Requests
|
||||
</button>
|
||||
<button mat-menu-item tabindex="0" [routerLink]="['/clerk/my-disbursement-requests']">
|
||||
<fa-icon icon="exchange" class="menu-item-icon"></fa-icon> My Disbursement Requests
|
||||
</button>
|
||||
<button mat-menu-item tabindex="0" [routerLink]="['/clerk/dividend-dashboard']">
|
||||
<fa-icon icon="chart-pie" class="menu-item-icon"></fa-icon> Dividend Dashboard
|
||||
</button>
|
||||
</mat-menu>
|
||||
|
||||
<mat-menu #cashierMenu="matMenu" [overlapTrigger]="false" class="nav-dropdown">
|
||||
<button mat-menu-item tabindex="0" [routerLink]="['/cashier/cash-exchange']">
|
||||
<fa-icon icon="exchange" class="menu-item-icon"></fa-icon> Cash Exchange Entry
|
||||
@@ -1027,6 +1092,12 @@
|
||||
<button mat-menu-item tabindex="0" [routerLink]="['/cashier/cash-history']">
|
||||
<fa-icon icon="history" class="menu-item-icon"></fa-icon> Cash History
|
||||
</button>
|
||||
<button mat-menu-item tabindex="0" [routerLink]="['/cashier/day-book']">
|
||||
<fa-icon icon="book" class="menu-item-icon"></fa-icon> Day Book
|
||||
</button>
|
||||
<button mat-menu-item tabindex="0" [routerLink]="['/cashier/voucher-exceptions']">
|
||||
<fa-icon icon="exclamation-triangle" class="menu-item-icon"></fa-icon> Voucher Exceptions
|
||||
</button>
|
||||
<button mat-menu-item tabindex="0" [routerLink]="['/cashier/transaction-entry']">
|
||||
<fa-icon icon="keyboard" class="menu-item-icon"></fa-icon> Transaction Entry
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user