feat(cashier,organization): denomination-aware vault UI, Bank/Branch Profile screens, popup disbursement review
Branch Day open/close now captures a denomination-wise count (carried forward automatically to the next day), and shows an auto-fetched EOD summary at close time -- vault + every cashier's position, a branch-total reconciliation against the book figure, and each cashier's reconciliation/settlement status and transaction count -- so closing the day no longer means separately checking Vault Position and every cashier's own screen by hand. New Vault Position screen (branch-ops menu) mirrors Cashier Position for the teller/vault. Cash Transfer now shows the vault's live per-denomination availability while counting a handout, with a client-side warning before it can be over-counted. New Organization screens for Bank Profile, Branch Profile and Clearing GL Configuration, wired into the Organization landing page and the previously-dead "Bank Profile" admin menu button. Cashier Transaction Entry: TYPE is now Receipt/Payment only (cash-only TXN TP.) on the cashier side, with no change to the clerk dashboard's own Withdrawal Slip/Cheque/Disbursement/Enter Bank Transfer/DD flow beyond adding a new Fund Transfer type alongside Disbursement for a GL credit that isn't a loan payout. Neither TYPE nor TXN TP. offers a blank placeholder option anymore -- a new row starts on a real default instead. Footer no longer polls the business-date config for cashier/clerk roles, who never have permission to read it. Disbursement & Transfer Requests: "Review" now opens the review screen as a popup instead of navigating to a separate route, refreshing the list on close; the review screen recognises the new Fund Transfer request type too, and its non-functional "+ Disbursement Review" tab-styled label is now a plain heading. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,163 @@
|
||||
<!--
|
||||
Copyright since 2025 Mifos Initiative
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
-->
|
||||
|
||||
<div class="bp-container">
|
||||
<div class="bp-header">
|
||||
<button mat-stroked-button [routerLink]="['/organization']" class="bp-back">
|
||||
<i class="fas fa-arrow-left"></i> Organization
|
||||
</button>
|
||||
<h2 class="bp-header__title">Branch Profile</h2>
|
||||
</div>
|
||||
|
||||
@if (errorMsg) {
|
||||
<div class="bp-alert bp-alert--error">{{ errorMsg }}</div>
|
||||
}
|
||||
@if (successMsg) {
|
||||
<div class="bp-alert bp-alert--success">{{ successMsg }}</div>
|
||||
}
|
||||
|
||||
<div class="bp-card">
|
||||
<div class="bp-section">
|
||||
<div class="bp-section__header">
|
||||
<i class="fas fa-code-branch"></i>
|
||||
<h3>Select Branch</h3>
|
||||
</div>
|
||||
<div class="bp-body">
|
||||
@if (loadingOffices) {
|
||||
<span class="bp-muted">Loading branches…</span>
|
||||
} @else {
|
||||
<mat-form-field appearance="outline" class="bp-field">
|
||||
<mat-label>Branch</mat-label>
|
||||
<mat-select [value]="selectedOfficeId" (selectionChange)="selectOffice($event.value)">
|
||||
@for (o of offices; track o.officeId) {
|
||||
<mat-option [value]="o.officeId">{{ officeLabel(o) }}</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (loadingProfile) {
|
||||
<div class="bp-loading">Loading…</div>
|
||||
}
|
||||
|
||||
@if (selectedOfficeId && !loadingProfile) {
|
||||
<form [formGroup]="form" (ngSubmit)="submit()">
|
||||
<div class="bp-section">
|
||||
<div class="bp-section__header">
|
||||
<i class="fas fa-id-card"></i>
|
||||
<h3>Branch Details</h3>
|
||||
</div>
|
||||
<div class="bp-body">
|
||||
<mat-form-field appearance="outline" class="bp-field bp-field--half">
|
||||
<mat-label>Branch Code</mat-label>
|
||||
<input matInput formControlName="branchCode" placeholder="e.g. BR001" />
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" class="bp-field bp-field--half">
|
||||
<mat-label>Branch Type</mat-label>
|
||||
<mat-select formControlName="branchType">
|
||||
@for (t of branchTypes; track t.value) {
|
||||
<mat-option [value]="t.value">{{ t.label }}</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" class="bp-field">
|
||||
<mat-label>Address</mat-label>
|
||||
<textarea matInput formControlName="address" rows="2"></textarea>
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" class="bp-field bp-field--half">
|
||||
<mat-label>Contact Phone</mat-label>
|
||||
<input matInput formControlName="contactPhone" />
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" class="bp-field bp-field--half">
|
||||
<mat-label>Contact Email</mat-label>
|
||||
<input matInput type="email" formControlName="contactEmail" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bp-section">
|
||||
<div class="bp-section__header">
|
||||
<i class="fas fa-landmark"></i>
|
||||
<h3>Branch Identifiers</h3>
|
||||
</div>
|
||||
<div class="bp-body">
|
||||
<mat-form-field appearance="outline" class="bp-field bp-field--half">
|
||||
<mat-label>IFSC Code</mat-label>
|
||||
<input matInput formControlName="ifscCode" placeholder="e.g. SUCB0000123" />
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" class="bp-field bp-field--half">
|
||||
<mat-label>MICR Code</mat-label>
|
||||
<input matInput formControlName="micrCode" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<p class="bp-note">
|
||||
SWIFT/BIC is set once for the whole bank, not per branch — see
|
||||
<a [routerLink]="['/organization/institution-profile']">Bank Profile</a>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="bp-section">
|
||||
<div class="bp-section__header">
|
||||
<i class="fas fa-map-marked-alt"></i>
|
||||
<h3>Location (optional)</h3>
|
||||
</div>
|
||||
<div class="bp-body">
|
||||
<mat-form-field appearance="outline" class="bp-field bp-field--half">
|
||||
<mat-label>Latitude</mat-label>
|
||||
<input matInput type="number" step="0.000001" formControlName="latitude" />
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" class="bp-field bp-field--half">
|
||||
<mat-label>Longitude</mat-label>
|
||||
<input matInput type="number" step="0.000001" formControlName="longitude" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bp-section">
|
||||
<div class="bp-section__header">
|
||||
<i class="fas fa-clock"></i>
|
||||
<h3>Working Hours</h3>
|
||||
</div>
|
||||
<div class="bp-body">
|
||||
<mat-form-field appearance="outline" class="bp-field bp-field--third">
|
||||
<mat-label>Opens At</mat-label>
|
||||
<input matInput type="time" formControlName="workingHoursStart" />
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" class="bp-field bp-field--third">
|
||||
<mat-label>Closes At</mat-label>
|
||||
<input matInput type="time" formControlName="workingHoursEnd" />
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" class="bp-field bp-field--third">
|
||||
<mat-label>Working Days</mat-label>
|
||||
<input matInput formControlName="workingDays" placeholder="e.g. Mon-Sat" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (lastUpdated) {
|
||||
<div class="bp-lastupdated">Last updated by {{ lastUpdated.by }} · {{ lastUpdated.at | dateFormat }}</div>
|
||||
}
|
||||
|
||||
<div class="bp-actions">
|
||||
<button
|
||||
type="submit"
|
||||
mat-flat-button
|
||||
color="primary"
|
||||
[disabled]="form.pristine || saving"
|
||||
*mifosxHasPermission="'UPDATE_BRANCHPROFILE'"
|
||||
class="bp-actions__submit"
|
||||
>
|
||||
<i class="fas fa-check"></i> Save
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,175 @@
|
||||
/**
|
||||
* Copyright since 2025 Mifos Initiative
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
$primary: #1353a0;
|
||||
$accent: #0ea5e9;
|
||||
$border: #e2e8f0;
|
||||
$gray-50: #f8f9fa;
|
||||
$gray-200: #e8eaed;
|
||||
$gray-500: #9aa0a6;
|
||||
$gray-900: #202124;
|
||||
|
||||
.bp-container {
|
||||
max-width: 760px;
|
||||
margin: 0 auto;
|
||||
padding: 20px 16px;
|
||||
}
|
||||
|
||||
.bp-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
margin-bottom: 20px;
|
||||
|
||||
&__title {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: $gray-900;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.bp-back {
|
||||
border-radius: 8px !important;
|
||||
font-size: 12px !important;
|
||||
font-weight: 600 !important;
|
||||
height: 32px !important;
|
||||
border-color: $border !important;
|
||||
color: $gray-500 !important;
|
||||
|
||||
i {
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: $primary !important;
|
||||
border-color: $primary !important;
|
||||
}
|
||||
}
|
||||
|
||||
.bp-alert {
|
||||
padding: 10px 14px;
|
||||
margin-bottom: 14px;
|
||||
border-radius: 8px;
|
||||
font-size: 13px;
|
||||
|
||||
&--error {
|
||||
background: #fef2f2;
|
||||
border: 1px solid #fecaca;
|
||||
color: #991b1b;
|
||||
}
|
||||
|
||||
&--success {
|
||||
background: #f0fdf4;
|
||||
border: 1px solid #bbf7d0;
|
||||
color: #14532d;
|
||||
}
|
||||
}
|
||||
|
||||
.bp-muted {
|
||||
color: $gray-500;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.bp-loading {
|
||||
padding: 24px;
|
||||
text-align: center;
|
||||
color: $gray-500;
|
||||
}
|
||||
|
||||
.bp-card {
|
||||
background: #fff;
|
||||
border: 1px solid $border;
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.bp-section {
|
||||
&__header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 12px 24px;
|
||||
background: $gray-50;
|
||||
border-bottom: 1px solid $gray-200;
|
||||
|
||||
i {
|
||||
font-size: 14px;
|
||||
color: $accent;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: $gray-900;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bp-body {
|
||||
padding: 20px 24px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0 16px;
|
||||
}
|
||||
|
||||
.bp-field {
|
||||
width: 100%;
|
||||
margin-bottom: 4px;
|
||||
|
||||
&--half {
|
||||
width: calc(50% - 8px);
|
||||
}
|
||||
|
||||
&--third {
|
||||
width: calc(33.33% - 11px);
|
||||
}
|
||||
}
|
||||
|
||||
.bp-note {
|
||||
margin: 0 24px 16px;
|
||||
padding: 8px 12px;
|
||||
background: #eff6ff;
|
||||
border: 1px solid #bfdbfe;
|
||||
border-radius: 6px;
|
||||
font-size: 11px;
|
||||
color: #1e40af;
|
||||
|
||||
a {
|
||||
color: $primary;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.bp-lastupdated {
|
||||
padding: 0 24px 10px;
|
||||
font-size: 11px;
|
||||
color: $gray-500;
|
||||
}
|
||||
|
||||
.bp-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
padding: 14px 24px;
|
||||
border-top: 1px solid $gray-200;
|
||||
background: $gray-50;
|
||||
|
||||
&__submit {
|
||||
border-radius: 8px !important;
|
||||
font-size: 13px !important;
|
||||
font-weight: 600 !important;
|
||||
height: 36px !important;
|
||||
box-shadow: 0 1px 3px rgba($primary, 0.3) !important;
|
||||
|
||||
i {
|
||||
margin-right: 6px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
/**
|
||||
* Copyright since 2025 Mifos Initiative
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { Component, OnInit, inject } from '@angular/core';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { catchError, of } from 'rxjs';
|
||||
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
import { OrganizationService } from '../organization.service';
|
||||
|
||||
const BRANCH_TYPES = [
|
||||
{ value: 'HEAD_OFFICE', label: 'Head Office' },
|
||||
{ value: 'BRANCH', label: 'Branch' },
|
||||
{ value: 'REGIONAL_OFFICE', label: 'Regional Office' },
|
||||
{ value: 'ZONAL_OFFICE', label: 'Zonal Office' }
|
||||
];
|
||||
|
||||
/**
|
||||
* The real-world operational fields behind a branch — code, address, contact, type and working
|
||||
* hours — kept as their own screen on top of the stock Manage Offices flow, since m_office (the
|
||||
* core Fineract entity) was deliberately left untouched. Pick an office, fill in what real-world
|
||||
* UCB branch setup expects, save.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'mifosx-branch-profile',
|
||||
templateUrl: './branch-profile.component.html',
|
||||
styleUrls: ['./branch-profile.component.scss'],
|
||||
imports: [...STANDALONE_SHARED_IMPORTS]
|
||||
})
|
||||
export class BranchProfileComponent implements OnInit {
|
||||
private formBuilder = inject(UntypedFormBuilder);
|
||||
private organizationService = inject(OrganizationService);
|
||||
|
||||
branchTypes = BRANCH_TYPES;
|
||||
|
||||
offices: any[] = [];
|
||||
selectedOfficeId: number | null = null;
|
||||
form: UntypedFormGroup;
|
||||
|
||||
loadingOffices = true;
|
||||
loadingProfile = false;
|
||||
saving = false;
|
||||
errorMsg = '';
|
||||
successMsg = '';
|
||||
lastUpdated: any = null;
|
||||
|
||||
ngOnInit(): void {
|
||||
this.form = this.formBuilder.group({
|
||||
branchCode: [''],
|
||||
branchType: [null],
|
||||
address: [''],
|
||||
contactPhone: [''],
|
||||
contactEmail: [''],
|
||||
workingHoursStart: [''],
|
||||
workingHoursEnd: [''],
|
||||
workingDays: [''],
|
||||
ifscCode: [''],
|
||||
micrCode: [''],
|
||||
latitude: [null],
|
||||
longitude: [null]
|
||||
});
|
||||
|
||||
this.organizationService
|
||||
.getBranchProfiles()
|
||||
.pipe(
|
||||
catchError((err: any) => {
|
||||
this.errorMsg = err?.error?.errors?.[0]?.defaultUserMessage ?? 'Could not load branches.';
|
||||
return of([]);
|
||||
})
|
||||
)
|
||||
.subscribe((res: any[]) => {
|
||||
this.loadingOffices = false;
|
||||
this.offices = res || [];
|
||||
if (this.offices.length === 1) {
|
||||
this.selectOffice(this.offices[0].officeId);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
selectOffice(officeId: number): void {
|
||||
this.selectedOfficeId = officeId;
|
||||
this.loadingProfile = true;
|
||||
this.errorMsg = '';
|
||||
this.successMsg = '';
|
||||
this.organizationService
|
||||
.getBranchProfile(officeId)
|
||||
.pipe(
|
||||
catchError((err: any) => {
|
||||
this.loadingProfile = false;
|
||||
this.errorMsg = err?.error?.errors?.[0]?.defaultUserMessage ?? 'Could not load this branch.';
|
||||
return of(null);
|
||||
})
|
||||
)
|
||||
.subscribe((res: any) => {
|
||||
this.loadingProfile = false;
|
||||
if (!res) return;
|
||||
this.form.patchValue({
|
||||
branchCode: res.branchCode ?? '',
|
||||
branchType: res.branchType ?? null,
|
||||
address: res.address ?? '',
|
||||
contactPhone: res.contactPhone ?? '',
|
||||
contactEmail: res.contactEmail ?? '',
|
||||
workingHoursStart: res.workingHoursStart ?? '',
|
||||
workingHoursEnd: res.workingHoursEnd ?? '',
|
||||
workingDays: res.workingDays ?? '',
|
||||
ifscCode: res.ifscCode ?? '',
|
||||
micrCode: res.micrCode ?? '',
|
||||
latitude: res.latitude ?? null,
|
||||
longitude: res.longitude ?? null
|
||||
});
|
||||
this.lastUpdated = res.updatedByUsername ? { by: res.updatedByUsername, at: res.updatedAt } : null;
|
||||
this.form.markAsPristine();
|
||||
// Reflect the just-loaded office in the list so the selector stays accurate without a reload.
|
||||
const idx = this.offices.findIndex((o) => o.officeId === officeId);
|
||||
if (idx >= 0) this.offices[idx] = res;
|
||||
});
|
||||
}
|
||||
|
||||
officeLabel(o: any): string {
|
||||
return o.branchCode ? `${o.officeName} (${o.branchCode})` : o.officeName;
|
||||
}
|
||||
|
||||
submit(): void {
|
||||
if (this.saving || !this.selectedOfficeId) return;
|
||||
this.saving = true;
|
||||
this.errorMsg = '';
|
||||
this.successMsg = '';
|
||||
this.organizationService
|
||||
.updateBranchProfile(this.selectedOfficeId, this.form.value)
|
||||
.pipe(
|
||||
catchError((err: any) => {
|
||||
this.saving = false;
|
||||
this.errorMsg = err?.error?.errors?.[0]?.defaultUserMessage ?? 'Could not save this branch.';
|
||||
return of(null);
|
||||
})
|
||||
)
|
||||
.subscribe((res: any) => {
|
||||
this.saving = false;
|
||||
if (!res) return;
|
||||
this.successMsg = 'Branch profile saved.';
|
||||
this.form.markAsPristine();
|
||||
this.lastUpdated = res.updatedByUsername ? { by: res.updatedByUsername, at: res.updatedAt } : null;
|
||||
const idx = this.offices.findIndex((o) => o.officeId === this.selectedOfficeId);
|
||||
if (idx >= 0) this.offices[idx] = res;
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user