{#
The Mia! Accounting Project
unmatched-accounts.html: The account list with unmatched offsets

 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/4/17
#}
{% extends "accounting/base.html" %}

{% block accounting_scripts %}
  <script src="{{ url_for("accounting.static", filename="js/material-fab-speed-dial.js") }}"></script>
  <script src="{{ url_for("accounting.static", filename="js/period-chooser.js") }}"></script>
{% endblock %}

{% block header %}{% block title %}{% if report.currency.code == accounting_default_currency_code() %}{{ A_("Accounts With Unmatched Offsets") }}{% else %}{{ A_("Accounts With Unmatched Offsets in %(currency)s", currency=report.currency.name|title) }}{% endif %}{% endblock %}{% endblock %}

{% block content %}

<div class="mb-3 accounting-toolbar">
  {% with use_currency_chooser = true,
          use_account_chooser = true %}
    {% include "accounting/report/include/toolbar-buttons.html" %}
  {% endwith %}
</div>

{% include "accounting/report/include/add-journal-entry-material-fab.html" %}

{% include "accounting/report/include/search-modal.html" %}

{% if report.has_data %}
  <div class="accounting-sheet">
    <div class="d-none d-sm-flex justify-content-center mb-3">
      <h2 class="text-center">
        {% if report.currency.code == accounting_default_currency_code() %}
          {{ A_("Accounts With Unmatched Offsets") }}
        {% else %}
          {{ A_("Accounts With Unmatched Offsets in %(currency)s", currency=report.currency.name|title) }}
        {% endif %}
      </h2>
    </div>

    <div class="accounting-report-table accounting-unapplied-account-table">
        <div class="accounting-report-table-header">
          <div class="accounting-report-table-row">
            <div class="accounting-amount">{{ A_("Count") }}</div>
          </div>
        </div>
      <div class="accounting-report-table-body">
        {% for account in report.accounts %}
          <a class="accounting-report-table-row" href="{{ url_for("accounting-report.unmatched", currency=report.currency, account=account, period=report.period) }}">
            <div>
              <span class="d-none d-md-inline">{{ account.code }}</span>
              {{ account.title }}
            </div>
            <div class="accounting-amount">{{ account.count }}</div>
          </a>
        {% endfor %}
      </div>
    </div>
  </div>
{% else %}
  <p>{{ A_("There is no data.") }}</p>
{% endif %}

{% endblock %}
