2020-07-21 00:31:31 +08:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% comment %}
|
|
|
|
The Mia Accounting Application
|
|
|
|
cash.html: The template for the cash account reports
|
|
|
|
|
|
|
|
Copyright (c) 2020 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: 2020/7/20
|
|
|
|
{% endcomment %}
|
|
|
|
{% load static %}
|
|
|
|
{% load i18n %}
|
|
|
|
{% load humanize %}
|
|
|
|
{% load mia_core %}
|
|
|
|
{% load accounting %}
|
|
|
|
|
|
|
|
{% block settings %}
|
2020-08-08 13:43:11 +08:00
|
|
|
{% blocktrans asvar title with prep_period=request.resolver_match.kwargs.period.prep_desc %}Balance Sheet {{ prep_period }}{% endblocktrans %}
|
2020-07-21 00:31:31 +08:00
|
|
|
{% setvar "title" title %}
|
|
|
|
{% setvar "use_period_chooser" True %}
|
2020-08-03 00:20:26 +08:00
|
|
|
{% static "accounting/css/report.css" as file %}{% add_css file %}
|
2020-07-21 00:31:31 +08:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
|
|
|
|
<div class="btn-group btn-actions">
|
|
|
|
<div class="btn-group">
|
|
|
|
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
|
|
|
|
<i class="fas fa-edit"></i>
|
2020-08-06 00:41:29 +08:00
|
|
|
{{ _("New")|force_escape }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</button>
|
|
|
|
<div class="dropdown-menu">
|
2020-07-23 22:02:26 +08:00
|
|
|
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
|
2020-08-06 00:41:29 +08:00
|
|
|
{{ _("Cash Expense")|force_escape }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</a>
|
2020-07-23 22:02:26 +08:00
|
|
|
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
|
2020-08-06 00:41:29 +08:00
|
|
|
{{ _("Cash Income")|force_escape }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</a>
|
2020-07-23 22:02:26 +08:00
|
|
|
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
|
2020-08-06 00:41:29 +08:00
|
|
|
{{ _("Transfer")|force_escape }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-08-08 13:43:11 +08:00
|
|
|
{% with current_report_icon="fas fa-balance-scale" current_report_title=_("Balance Sheet") period=request.resolver_match.kwargs.period %}
|
2020-07-21 00:31:31 +08:00
|
|
|
{% include "accounting/include/report-chooser.html" %}
|
|
|
|
{% endwith %}
|
|
|
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal">
|
|
|
|
<i class="far fa-calendar-alt"></i>
|
2020-08-08 13:43:11 +08:00
|
|
|
<span class="d-none d-md-inline">{{ request.resolver_match.kwargs.period.description }}</span>
|
2020-08-07 00:05:05 +08:00
|
|
|
<span class="d-md-none">{{ _("Period")|force_escape }}</span>
|
2020-07-21 00:31:31 +08:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
2020-08-08 13:43:11 +08:00
|
|
|
{% with period=request.resolver_match.kwargs.period %}
|
|
|
|
{% include "mia_core/include/period-chooser.html" %}
|
|
|
|
{% endwith %}
|
2020-07-21 00:31:31 +08:00
|
|
|
|
|
|
|
{# The table for large screens #}
|
|
|
|
<div class="d-none d-lg-block report-block report-block-lg">
|
|
|
|
<div class="row justify-content-center">
|
2020-08-03 22:31:13 +08:00
|
|
|
<h2>{{ title|title_case }}</h2>
|
2020-07-21 00:31:31 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-6">
|
|
|
|
<table class="table table-borderless table-hover table-sm balance-sheet-table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2020-08-03 22:31:13 +08:00
|
|
|
<th colspan="3" scope="col">{{ assets.title|title_case }}</th>
|
2020-07-21 00:31:31 +08:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2020-07-21 11:58:50 +08:00
|
|
|
{% for group in assets.groups %}
|
2020-07-21 00:31:31 +08:00
|
|
|
<tr class="group-title">
|
2020-08-03 22:31:13 +08:00
|
|
|
<td><div>{{ group.title|title_case }}</div></td>
|
2020-07-21 00:31:31 +08:00
|
|
|
<td class="amount"></td>
|
|
|
|
<td class="actions"></td>
|
|
|
|
</tr>
|
2020-08-08 13:53:48 +08:00
|
|
|
{% for account in group.details %}
|
2020-07-21 00:31:31 +08:00
|
|
|
<tr>
|
2020-08-08 13:53:48 +08:00
|
|
|
<td><div class="account">{{ account.title|title_case }}</div></td>
|
|
|
|
<td class="amount {% if account.amount < 0 %} text-danger {% endif %}">{{ account.amount|accounting_amount }}</td>
|
2020-07-21 00:31:31 +08:00
|
|
|
<td class="actions">
|
2020-08-08 13:53:48 +08:00
|
|
|
<a href="{{ account.url }}" class="btn btn-info" role="button">
|
2020-07-21 00:31:31 +08:00
|
|
|
<i class="fas fa-eye"></i>
|
2020-08-06 23:55:24 +08:00
|
|
|
{{ _("View")|force_escape }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-sm-6">
|
|
|
|
<table class="table table-borderless table-hover table-sm balance-sheet-table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2020-08-03 22:31:13 +08:00
|
|
|
<th colspan="3" scope="col">{{ liabilities.title|title_case }}</th>
|
2020-07-21 00:31:31 +08:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2020-07-21 11:58:50 +08:00
|
|
|
{% for group in liabilities.groups %}
|
2020-07-21 00:31:31 +08:00
|
|
|
<tr class="group-title">
|
2020-08-03 22:31:13 +08:00
|
|
|
<td><div>{{ group.title|title_case }}</div></td>
|
2020-07-21 00:31:31 +08:00
|
|
|
<td class="amount"></td>
|
|
|
|
<td class="actions"></td>
|
|
|
|
</tr>
|
2020-08-08 13:53:48 +08:00
|
|
|
{% for account in group.details %}
|
2020-07-21 00:31:31 +08:00
|
|
|
<tr>
|
2020-08-08 13:53:48 +08:00
|
|
|
<td><div class="account">{{ account.title|title_case }}</div></td>
|
|
|
|
<td class="amount {% if account.amount < 0 %} text-danger {% endif %}">{{ account.amount|accounting_amount }}</td>
|
2020-07-21 00:31:31 +08:00
|
|
|
<td class="actions">
|
2020-08-08 13:53:48 +08:00
|
|
|
<a href="{{ account.url }}" class="btn btn-info" role="button">
|
2020-07-21 00:31:31 +08:00
|
|
|
<i class="fas fa-eye"></i>
|
2020-08-06 23:55:24 +08:00
|
|
|
{{ _("View")|force_escape }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
<tfoot>
|
|
|
|
<tr class="total">
|
2020-08-06 23:55:24 +08:00
|
|
|
<td>{{ _("Total")|force_escape }}</td>
|
2020-08-02 19:42:48 +08:00
|
|
|
<td class="amount {% if liabilities.amount < 0 %} text-danger {% endif %}">
|
|
|
|
{{ liabilities.amount|accounting_amount }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tfoot>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<table class="table table-borderless table-hover table-sm balance-sheet-table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2020-08-03 22:31:13 +08:00
|
|
|
<th colspan="3" scope="col">{{ owners_equity.title|title_case }}</th>
|
2020-07-21 00:31:31 +08:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2020-07-21 11:58:50 +08:00
|
|
|
{% for group in owners_equity.groups %}
|
2020-07-21 00:31:31 +08:00
|
|
|
<tr class="group-title">
|
2020-08-03 22:31:13 +08:00
|
|
|
<td><div>{{ group.title|title_case }}</div></td>
|
2020-07-21 00:31:31 +08:00
|
|
|
<td class="amount"></td>
|
|
|
|
<td class="actions"></td>
|
|
|
|
</tr>
|
2020-08-08 13:53:48 +08:00
|
|
|
{% for account in group.details %}
|
2020-07-21 00:31:31 +08:00
|
|
|
<tr>
|
2020-08-08 13:53:48 +08:00
|
|
|
<td><div class="account">{{ account.title|title_case }}</div></td>
|
|
|
|
<td class="amount {% if account.amount < 0 %} text-danger {% endif %}">{{ account.amount|accounting_amount }}</td>
|
2020-07-21 00:31:31 +08:00
|
|
|
<td class="actions">
|
2020-08-08 13:53:48 +08:00
|
|
|
<a href="{{ account.url }}" class="btn btn-info" role="button">
|
2020-07-21 00:31:31 +08:00
|
|
|
<i class="fas fa-eye"></i>
|
2020-08-06 23:55:24 +08:00
|
|
|
{{ _("View")|force_escape }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
<tfoot>
|
|
|
|
<tr class="total">
|
2020-08-06 23:55:24 +08:00
|
|
|
<td>{{ _("Total")|force_escape }}</td>
|
2020-08-02 19:42:48 +08:00
|
|
|
<td class="amount {% if owners_equity.amount < 0 %} text-danger {% endif %}">
|
|
|
|
{{ owners_equity.amount|accounting_amount }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tfoot>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-6 assets-total">
|
|
|
|
<table class="table table-borderless table-hover table-sm balance-sheet-total-table">
|
|
|
|
<tfoot>
|
|
|
|
<tr class="total">
|
2020-08-06 23:55:24 +08:00
|
|
|
<td class="align-middle">{{ _("Total")|force_escape }}</td>
|
2020-08-02 19:42:48 +08:00
|
|
|
<td class="text-right align-middle font-italic {% if assets.amount < 0 %} text-danger {% endif %}">
|
|
|
|
{{ assets.amount|accounting_amount }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tfoot>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-sm-6 liabilities-total">
|
|
|
|
<table class="table table-borderless table-hover table-sm balance-sheet-total-table">
|
|
|
|
<tfoot>
|
|
|
|
<tr class="total">
|
2020-08-06 23:55:24 +08:00
|
|
|
<td class="align-middle">{{ _("Total")|force_escape }}</td>
|
2020-08-02 19:42:48 +08:00
|
|
|
<td class="text-right align-middle font-italic {% if liabilities.amount|add:owners_equity.amount < 0 %} text-danger {% endif %}">
|
|
|
|
{{ liabilities.amount|add:owners_equity.amount|accounting_amount }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tfoot>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{# The list for small screens #}
|
|
|
|
<div class="d-lg-none report-block report-block-sm">
|
|
|
|
<div class="row justify-content-center">
|
|
|
|
<h2>{{ title|escape }}</h2>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-6">
|
|
|
|
<ul class="list-group balance-sheet-list">
|
|
|
|
<li class="list-group-item section-title">
|
2020-08-03 22:31:13 +08:00
|
|
|
{{ assets.title|title_case }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</li>
|
2020-07-21 11:58:50 +08:00
|
|
|
{% for group in assets.groups %}
|
2020-07-21 00:31:31 +08:00
|
|
|
<li class="list-group-item d-flex justify-content-between align-items-center group-title">
|
2020-08-03 22:31:13 +08:00
|
|
|
{{ group.title|title_case }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</li>
|
2020-08-08 13:53:48 +08:00
|
|
|
{% for account in group.details %}
|
2020-07-21 10:38:47 +08:00
|
|
|
<li class="list-group-item d-flex justify-content-between align-items-center account">
|
2020-08-08 13:53:48 +08:00
|
|
|
<a class="list-group-item-action" href="{{ account.url }}">
|
|
|
|
{{ account.title|title_case }}
|
2020-07-21 00:31:31 +08:00
|
|
|
<div class="float-right">
|
2020-08-08 13:53:48 +08:00
|
|
|
<span class="badge {% if account.amount < 0 %} badge-warning {% else %} badge-secondary {% endif %} badge-pill">
|
|
|
|
{{ account.amount|accounting_amount }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
<li class="list-group-item d-flex justify-content-between align-items-center grand-total">
|
2020-08-06 23:55:24 +08:00
|
|
|
{{ _("Total")|force_escape }}
|
2020-08-02 19:42:48 +08:00
|
|
|
<span class="badge {% if assets.amount < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
|
|
|
|
{{ assets.amount|accounting_amount }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</span>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-sm-6">
|
|
|
|
<ul class="list-group balance-sheet-list">
|
|
|
|
<li class="list-group-item section-title">
|
2020-08-03 22:31:13 +08:00
|
|
|
{{ liabilities.title|title_case }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</li>
|
2020-07-21 11:58:50 +08:00
|
|
|
{% for group in liabilities.groups %}
|
2020-07-21 00:31:31 +08:00
|
|
|
<li class="list-group-item d-flex justify-content-between align-items-center group-title">
|
2020-08-03 22:31:13 +08:00
|
|
|
{{ group.title|title_case }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</li>
|
2020-08-08 13:53:48 +08:00
|
|
|
{% for account in group.details %}
|
2020-07-21 10:38:47 +08:00
|
|
|
<li class="list-group-item d-flex justify-content-between align-items-center account">
|
2020-08-08 13:53:48 +08:00
|
|
|
<a class="list-group-item-action" href="{{ account.url }}">
|
|
|
|
{{ account.title|title_case }}
|
2020-07-21 00:31:31 +08:00
|
|
|
<div class="float-right">
|
2020-08-08 13:53:48 +08:00
|
|
|
<span class="badge {% if account.amount < 0 %} badge-warning {% else %} badge-secondary {% endif %} badge-pill">
|
|
|
|
{{ account.amount|accounting_amount }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
<li class="list-group-item d-flex justify-content-between align-items-center total">
|
2020-08-06 23:55:24 +08:00
|
|
|
{{ _("Total")|force_escape }}
|
2020-08-02 19:42:48 +08:00
|
|
|
<span class="badge {% if liabilities.amount < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
|
|
|
|
{{ liabilities.amount|accounting_amount }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</span>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<ul class="list-group balance-sheet-list">
|
|
|
|
<li class="list-group-item section-title">
|
2020-08-03 22:31:13 +08:00
|
|
|
{{ owners_equity.title|title_case }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</li>
|
2020-07-21 11:58:50 +08:00
|
|
|
{% for group in owners_equity.groups %}
|
2020-07-21 00:31:31 +08:00
|
|
|
<li class="list-group-item d-flex justify-content-between align-items-center group-title">
|
2020-08-03 22:31:13 +08:00
|
|
|
{{ group.title|title_case }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</li>
|
2020-08-08 13:53:48 +08:00
|
|
|
{% for account in group.details %}
|
2020-07-21 10:38:47 +08:00
|
|
|
<li class="list-group-item d-flex justify-content-between align-items-center account">
|
2020-08-08 13:53:48 +08:00
|
|
|
<a class="list-group-item-action" href="{{ account.url }}">
|
|
|
|
{{ account.title|title_case }}
|
2020-07-21 00:31:31 +08:00
|
|
|
<div class="float-right">
|
2020-08-08 13:53:48 +08:00
|
|
|
<span class="badge {% if account.amount < 0 %} badge-warning {% else %} badge-secondary {% endif %} badge-pill">
|
|
|
|
{{ account.amount|accounting_amount }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
<li class="list-group-item d-flex justify-content-between align-items-center total">
|
2020-08-06 23:55:24 +08:00
|
|
|
{{ _("Total")|force_escape }}
|
2020-08-02 19:42:48 +08:00
|
|
|
<span class="badge {% if owners_equity.amount < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
|
|
|
|
{{ owners_equity.amount|accounting_amount }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</span>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<ul class="list-group balance-sheet-list">
|
|
|
|
<li class="list-group-item d-flex justify-content-between align-items-center grand-total">
|
2020-08-06 23:55:24 +08:00
|
|
|
{{ _("Total")|force_escape }}
|
2020-08-02 19:42:48 +08:00
|
|
|
<span class="badge {% if liabilities.amount|add:owners_equity.amount < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
|
|
|
|
{{ liabilities.amount|add:owners_equity.amount|accounting_amount }}
|
2020-07-21 00:31:31 +08:00
|
|
|
</span>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% endblock %}
|