WEB-448 Credit Amount Field Allows Invalid Values (Zero and Negative) in Journal Entry Creation

This commit is contained in:
Soni Jay
2025-12-01 12:38:33 +05:30
parent fe49b281fb
commit d3be34ba5c
2 changed files with 24 additions and 3 deletions
@@ -34,6 +34,11 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class CreateJournalEntryComponent implements OnInit, AfterViewInit {
onCreditAmountInput(event: any) {
if (event.target.value < 1) {
event.target.value = 1;
}
}
/** Minimum transaction date allowed. */
minDate = new Date(2000, 0, 1);
/** Maximum transaction date allowed. */
@@ -140,7 +145,9 @@ export class CreateJournalEntryComponent implements OnInit, AfterViewInit {
],
amount: [
'',
Validators.required
[
Validators.required,
Validators.min(1)]
]
});
}