Validate expenseForm.Text only once

This commit is contained in:
jordi fita mas 2023-07-13 18:14:06 +02:00
parent bb7af20a17
commit 7d55e949fc
1 changed files with 0 additions and 2 deletions

View File

@ -266,8 +266,6 @@ func (form *expenseForm) Validate() bool {
if validator.CheckRequiredInput(form.Amount, gettext("Amount can not be empty.", form.locale)) { if validator.CheckRequiredInput(form.Amount, gettext("Amount can not be empty.", form.locale)) {
validator.CheckValidDecimal(form.Amount, form.company.MinCents(), math.MaxFloat64, gettext("Amount must be a number greater than zero.", form.locale)) validator.CheckValidDecimal(form.Amount, form.company.MinCents(), math.MaxFloat64, gettext("Amount must be a number greater than zero.", form.locale))
} }
validator.CheckValidSelectOption(form.Tax, gettext("Selected tax is not valid.", form.locale))
validator.CheckAtMostOneOfEachGroup(form.Tax, gettext("You can only select a tax of each class.", form.locale))
validator.CheckValidSelectOption(form.ExpenseStatus, gettext("Selected expense status is not valid.", form.locale)) validator.CheckValidSelectOption(form.ExpenseStatus, gettext("Selected expense status is not valid.", form.locale))
return validator.AllOK() return validator.AllOK()
} }