Files
cbsnexora/src/app/savings/savings-account-stepper/savings-account-preview-step/savings-account-preview-step.component.html
T
niteshandClaude Sonnet 5 7b77166b19 fix: tenant-config fixes, cashier/share/savings UI bugs, and menu-access hardcoding
- Add Balance Sheet report and disabled-features accounting config
- Point menu-access tenant header and env.js/environment.ts tenant identifier
  at env config instead of hardcoded 'default'/'lincpay' literals
- Surface the real backend error (not a generic "no reference id") when an
  OTP send fails in contact-otp-block
- Fix branch-day "₹null" display bug (null vs undefined) and add a guard
  blocking a branch's first-ever day open before cash denomination migration
- Dynamically size the denomination count input and block re-opening an
  already-open business day from Migrate Cash Denomination
- Lock the denomination-managed cash GL row in Migrate Opening Balances
  (read-only, with a link back to Migrate Cash Denomination)
- Remove duplicate Cancel/Submit action bars on the Share Product and
  Savings Account creation preview steps; align Previous into the same row
- Hide "Apply Collection" on a share account once its advance collection
  is already settled (further purchases go through Apply Additional Shares)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-13 15:19:21 +05:30

615 lines
26 KiB
HTML

<!--
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="preview-wrapper">
<!-- ══ 1. Account Details ════════════════════════════════════════ -->
<div class="preview-section">
<div class="preview-section__header">
<i class="fas fa-info-circle preview-section__icon"></i>
<span class="preview-section__title">Account Details</span>
</div>
<div class="preview-body">
<div class="preview-grid preview-grid--three">
<div class="preview-field">
<span class="preview-label">{{ 'labels.inputs.Product' | translate }}</span>
<span class="preview-value">{{
savingsAccount?.productId | find: savingsAccountTemplate?.productOptions : 'id' : 'name'
}}</span>
</div>
<div class="preview-field">
<span class="preview-label">{{ 'labels.inputs.Submitted On' | translate }}</span>
<span class="preview-value">{{ savingsAccount?.submittedOnDate | dateFormat }}</span>
</div>
<div class="preview-field">
<span class="preview-label">{{ 'labels.inputs.Field Officer' | translate }}</span>
<span class="preview-value">{{
savingsAccount?.fieldOfficerId
| find: savingsAccountProductTemplate?.fieldOfficerOptions : 'id' : 'displayName'
}}</span>
</div>
<div class="preview-field">
<span class="preview-label">{{ 'labels.inputs.External Id' | translate }}</span>
@if (savingsAccount?.externalId) {
<span class="preview-value">
<mifosx-external-identifier externalId="{{ savingsAccount.externalId }}"></mifosx-external-identifier>
</span>
} @else {
<span class="preview-value preview-muted">Unassigned</span>
}
</div>
</div>
</div>
</div>
<!-- ══ 2. Product Classification ════════════════════════════════ -->
@if (
savingsAccountProductTemplate?.accountType ||
savingsAccountProductTemplate?.customerSegment ||
savingsAccountProductTemplate?.productCode ||
savingsAccountProductTemplate?.previewAccountNo ||
savingsAccountProductTemplate?.effectiveDate ||
savingsAccountProductTemplate?.endDate
) {
<div class="preview-section">
<div class="preview-section__header">
<i class="fas fa-tags preview-section__icon"></i>
<span class="preview-section__title">Product Classification</span>
<span class="preview-section__badge">From Product</span>
</div>
<div class="preview-body">
<div class="preview-grid preview-grid--three">
@if (savingsAccount?.accountType || savingsAccountProductTemplate?.accountType) {
<div class="preview-field">
<span class="preview-label">Account Type</span>
<span class="preview-value">{{
savingsAccount?.accountType || savingsAccountProductTemplate?.accountType
}}</span>
</div>
}
@if (savingsAccount?.customerSegment || savingsAccountProductTemplate?.customerSegment) {
<div class="preview-field">
<span class="preview-label">Customer Segment</span>
<span class="preview-value">{{
savingsAccount?.customerSegment || savingsAccountProductTemplate?.customerSegment
}}</span>
</div>
}
@if (savingsAccountProductTemplate?.productCode) {
<div class="preview-field">
<span class="preview-label">Product Code</span>
<span class="preview-value preview-mono">{{ savingsAccountProductTemplate?.productCode }}</span>
</div>
}
<div class="preview-field">
<span class="preview-label">Account No</span>
<span class="preview-value preview-mono">{{
savingsAccountProductTemplate?.previewAccountNo || savingsAccountTemplate?.accountNo || 'Auto-generated'
}}</span>
</div>
@if (savingsAccountProductTemplate?.effectiveDate) {
<div class="preview-field">
<span class="preview-label">Effective Date</span>
<span class="preview-value">{{ savingsAccountProductTemplate?.effectiveDate | dateFormat }}</span>
</div>
}
@if (savingsAccountProductTemplate?.endDate) {
<div class="preview-field">
<span class="preview-label">End Date</span>
<span class="preview-value">{{ savingsAccountProductTemplate?.endDate | dateFormat }}</span>
</div>
}
<div class="preview-field">
<span class="preview-label">Introducer Required</span>
<span
class="preview-value preview-badge"
[class.preview-badge--yes]="savingsAccountProductTemplate?.introducerRequired"
>
{{ savingsAccountProductTemplate?.introducerRequired | yesNo }}
</span>
</div>
<div class="preview-field">
<span class="preview-label">Share Linking Enabled</span>
<span
class="preview-value preview-badge"
[class.preview-badge--yes]="
savingsAccount?.shareLinkingEnabled !== undefined
? savingsAccount.shareLinkingEnabled
: savingsAccountProductTemplate?.shareLinkingEnabled
"
>
{{
(savingsAccount?.shareLinkingEnabled !== undefined
? savingsAccount.shareLinkingEnabled
: savingsAccountProductTemplate?.shareLinkingEnabled
) | yesNo
}}
</span>
</div>
</div>
</div>
</div>
}
<!-- ══ 3. Introducer Details (if selected) ══════════════════════ -->
@if (savingsAccount?.introducerId) {
<div class="preview-section">
<div class="preview-section__header">
<i class="fas fa-user-tie preview-section__icon"></i>
<span class="preview-section__title">Introducer Details</span>
</div>
<div class="preview-body">
<div class="preview-grid preview-grid--three">
<div class="preview-field">
<span class="preview-label">Name</span>
<span class="preview-value">{{ savingsAccount?.introducerName || '—' }}</span>
</div>
@if (savingsAccount?.introducerCifNumber) {
<div class="preview-field">
<span class="preview-label">CIF No</span>
<span class="preview-value preview-mono">{{ savingsAccount.introducerCifNumber }}</span>
</div>
}
<div class="preview-field">
<span class="preview-label">Client ID</span>
<span class="preview-value preview-mono">{{ savingsAccount.introducerId }}</span>
</div>
</div>
</div>
</div>
}
<!-- ══ 4. Status of Account ════════════════════════════════════ -->
@if (savingsAccount?.accountStatus) {
<div class="preview-section">
<div class="preview-section__header">
<i class="fas fa-id-card preview-section__icon"></i>
<span class="preview-section__title">Status of Account</span>
<span class="preview-section__badge">RBI Guidelines</span>
</div>
<div class="preview-body">
<!-- Status Tile -->
<div class="preview-soa-status-row">
<span class="preview-soa-tile">
@switch (savingsAccount.accountStatus) {
@case ('INDIVIDUAL_MALE') {
<i class="fas fa-male"></i> Individual (Male)
}
@case ('INDIVIDUAL_FEMALE') {
<i class="fas fa-female"></i> Individual (Female)
}
@case ('SINGLE') {
<i class="fas fa-user-circle"></i> Single Account
}
@case ('JOINT') {
<i class="fas fa-users"></i> Joint Account
}
@case ('MINOR') {
<i class="fas fa-child"></i> Minor Account
}
@case ('SENIOR_CITIZEN') {
<i class="fas fa-user-clock"></i> Senior Citizen
}
@default {
{{ savingsAccount.accountStatus }}
}
}
</span>
</div>
<!-- JOINT: Mode of Operation + Holders Table -->
@if (savingsAccount.accountStatus === 'JOINT') {
<div class="preview-grid preview-grid--three" style="margin-top: 12px">
<div class="preview-field">
<span class="preview-label">Mode of Operation</span>
<span class="preview-value">
@switch (savingsAccount.modeOfOperation) {
@case ('EITHER_OR_SURVIVOR') {
Either or Survivor
}
@case ('FORMER_OR_SURVIVOR') {
Former or Survivor
}
@case ('JOINTLY') {
Jointly
}
@case ('ANYONE_OR_SURVIVOR') {
Anyone or Survivor
}
@default {
{{ savingsAccount.modeOfOperation || '—' }}
}
}
</span>
</div>
</div>
@if (savingsAccount.jointHolders?.length) {
<div class="preview-soa-table-wrap">
<table class="preview-soa-tbl">
<thead>
<tr>
<th class="preview-soa-th">Sr.</th>
<th class="preview-soa-th">Holder Name</th>
<th class="preview-soa-th">CIF No.</th>
<th class="preview-soa-th">Ownership %</th>
<th class="preview-soa-th">Signing</th>
<th class="preview-soa-th">Role</th>
</tr>
</thead>
<tbody>
@for (holder of savingsAccount.jointHolders; track holder.clientId; let i = $index) {
<tr [class.preview-soa-tr--primary]="holder.isPrimary">
<td class="preview-soa-td">{{ i + 1 }}</td>
<td class="preview-soa-td">
{{ holder.displayName || '—' }}
@if (holder.isPrimary) {
<span class="preview-soa-primary-tag">Primary</span>
}
</td>
<td class="preview-soa-td preview-mono">{{ holder.cifNumber || '—' }}</td>
<td class="preview-soa-td">{{ holder.sharePercentage ?? '—' }}%</td>
<td class="preview-soa-td">{{ holder.isMandatory ? 'Mandatory' : 'Optional' }}</td>
<td class="preview-soa-td">{{ holder.isPrimary ? 'Primary Account Holder' : 'Co-Holder' }}</td>
</tr>
}
</tbody>
</table>
</div>
}
}
<!-- INDIVIDUAL_MALE: Special Category -->
@if (savingsAccount.accountStatus === 'INDIVIDUAL_MALE' && savingsAccount.specialCategory) {
<div class="preview-grid preview-grid--three" style="margin-top: 12px">
<div class="preview-field">
<span class="preview-label">Special Category</span>
<span class="preview-value">
@switch (savingsAccount.specialCategory) {
@case ('DEFENCE') {
Defence Personnel
}
@case ('EX_SERVICEMAN') {
Ex-Serviceman
}
@case ('GOVT_EMPLOYEE') {
Government Employee
}
@case ('PHYSICALLY_CHALLENGED') {
Physically Challenged
}
@case ('NRI') {
NRI (Non-Resident Indian)
}
@case ('NONE') {
None / General
}
@default {
{{ savingsAccount.specialCategory }}
}
}
</span>
</div>
</div>
}
<!-- INDIVIDUAL_FEMALE: Weaker Section -->
@if (savingsAccount.accountStatus === 'INDIVIDUAL_FEMALE' && savingsAccount.weakerSection) {
<div class="preview-grid preview-grid--three" style="margin-top: 12px">
<div class="preview-field">
<span class="preview-label">Weaker Section</span>
<span class="preview-value">
@switch (savingsAccount.weakerSection) {
@case ('BPL') {
BPL (Below Poverty Line)
}
@case ('SC_ST') {
SC / ST Category
}
@case ('MINORITY') {
Minority Community
}
@case ('SHG') {
Self Help Group Member
}
@case ('PMJDY') {
PMJDY Beneficiary
}
@case ('NONE') {
None / General
}
@default {
{{ savingsAccount.weakerSection }}
}
}
</span>
</div>
</div>
}
<!-- MINOR: Guardian Details -->
@if (savingsAccount.accountStatus === 'MINOR') {
<div class="preview-grid preview-grid--three" style="margin-top: 12px">
@if (savingsAccount.guardianName) {
<div class="preview-field">
<span class="preview-label">Guardian Name</span>
<span class="preview-value">{{ savingsAccount.guardianName }}</span>
</div>
}
@if (savingsAccount.guardianCifNumber) {
<div class="preview-field">
<span class="preview-label">Guardian CIF</span>
<span class="preview-value preview-mono">{{ savingsAccount.guardianCifNumber }}</span>
</div>
}
@if (savingsAccount.guardianRelationship) {
<div class="preview-field">
<span class="preview-label">Relationship</span>
<span class="preview-value">{{ savingsAccount.guardianRelationship }}</span>
</div>
}
@if (savingsAccount.minorDateOfBirth) {
<div class="preview-field">
<span class="preview-label">Minor DOB</span>
<span class="preview-value">{{ savingsAccount.minorDateOfBirth }}</span>
</div>
}
</div>
}
</div>
</div>
}
<!-- ══ 5. Currency & Account Flags ══════════════════════════════ -->
<div class="preview-section">
<div class="preview-section__header">
<i class="fas fa-coins preview-section__icon"></i>
<span class="preview-section__title">Currency &amp; Account Flags</span>
</div>
<div class="preview-body">
<div class="preview-grid preview-grid--three">
<div class="preview-field">
<span class="preview-label">Currency</span>
<span class="preview-value">{{ currencyName }}</span>
</div>
<div class="preview-field">
<span class="preview-label">Decimal Places</span>
<span class="preview-value">{{ decimalPlaces }}</span>
</div>
<div class="preview-field">
<span class="preview-label">Currency In Multiples Of</span>
<span class="preview-value">{{ inMultiplesOf }}</span>
</div>
<div class="preview-field">
<span class="preview-label">Dormancy Alert</span>
<span
class="preview-value preview-badge"
[class.preview-badge--yes]="savingsAccountProductTemplate?.dormancyAlert"
>
{{ savingsAccountProductTemplate?.dormancyAlert | yesNo }}
</span>
</div>
<div class="preview-field">
<span class="preview-label">Nomination Facility</span>
<span
class="preview-value preview-badge"
[class.preview-badge--yes]="savingsAccountProductTemplate?.nominationFacility"
>
{{ savingsAccountProductTemplate?.nominationFacility | yesNo }}
</span>
</div>
</div>
</div>
</div>
<!-- ══ 5. Dormancy Monitoring ════════════════════════════════════ -->
@if (
savingsAccountProductTemplate?.dormancyAlert || savingsAccountProductTemplate?.isDormancyTrackingActiveFromProduct
) {
<div class="preview-section">
<div class="preview-section__header">
<i class="fas fa-moon preview-section__icon"></i>
<span class="preview-section__title">Dormancy Monitoring</span>
<span
class="preview-section__badge"
[class.preview-section__badge--active]="savingsAccountProductTemplate?.isDormancyTrackingActiveFromProduct"
>
{{ savingsAccountProductTemplate?.isDormancyTrackingActiveFromProduct ? 'Active' : 'Inactive' }}
</span>
</div>
<div class="preview-body">
<div class="preview-dormancy-timeline">
<div class="preview-dorm-step">
<div class="preview-dorm-step__dot preview-dorm-step__dot--inactive"></div>
<div class="preview-dorm-step__body">
<span class="preview-dorm-step__label">Inactive</span>
<span class="preview-dorm-step__days">
@if (savingsAccountProductTemplate?.daysToInactiveFromProduct !== null) {
After {{ savingsAccountProductTemplate.daysToInactiveFromProduct }} days of no transaction
} @else {
Not configured
}
</span>
</div>
</div>
<div class="preview-dorm-connector"></div>
<div class="preview-dorm-step">
<div class="preview-dorm-step__dot preview-dorm-step__dot--dormant"></div>
<div class="preview-dorm-step__body">
<span class="preview-dorm-step__label">Dormant</span>
<span class="preview-dorm-step__days">
@if (savingsAccountProductTemplate?.daysToDormancyFromProduct !== null) {
{{ savingsAccountProductTemplate.daysToDormancyFromProduct }} days after inactive
} @else {
Not configured
}
</span>
</div>
</div>
<div class="preview-dorm-connector"></div>
<div class="preview-dorm-step">
<div class="preview-dorm-step__dot preview-dorm-step__dot--escheat"></div>
<div class="preview-dorm-step__body">
<span class="preview-dorm-step__label">Escheat</span>
<span class="preview-dorm-step__days">
@if (savingsAccountProductTemplate?.daysToEscheatFromProduct !== null) {
{{ savingsAccountProductTemplate.daysToEscheatFromProduct }} days after dormant
} @else {
Not configured
}
</span>
</div>
</div>
</div>
<div class="preview-dorm-flags">
<span class="preview-dorm-flag" [class.preview-dorm-flag--on]="savingsAccountProductTemplate?.dormancyAlert">
<i class="fas fa-bell"></i> Alert
{{ savingsAccountProductTemplate?.dormancyAlert ? 'Enabled' : 'Disabled' }}
</span>
<span
class="preview-dorm-flag"
[class.preview-dorm-flag--on]="savingsAccountProductTemplate?.isDormancyTrackingActiveFromProduct"
>
<i class="fas fa-eye"></i> Tracking
{{ savingsAccountProductTemplate?.isDormancyTrackingActiveFromProduct ? 'Active' : 'Inactive' }}
</span>
</div>
</div>
</div>
}
<!-- ══ 7. Nominee Details (if filled) ═══════════════════════════ -->
@if (savingsAccountNominees?.length > 0) {
<div class="preview-section">
<div class="preview-section__header">
<i class="fas fa-user-shield preview-section__icon"></i>
<span class="preview-section__title">Nominee Details</span>
<span class="preview-section__badge">{{ savingsAccountNominees.length }} Nominee(s)</span>
</div>
<div class="preview-body">
@for (nom of savingsAccountNominees; track nom.nomineeClientId; let i = $index) {
@if (i > 0) {
<hr class="preview-nom-divider" />
}
<div class="preview-grid preview-grid--three">
<div class="preview-field">
<span class="preview-label">Name</span>
<span class="preview-value">{{ nom.nomineeDisplayName || '—' }}</span>
</div>
<div class="preview-field">
<span class="preview-label">Client ID</span>
<span class="preview-value preview-mono">{{ nom.nomineeClientId || '—' }}</span>
</div>
<div class="preview-field">
<span class="preview-label">Relationship</span>
<span class="preview-value">{{ nom.relationshipName || '—' }}</span>
</div>
<div class="preview-field">
<span class="preview-label">Share %</span>
<span class="preview-value">{{ nom.percentageShare ?? '—' }}%</span>
</div>
<div class="preview-field">
<span class="preview-label">Minor</span>
<span class="preview-value">{{ nom.nomineeIsMinor ? 'Yes' : 'No' }}</span>
</div>
@if (nom.guardianDisplayName) {
<div class="preview-field">
<span class="preview-label">Guardian</span>
<span class="preview-value">{{ nom.guardianDisplayName }}</span>
</div>
}
@if (nom.remarks) {
<div class="preview-field">
<span class="preview-label">Remarks</span>
<span class="preview-value">{{ nom.remarks }}</span>
</div>
}
</div>
}
</div>
</div>
}
<!-- ══ 5. Digital Facilities ════════════════════════════════════ -->
@if (hasDigitalSection) {
<div class="preview-section">
<div class="preview-section__header">
<i class="fas fa-mobile-alt preview-section__icon"></i>
<span class="preview-section__title">Digital Facilities</span>
<span class="preview-section__badge preview-section__badge--digital">User Configured</span>
</div>
<div class="preview-body">
<div class="preview-digital-grid">
@for (facility of digitalFacilityLabels; track facility.key) {
<div class="preview-digital-card" [class.preview-digital-card--on]="digitalFacilityConfig?.[facility.key]">
<span class="preview-digital-label">{{ facility.label }}</span>
<span
class="preview-digital-status"
[class.preview-digital-status--on]="digitalFacilityConfig?.[facility.key]"
>
{{ digitalFacilityConfig?.[facility.key] ? 'Enabled' : 'Disabled' }}
</span>
</div>
}
</div>
</div>
</div>
}
<!-- ══ 6. Client Members (GSIM) ═════════════════════════════════ -->
@if (activeClientMembers) {
<div class="preview-section">
<div class="preview-section__header">
<i class="fas fa-users preview-section__icon"></i>
<span class="preview-section__title">{{ 'labels.heading.Client Members' | translate }}</span>
</div>
<div class="preview-body">
<table class="mat-elevation-z1 preview-table" mat-table #membersTable [dataSource]="dataSource">
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Client ID' | translate }}</th>
<td mat-cell *matCellDef="let element">{{ element.id }}</td>
</ng-container>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Client Name' | translate }}</th>
<td mat-cell *matCellDef="let element">{{ element.displayName }}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="membersDisplayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: membersDisplayedColumns"></tr>
</table>
</div>
</div>
}
</div>
<!--
Previous, Cancel & Submit all in one row. Previous emits back to the parent wizard rather than
using matStepperPrevious, since this component renders inside a mat-tab-group rather than a
mat-stepper and has no CdkStepper ancestor to bind to.
-->
@if (!hideButtons) {
<div class="preview-submit-row">
<button mat-stroked-button (click)="previousEvent.emit()">
<fa-icon icon="arrow-left" class="m-r-10"></fa-icon>
{{ 'labels.buttons.Previous' | translate }}
</button>
<div class="preview-submit-row__right">
<button mat-stroked-button [routerLink]="['../..']">
{{ 'labels.buttons.Cancel' | translate }}
</button>
<button
mat-raised-button
color="primary"
class="preview-submit-row__primary"
[disabled]="submitting"
(click)="submitEvent.emit()"
>
<fa-icon icon="check" class="m-r-10"></fa-icon>
{{ 'labels.buttons.Submit' | translate }}
</button>
</div>
</div>
}