diff --git a/src/app/current-accounts/current-account-stepper/current-account-details-step/add-related-client-dialog/add-related-client-dialog.component.html b/src/app/current-accounts/current-account-stepper/current-account-details-step/add-related-client-dialog/add-related-client-dialog.component.html
index 2cf0ae0b6..cf0f71695 100644
--- a/src/app/current-accounts/current-account-stepper/current-account-details-step/add-related-client-dialog/add-related-client-dialog.component.html
+++ b/src/app/current-accounts/current-account-stepper/current-account-details-step/add-related-client-dialog/add-related-client-dialog.component.html
@@ -106,20 +106,38 @@
Share Percentage
-
+
%
- Enter a value between 1 and 100
+ @if (form.get('sharePercentage').hasError('max')) {
+ Maximum available is {{ maxShare }}%
+ } @else {
+ Enter a value between 1 and {{ maxShare }}
+ }
@for (hint of [25, 33, 50, 100]; track hint) {
-
- {{ hint }}%
+ @if (hint <= maxShare) {
+
+ {{ hint }}%
+
+ }
+ }
+ @if (maxShare > 0 && ![25, 33, 50, 100].includes(maxShare)) {
+
+ {{ maxShare }}%
}
diff --git a/src/app/current-accounts/current-account-stepper/current-account-details-step/add-related-client-dialog/add-related-client-dialog.component.scss b/src/app/current-accounts/current-account-stepper/current-account-details-step/add-related-client-dialog/add-related-client-dialog.component.scss
index 2028c02af..9d03a4c76 100644
--- a/src/app/current-accounts/current-account-stepper/current-account-details-step/add-related-client-dialog/add-related-client-dialog.component.scss
+++ b/src/app/current-accounts/current-account-stepper/current-account-details-step/add-related-client-dialog/add-related-client-dialog.component.scss
@@ -102,6 +102,19 @@ mifosx-add-related-client-dialog {
}
}
+.arc-remaining-badge {
+ margin-left: auto;
+ font-size: 11px;
+ font-weight: 700;
+ padding: 2px 10px;
+ border-radius: 999px;
+ background: #fef3c7;
+ color: #92400e;
+ border: 1px solid #fcd34d;
+ text-transform: none;
+ letter-spacing: 0;
+}
+
.arc-step-badge {
width: 20px;
height: 20px;
@@ -350,6 +363,18 @@ mifosx-add-related-client-dialog {
background: $primary-light;
color: $primary;
}
+
+ &--remaining {
+ border-color: #f59e0b;
+ background: #fffbeb;
+ color: #92400e;
+
+ &:hover {
+ border-color: #d97706;
+ background: #fef3c7;
+ color: #78350f;
+ }
+ }
}
// ── Actions ───────────────────────────────────────────────────────────────────
diff --git a/src/app/current-accounts/current-account-stepper/current-account-details-step/add-related-client-dialog/add-related-client-dialog.component.ts b/src/app/current-accounts/current-account-stepper/current-account-details-step/add-related-client-dialog/add-related-client-dialog.component.ts
index 81cfb1945..407cfe4bd 100644
--- a/src/app/current-accounts/current-account-stepper/current-account-details-step/add-related-client-dialog/add-related-client-dialog.component.ts
+++ b/src/app/current-accounts/current-account-stepper/current-account-details-step/add-related-client-dialog/add-related-client-dialog.component.ts
@@ -32,16 +32,21 @@ export class AddRelatedClientDialogComponent implements OnDestroy {
private fb = inject(UntypedFormBuilder);
private clientsService = inject(ClientsService);
dialogRef = inject(MatDialogRef
);
- data: { excludedClientIds?: number[] } = inject(MAT_DIALOG_DATA, { optional: true }) ?? {};
+ data: { excludedClientIds?: number[]; maxSharePercentage?: number } =
+ inject(MAT_DIALOG_DATA, { optional: true }) ?? {};
+
+ get maxShare(): number {
+ return this.data?.maxSharePercentage ?? 100;
+ }
form: UntypedFormGroup = this.fb.group({
searchText: [''],
sharePercentage: [
- null,
+ this.data?.maxSharePercentage ?? null,
[
Validators.required,
Validators.min(1),
- Validators.max(100)
+ Validators.max(this.data?.maxSharePercentage ?? 100)
]
],
signingAuthority: [null],
diff --git a/src/app/current-accounts/current-account-stepper/current-account-details-step/current-account-details-step.component.html b/src/app/current-accounts/current-account-stepper/current-account-details-step/current-account-details-step.component.html
index 437f00aa2..e99add781 100644
--- a/src/app/current-accounts/current-account-stepper/current-account-details-step/current-account-details-step.component.html
+++ b/src/app/current-accounts/current-account-stepper/current-account-details-step/current-account-details-step.component.html
@@ -259,6 +259,7 @@
color="primary"
type="button"
class="soa-add-btn"
+ [disabled]="totalJointSharePercentage >= 100"
(click)="openAddJointHolderDialog()"
>
person_add Add Holder
@@ -761,6 +762,7 @@
color="primary"
type="button"
class="ni-add-btn"
+ [disabled]="totalSharePercentage >= 100"
(click)="openAddRelatedClientDialog()"
>
person_add Add Partner
diff --git a/src/app/current-accounts/current-account-stepper/current-account-details-step/current-account-details-step.component.ts b/src/app/current-accounts/current-account-stepper/current-account-details-step/current-account-details-step.component.ts
index 196fea25d..08ff06782 100644
--- a/src/app/current-accounts/current-account-stepper/current-account-details-step/current-account-details-step.component.ts
+++ b/src/app/current-accounts/current-account-stepper/current-account-details-step/current-account-details-step.component.ts
@@ -364,11 +364,12 @@ export class CurrentAccountDetailsStepComponent implements OnInit {
...(this.primaryClientId ? [this.primaryClientId] : []),
...this.jointHolders.map((h: any) => h.clientId).filter(Boolean)
];
+ const maxSharePercentage = Math.max(0, 100 - this.totalJointSharePercentage);
const ref = this.dialog.open(AddRelatedClientDialogComponent, {
width: '500px',
panelClass: 'arc-dialog-panel',
disableClose: true,
- data: { excludedClientIds }
+ data: { excludedClientIds, maxSharePercentage }
});
ref.afterClosed().subscribe((result) => {
if (result) {
@@ -443,11 +444,12 @@ export class CurrentAccountDetailsStepComponent implements OnInit {
...(this.primaryClientId ? [this.primaryClientId] : []),
...this.relatedClients.map((c: any) => c.clientId).filter(Boolean)
];
+ const maxSharePercentage = Math.max(0, 100 - this.totalSharePercentage);
const ref = this.dialog.open(AddRelatedClientDialogComponent, {
width: '500px',
panelClass: 'arc-dialog-panel',
disableClose: true,
- data: { excludedClientIds }
+ data: { excludedClientIds, maxSharePercentage }
});
ref.afterClosed().subscribe((result) => {
if (result) {
diff --git a/src/app/deposits/fixed-deposits/create-fixed-deposit-account/create-fixed-deposit-account.component.html b/src/app/deposits/fixed-deposits/create-fixed-deposit-account/create-fixed-deposit-account.component.html
index f78358d85..a505a994f 100644
--- a/src/app/deposits/fixed-deposits/create-fixed-deposit-account/create-fixed-deposit-account.component.html
+++ b/src/app/deposits/fixed-deposits/create-fixed-deposit-account/create-fixed-deposit-account.component.html
@@ -74,6 +74,7 @@
diff --git a/src/app/deposits/fixed-deposits/create-fixed-deposit-account/create-fixed-deposit-account.component.ts b/src/app/deposits/fixed-deposits/create-fixed-deposit-account/create-fixed-deposit-account.component.ts
index 9365dae78..3f32de9ea 100644
--- a/src/app/deposits/fixed-deposits/create-fixed-deposit-account/create-fixed-deposit-account.component.ts
+++ b/src/app/deposits/fixed-deposits/create-fixed-deposit-account/create-fixed-deposit-account.component.ts
@@ -14,6 +14,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { FixedDepositsService } from '../fixed-deposits.service';
import { SettingsService } from 'app/settings/settings.service';
import { AlertService } from 'app/core/alert/alert.service';
+import { ProductsService } from 'app/products/products.service';
/** Custom Components */
import { FixedDepositAccountDetailsStepComponent } from '../fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component';
@@ -61,6 +62,7 @@ export class CreateFixedDepositAccountComponent {
private fixedDepositsService = inject(FixedDepositsService);
private settingsService = inject(SettingsService);
private alertService = inject(AlertService);
+ private productsService = inject(ProductsService);
@ViewChild(FixedDepositAccountDetailsStepComponent, { static: true })
fixedDepositsAccountDetailsStep: FixedDepositAccountDetailsStepComponent;
@@ -71,6 +73,8 @@ export class CreateFixedDepositAccountComponent {
fixedDepositsAccountTemplate: any;
/** Fixed Deposit Account Product Template */
fixedDepositsAccountProductTemplate: any;
+ /** Active CBS base interest rate versions for the selected product's FD type */
+ cbsBaseRates: any[] = [];
/** Tenure selected from the interest rate chart step */
selectedTenure: {
depositPeriod: number;
@@ -79,6 +83,7 @@ export class CreateFixedDepositAccountComponent {
maturityAmount?: number;
interestEarned?: number;
appliedRate?: number;
+ isSeniorCitizen?: boolean;
} | null = null;
/**
@@ -101,6 +106,11 @@ export class CreateFixedDepositAccountComponent {
*/
setTemplate($event: any) {
this.fixedDepositsAccountProductTemplate = $event;
+ const fdType = $event?.fdType;
+ this.productsService.getFdBaseInterestRates(fdType).subscribe({
+ next: (rates: any[]) => (this.cbsBaseRates = rates || []),
+ error: () => (this.cbsBaseRates = [])
+ });
}
onTenureSelected($event: {
@@ -110,6 +120,7 @@ export class CreateFixedDepositAccountComponent {
maturityAmount?: number;
interestEarned?: number;
appliedRate?: number;
+ isSeniorCitizen?: boolean;
}) {
this.selectedTenure = $event;
}
@@ -257,6 +268,17 @@ export class CreateFixedDepositAccountComponent {
}));
}
+ // Senior citizen rate override
+ if (
+ this.selectedTenure?.isSeniorCitizen &&
+ this.selectedTenure.appliedRate != null &&
+ this.selectedTenure.appliedRate > 0
+ ) {
+ fixedDepositAccount.isSeniorCitizen = true;
+ fixedDepositAccount.seniorCitizenInterestRate = this.selectedTenure.appliedRate;
+ fixedDepositAccount.nominalAnnualInterestRate = this.selectedTenure.appliedRate;
+ }
+
this.fixedDepositsService.createFixedDepositAccount(fixedDepositAccount).subscribe({
next: (response: any) => {
this.router.navigate(
diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.html b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.html
index a85665e72..8e6b1e498 100644
--- a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.html
+++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.html
@@ -370,6 +370,7 @@
color="primary"
type="button"
class="soa-add-btn"
+ [disabled]="totalJointSharePercentage >= 100"
(click)="openAddJointHolderDialog()"
>
person_add Add Holder
diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.ts
index f7be4a3a0..d2562d4de 100644
--- a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.ts
+++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.ts
@@ -473,11 +473,12 @@ export class FixedDepositAccountDetailsStepComponent implements OnInit {
...(this.primaryClientId ? [this.primaryClientId] : []),
...this.jointHolders.map((h: any) => h.clientId).filter(Boolean)
];
+ const maxSharePercentage = Math.max(0, 100 - this.totalJointSharePercentage);
const ref = this.dialog.open(AddRelatedClientDialogComponent, {
width: '500px',
panelClass: 'arc-dialog-panel',
disableClose: true,
- data: { excludedClientIds }
+ data: { excludedClientIds, maxSharePercentage }
});
ref.afterClosed().subscribe((result) => {
if (result) {
diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-interest-rate-chart-step/fixed-deposit-account-interest-rate-chart-step.component.html b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-interest-rate-chart-step/fixed-deposit-account-interest-rate-chart-step.component.html
index 8940bda46..add375f1d 100644
--- a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-interest-rate-chart-step/fixed-deposit-account-interest-rate-chart-step.component.html
+++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-interest-rate-chart-step/fixed-deposit-account-interest-rate-chart-step.component.html
@@ -8,7 +8,7 @@
- @if (fixedDepositsAccountProductTemplate?.accountChart) {
+ @if (interestRateChartData.length > 0) {