diff --git a/src/accounting/templates/accounting/journal-entry/disbursement/include/form-currency.html b/src/accounting/templates/accounting/journal-entry/disbursement/include/form-currency.html index 3e97656..823eaaf 100644 --- a/src/accounting/templates/accounting/journal-entry/disbursement/include/form-currency.html +++ b/src/accounting/templates/accounting/journal-entry/disbursement/include/form-currency.html @@ -22,33 +22,12 @@ First written: 2023/2/25 {% extends "accounting/journal-entry/include/form-currency.html" %} {% block line_items %} -
-
- - - -
-
{{ A_("Total") }}
-
{{ debit_total }}
-
- -
- -
-
-
{% if debit_errors %}{{ debit_errors[0] }}{% endif %}
-
+ {% with currency_index = currency_index, + debit_credit = "debit", + line_item_forms = debit_forms, + header = A_("Content"), + debit_credit_total = debit_total, + debit_credit_errors = debit_errors %} + {% include "accounting/journal-entry/include/form-debit-credit.html" %} + {% endwith %} {% endblock %} diff --git a/src/accounting/templates/accounting/journal-entry/include/form-debit-credit.html b/src/accounting/templates/accounting/journal-entry/include/form-debit-credit.html new file mode 100644 index 0000000..53d77f4 --- /dev/null +++ b/src/accounting/templates/accounting/journal-entry/include/form-debit-credit.html @@ -0,0 +1,49 @@ +{# +The Mia! Accounting Flask Project +form-debit-credit.html: The debit or credit line items in the journal entry form + + Copyright (c) 2023 imacat. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +Author: imacat@mail.imacat.idv.tw (imacat) +First written: 2023/3/21 +#} +
+
+ + + +
+
{{ A_("Total") }}
+
{{ debit_credit_total }}
+
+ +
+ +
+
+
{% if debit_credit_errors %}{{ debit_credit_errors[0] }}{% endif %}
+
diff --git a/src/accounting/templates/accounting/journal-entry/receipt/include/form-currency.html b/src/accounting/templates/accounting/journal-entry/receipt/include/form-currency.html index bd756a1..2aaff0d 100644 --- a/src/accounting/templates/accounting/journal-entry/receipt/include/form-currency.html +++ b/src/accounting/templates/accounting/journal-entry/receipt/include/form-currency.html @@ -22,33 +22,12 @@ First written: 2023/2/25 {% extends "accounting/journal-entry/include/form-currency.html" %} {% block line_items %} -
-
- - - -
-
{{ A_("Total") }}
-
{{ credit_total }}
-
- -
- -
-
-
{% if credit_errors %}{{ credit_errors[0] }}{% endif %}
-
+ {% with currency_index = currency_index, + debit_credit = "credit", + line_item_forms = credit_forms, + header = A_("Content"), + debit_credit_total = credit_total, + debit_credit_errors = credit_errors %} + {% include "accounting/journal-entry/include/form-debit-credit.html" %} + {% endwith %} {% endblock %} diff --git a/src/accounting/templates/accounting/journal-entry/transfer/include/form-currency.html b/src/accounting/templates/accounting/journal-entry/transfer/include/form-currency.html index 607f6a7..d8d24a7 100644 --- a/src/accounting/templates/accounting/journal-entry/transfer/include/form-currency.html +++ b/src/accounting/templates/accounting/journal-entry/transfer/include/form-currency.html @@ -23,66 +23,26 @@ First written: 2023/2/25 {% block line_items %}
- {# The debit line items #} -
-
- -
    - {% for line_item_form in debit_forms %} - {% with currency_index = currency_index, - debit_credit = "debit", - line_item_index = loop.index, - only_one_line_item_form = debit_forms|length == 1, - form = line_item_form.form %} - {% include "accounting/journal-entry/include/form-line-item.html" %} - {% endwith %} - {% endfor %} -
- -
-
{{ A_("Total") }}
-
{{ debit_total }}
-
- -
- -
-
-
{% if debit_errors %}{{ debit_errors[0] }}{% endif %}
+
+ {% with currency_index = currency_index, + debit_credit = "debit", + line_item_forms = debit_forms, + header = A_("Debit"), + debit_credit_total = debit_total, + debit_credit_errors = debit_errors %} + {% include "accounting/journal-entry/include/form-debit-credit.html" %} + {% endwith %}
- {# The credit line items #} -
-
- -
    - {% for line_item_form in credit_forms %} - {% with currency_index = currency_index, - debit_credit = "credit", - line_item_index = loop.index, - only_one_line_item_form = credit_forms|length == 1, - form = line_item_form.form %} - {% include "accounting/journal-entry/include/form-line-item.html" %} - {% endwith %} - {% endfor %} -
- -
-
{{ A_("Total") }}
-
{{ credit_total }}
-
- -
- -
-
-
{% if credit_errors %}{{ credit_errors[0] }}{% endif %}
+
+ {% with currency_index = currency_index, + debit_credit = "credit", + line_item_forms = credit_forms, + header = A_("Credit"), + debit_credit_total = credit_total, + debit_credit_errors = credit_errors %} + {% include "accounting/journal-entry/include/form-debit-credit.html" %} + {% endwith %}
{% endblock %}