diff --git a/src/app/cashier/transaction-entry/transaction-entry.component.ts b/src/app/cashier/transaction-entry/transaction-entry.component.ts index aa4c8ca6f..940287102 100644 --- a/src/app/cashier/transaction-entry/transaction-entry.component.ts +++ b/src/app/cashier/transaction-entry/transaction-entry.component.ts @@ -6041,7 +6041,12 @@ export class TransactionEntryComponent implements OnInit, OnDestroy { this.editRequest = req; } - const acTyp = 'SD'; + // Same bug, same fix as the token-driven withdrawal-slip lookup above (see its comment): the + // request carries its own real account_type (SAVINGS, CURRENT, FIXED_DEPOSIT or + // RECURRING_DEPOSIT), and hardcoding 'SD' here searched every non-savings account on the + // wrong endpoint, so reviewing a Current-account withdrawal always failed with "Account not + // found". + const acTyp = TransactionEntryComponent.SEARCH_ACCOUNT_TYPE_TO_AC_TYP[req.account_type || ''] || 'SD'; const row = this.rows[0]; row.acNo = req.account_no ?? ''; row.acTyp = acTyp; diff --git a/src/app/current-accounts/current-account-view/passbook-tab/passbook-tab.component.html b/src/app/current-accounts/current-account-view/passbook-tab/passbook-tab.component.html index d9c5887a3..97a08deac 100644 --- a/src/app/current-accounts/current-account-view/passbook-tab/passbook-tab.component.html +++ b/src/app/current-accounts/current-account-view/passbook-tab/passbook-tab.component.html @@ -54,8 +54,8 @@ account_balance
-
LincPay Co-operative Bank Ltd.
-
Current Account Statement
+
{{ bankName }}
+
{{ bankSubtitle }}
@@ -64,6 +64,25 @@
+ + @if (branchName || ifscCode || micrCode) { +
+ @if (branchName) { + {{ branchName }} Branch + } + @if (branchAddress) { + {{ branchAddress }} + } + @if (ifscCode) { + IFSC: {{ ifscCode }} + } + @if (micrCode) { + MICR: {{ micrCode }} + } +
+ } +
diff --git a/src/app/current-accounts/current-account-view/passbook-tab/passbook-tab.component.scss b/src/app/current-accounts/current-account-view/passbook-tab/passbook-tab.component.scss index 647d16d12..50d73a7f2 100644 --- a/src/app/current-accounts/current-account-view/passbook-tab/passbook-tab.component.scss +++ b/src/app/current-accounts/current-account-view/passbook-tab/passbook-tab.component.scss @@ -127,6 +127,18 @@ $header-text: #fff; } } +// ─── Branch Identification Line ────────────────────────────────────────────── +.branch-line { + background: #e8edf5; + border-bottom: 1px solid $border-color; + padding: 6px 24px; + display: flex; + flex-wrap: wrap; + gap: 4px 18px; + font-size: 11px; + color: #4a5a7a; +} + // ─── Account Details Band ──────────────────────────────────────────────────── .account-details-band { background: #f0f3f9; diff --git a/src/app/current-accounts/current-account-view/passbook-tab/passbook-tab.component.ts b/src/app/current-accounts/current-account-view/passbook-tab/passbook-tab.component.ts index 697d53a5c..2c04ece28 100644 --- a/src/app/current-accounts/current-account-view/passbook-tab/passbook-tab.component.ts +++ b/src/app/current-accounts/current-account-view/passbook-tab/passbook-tab.component.ts @@ -11,11 +11,12 @@ import { Component, OnInit, OnDestroy, inject, ElementRef, ViewChild } from '@an import { ActivatedRoute } from '@angular/router'; import { UntypedFormBuilder } from '@angular/forms'; import { CurrencyPipe } from '@angular/common'; -import { Subject, takeUntil } from 'rxjs'; +import { Subject, takeUntil, catchError, forkJoin, of } from 'rxjs'; /** Custom Services */ import { SettingsService } from 'app/settings/settings.service'; import { Dates } from 'app/core/utils/dates'; +import { OrganizationService } from '../../../organization/organization.service'; import { Currency } from 'app/shared/models/general.model'; import { CurrentAccountTransaction, @@ -44,6 +45,7 @@ export class PassbookTabComponent implements OnInit, OnDestroy { private formBuilder = inject(UntypedFormBuilder); private settingsService = inject(SettingsService); private dateUtils = inject(Dates); + private organizationService = inject(OrganizationService); private destroy$ = new Subject(); @@ -60,6 +62,17 @@ export class PassbookTabComponent implements OnInit, OnDestroy { availableBalance: number = 0; activatedOnDate: any = null; + /** Bank/branch letterhead — real values from Institution Profile + Branch Profile (Organization + * module) rather than a hardcoded name, so a printed passbook actually identifies which bank and + * branch issued it, the way a real UCB's core banking system does. Falls back to a generic label + * if the profile was never filled in, rather than showing a fabricated bank name. */ + bankName = 'Bank'; + bankSubtitle = 'Current Account Statement'; + branchName = ''; + branchAddress = ''; + ifscCode = ''; + micrCode = ''; + /** Transactions */ allTransactions: CurrentAccountTransaction[] = []; filteredTransactions: CurrentAccountTransaction[] = []; @@ -92,6 +105,33 @@ export class PassbookTabComponent implements OnInit, OnDestroy { fromDate: [''], toDate: [''] }); + + this.loadLetterhead(); + } + + /** Institution Profile is the bank's own single record; Branch Profile is per-office. There is no + * office id on the current account data reaching this tab, and this deployment runs a single + * branch, so the first branch profile on record is the correct one here — a genuinely + * multi-branch deployment would need the account's own office id threaded through instead. */ + private loadLetterhead(): void { + forkJoin({ + institution: this.organizationService.getInstitutionProfile().pipe(catchError(() => of(null))), + branches: this.organizationService.getBranchProfiles().pipe(catchError(() => of([]))) + }).subscribe(({ institution, branches }: any) => { + if (institution) { + this.bankName = institution.passbookHeaderName || institution.bankName || institution.legalName || 'Bank'; + this.bankSubtitle = institution.licenseNumber + ? `Lic. No. ${institution.licenseNumber}` + : 'Current Account Statement'; + } + const branch = Array.isArray(branches) ? branches[0] : null; + if (branch) { + this.branchName = branch.officeName || ''; + this.branchAddress = branch.address || ''; + this.ifscCode = branch.ifscCode || ''; + this.micrCode = branch.micrCode || ''; + } + }); } private computeRunningBalances(transactions: CurrentAccountTransaction[]): CurrentAccountTransaction[] { @@ -279,6 +319,18 @@ export class PassbookTabComponent implements OnInit, OnDestroy { margin-top: 3px; } + /* Branch identification line */ + .branch-line { + background: #e8edf5; + border-bottom: 1px solid #d0d7e3; + padding: 5px 20px; + display: flex; + flex-wrap: wrap; + gap: 4px 16px; + font-size: 9.5px; + color: #4a5a7a; + } + /* Account details band */ .account-details-band { background: #f0f3f9; diff --git a/src/assets/env.js b/src/assets/env.js index e7ec0e8c1..410cacdc0 100644 --- a/src/assets/env.js +++ b/src/assets/env.js @@ -20,8 +20,8 @@ // Tenants the login screen offers, and which one it starts on. Every identifier here has to exist // in the tenants table of the tenant-store database, or the platform rejects the request as an // unknown tenant. - window["env"]["fineractPlatformTenantId"] = 'lincpay'; - window["env"]["fineractPlatformTenantIds"] = 'lincpay'; + window["env"]["fineractPlatformTenantId"] = 'utkarshbank'; + window["env"]["fineractPlatformTenantIds"] = 'utkarshbank'; window['env']['tenantLogoUrl'] = ''; window['env']['tenantLogoUrlDark'] = ''; diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index d7885aac8..3b02a7373 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -19,8 +19,8 @@ export const environment = { version: env.mifos_x.version, hash: env.mifos_x.hash, // For connecting to server running elsewhere update the tenant identifier - fineractPlatformTenantId: loadedEnv['fineractPlatformTenantId'] || 'lincpay', - fineractPlatformTenantIds: loadedEnv['fineractPlatformTenantIds'] || 'lincpay', + fineractPlatformTenantId: loadedEnv['fineractPlatformTenantId'] || 'utkarshbank', + fineractPlatformTenantIds: loadedEnv['fineractPlatformTenantIds'] || 'utkarshbank', // For connecting to others servers running elsewhere update the base API URL baseApiUrls: loadedEnv['fineractApiUrls'] || 'https://demo.mifos.community,https://localhost:8443,' + window.location.origin, diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 700ff10f9..2679b3c20 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -22,8 +22,8 @@ export const environment = { version: env.mifos_x.version, hash: env.mifos_x.hash, // For connecting to server running elsewhere update the tenant identifier - fineractPlatformTenantId: loadedEnv.fineractPlatformTenantId || 'lincpay', - fineractPlatformTenantIds: loadedEnv.fineractPlatformTenantIds || 'lincpay', + fineractPlatformTenantId: loadedEnv.fineractPlatformTenantId || 'utkarshbank', + fineractPlatformTenantIds: loadedEnv.fineractPlatformTenantIds || 'utkarshbank', // For connecting to others servers running elsewhere update the base API URL baseApiUrls: loadedEnv.fineractApiUrls || 'https://demo.mifos.community,https://localhost:8443,' + window.location.origin,