57 lines
2.1 KiB
HTML
57 lines
2.1 KiB
HTML
{#
|
|
The Mia! Accounting Flask Project
|
|
form.html: The cash expense transaction 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/2/25
|
|
#}
|
|
{% extends "accounting/transaction/include/form.html" %}
|
|
|
|
{% block currency_sub_forms %}
|
|
{% if form.currencies %}
|
|
{% for currency_form in form.currencies %}
|
|
{% with currency_index = loop.index,
|
|
only_one_currency_form = form.currencies|length == 1,
|
|
currency_errors = currency_form.whole_form.errors,
|
|
currency_code_data = currency_form.code.data,
|
|
currency_code_errors = currency_form.code.errors,
|
|
debit_forms = currency_form.debit,
|
|
debit_errors = currency_form.debit_errors,
|
|
debit_total = currency_form.form.debit_total|accounting_format_amount %}
|
|
{% include "accounting/transaction/expense/include/form-currency-item.html" %}
|
|
{% endwith %}
|
|
{% endfor %}
|
|
{% else %}
|
|
{% with currency_index = 1,
|
|
only_one_currency_form = True,
|
|
currency_code_data = accounting_default_currency_code(),
|
|
debit_total = "-" %}
|
|
{% include "accounting/transaction/expense/include/form-currency-item.html" %}
|
|
{% endwith %}
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block form_modals %}
|
|
{% with summary_editor = form.summary_editor.debit %}
|
|
{% include "accounting/transaction/include/summary-editor-modal.html" %}
|
|
{% endwith %}
|
|
{% with entry_type = "debit",
|
|
account_options = form.debit_account_options %}
|
|
{% include "accounting/transaction/include/account-selector-modal.html" %}
|
|
{% endwith %}
|
|
{% endblock %}
|