Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
[isRequired]="true"
[inputFormControl]="savingAccountTransactionForm.controls.transactionAmount"
[inputLabel]="'Transaction Amount'"
[minVal]="0.001"
>
</mifosx-input-amount>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { SavingsService } from '../../savings.service';
import { SettingsService } from 'app/settings/settings.service';
import { Dates } from 'app/core/utils/dates';
import { Currency } from 'app/shared/models/general.model';
import { amountValueValidator } from 'app/shared/validators/amount-value.validator';
import { InputAmountComponent } from '../../../shared/input-amount/input-amount.component';
import { MatSlideToggle } from '@angular/material/slide-toggle';
import { CdkTextareaAutosize } from '@angular/cdk/text-field';
Expand Down Expand Up @@ -124,8 +125,12 @@ export class SavingsAccountTransactionsComponent implements OnInit {
Validators.required
],
transactionAmount: [
0,
Validators.required
'',
[
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently there is a custom validator for that amountValueValidator

ie:

        principalAmount: [
          '',
          [
            Validators.required,
            amountValueValidator()
          ]
        ],

Plus consider to use in the html field the custom component for Amounts:

      <mifosx-input-amount
        class="flex-48"
        [currency]="currency"
        [isRequired]="true"
        [inputFormControl]="loansAccountTermsForm.controls.principalAmount"
        [inputLabel]="'Principal'"
      >
      </mifosx-input-amount>

Copy link
Copy Markdown
Contributor Author

@Mahesh-Gite-28 Mahesh-Gite-28 May 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alberto-art3ch Updated transactionAmount validation to use amountValueValidator() following the shared validation pattern already used in other amount fields/components.

Kept Validators.min(0.001) to prevent zero-value savings transactions from passing frontend validation.

Also retained the existing mifosx-input-amount component with [minVal]="0.001" for consistent amount validation UI behavior.

Thanks for the review.

Validators.required,
amountValueValidator(),
Validators.min(0.001)
]
],
paymentTypeId: [
'',
Expand Down
Loading