diff --git a/src/app/accounting/create-journal-entry/create-journal-entry.component.html b/src/app/accounting/create-journal-entry/create-journal-entry.component.html index 5fcc8121c..c96cbefbc 100644 --- a/src/app/accounting/create-journal-entry/create-journal-entry.component.html +++ b/src/app/accounting/create-journal-entry/create-journal-entry.component.html @@ -51,7 +51,14 @@ {{ 'labels.inputs.Debit Amount' | translate }} - + {{ 'labels.inputs.Debit Amount' | translate }} {{ 'labels.commons.is' | translate }} {{ 'labels.commons.required' | translate }} @@ -92,7 +99,14 @@ {{ 'labels.inputs.Credit Amount' | translate }} - + {{ 'labels.inputs.Credit Amount' | translate }} {{ 'labels.commons.is' | translate }} {{ 'labels.commons.required' | translate }} diff --git a/src/app/accounting/create-journal-entry/create-journal-entry.component.ts b/src/app/accounting/create-journal-entry/create-journal-entry.component.ts index 11bdf346e..f7f9ae35f 100644 --- a/src/app/accounting/create-journal-entry/create-journal-entry.component.ts +++ b/src/app/accounting/create-journal-entry/create-journal-entry.component.ts @@ -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)] ] }); }