diff --git a/src/accounting/account/forms.py b/src/accounting/account/forms.py index 291aaee..7bd30a0 100644 --- a/src/accounting/account/forms.py +++ b/src/accounting/account/forms.py @@ -62,7 +62,7 @@ class NoOffsetNominalAccount: return if form.base_code.data is None: return - if form.base_code.data[0] not in {"1", "2"}: + if form.base_code.data[0] not in {"1", "2", "3"}: raise ValidationError(lazy_gettext( "A nominal account does not need offset.")) @@ -102,7 +102,7 @@ class AccountForm(FlaskForm): obj.base_code = self.base_code.data obj.no = count + 1 obj.title = self.title.data - if self.base_code.data[0] in {"1", "2"}: + if self.base_code.data[0] in {"1", "2", "3"}: obj.is_offset_needed = self.is_offset_needed.data else: obj.is_offset_needed = False diff --git a/src/accounting/static/js/account-form.js b/src/accounting/static/js/account-form.js index b8aee74..1ea9919 100644 --- a/src/accounting/static/js/account-form.js +++ b/src/accounting/static/js/account-form.js @@ -137,7 +137,7 @@ class AccountForm { setBaseAccount(code, text) { this.#baseCode.value = code; this.#base.innerText = text; - if (["1", "2"].includes(code.substring(0, 1))) { + if (["1", "2", "3"].includes(code.substring(0, 1))) { this.#isOffsetNeededControl.classList.remove("d-none"); this.#isOffsetNeeded.disabled = false; } else { diff --git a/src/accounting/templates/accounting/account/include/form.html b/src/accounting/templates/accounting/account/include/form.html index f5f67d5..493ad51 100644 --- a/src/accounting/templates/accounting/account/include/form.html +++ b/src/accounting/templates/accounting/account/include/form.html @@ -62,7 +62,7 @@ First written: 2023/2/1
{% if form.title.errors %}{{ form.title.errors[0] }}{% endif %}
-
+