{#
The Mia! Accounting Project
form.html: The cash receipt 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/2/25
#}
{% extends "accounting/journal-entry/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,
              currency_code_is_locked = currency_form.is_code_locked,
              credit_forms = currency_form.credit,
              credit_errors = currency_form.credit_errors,
              credit_total = currency_form.credit_total|accounting_format_amount %}
        {% include "accounting/journal-entry/receipt/include/form-currency.html" %}
      {% endwith %}
    {% endfor %}
  {% else %}
    {% with currency_index = 1,
            only_one_currency_form = True,
            currency_code_data = accounting_default_currency_code(),
            credit_total = "-" %}
      {% include "accounting/journal-entry/receipt/include/form-currency.html" %}
    {% endwith %}
  {% endif %}
{% endblock %}

{% block form_modals %}
  {% with description_editor = form.description_editor.credit %}
    {% include "accounting/journal-entry/include/description-editor-modal.html" %}
  {% endwith %}
  {% with debit_credit = "credit",
          account_options = form.credit_account_options %}
    {% include "accounting/journal-entry/include/account-selector-modal.html" %}
  {% endwith %}
{% endblock %}
