Added the transaction views in the accounting application.
This commit is contained in:
@ -44,18 +44,15 @@ First written: 2020/7/20
|
||||
{{ text|force_escape }}
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
{% url "accounting:transaction.create" "expense" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
|
||||
{% trans "Cash Expense" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
{% url "accounting:transaction.create" "income" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
|
||||
{% trans "Cash Income" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
{% url "accounting:transaction.create" "transfer" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
|
||||
{% trans "Transfer" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
|
@ -43,18 +43,15 @@ First written: 2020/7/15
|
||||
{{ text|force_escape }}
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
{% url "accounting:transaction.create" "expense" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
|
||||
{% trans "Cash Expense" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
{% url "accounting:transaction.create" "income" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
|
||||
{% trans "Cash Income" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
{% url "accounting:transaction.create" "transfer" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
|
||||
{% trans "Transfer" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
|
@ -44,18 +44,15 @@ First written: 2020/7/1
|
||||
{{ text|force_escape }}
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
{% url "accounting:transaction.create" "expense" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
|
||||
{% trans "Cash Expense" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
{% url "accounting:transaction.create" "income" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
|
||||
{% trans "Cash Income" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
{% url "accounting:transaction.create" "transfer" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
|
||||
{% trans "Transfer" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
@ -131,7 +128,7 @@ First written: 2020/7/1
|
||||
<td class="amount {% if item.balance < 0 %} text-danger {% endif %}">{{ item.balance|accounting_amount }}</td>
|
||||
<td class="actions">
|
||||
{% if item.sn is not None %}
|
||||
<a href="{{ item.transaction.get_absolute_url }}" class="btn btn-info" role="button">
|
||||
<a href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}" class="btn btn-info" role="button">
|
||||
<i class="fas fa-eye"></i>
|
||||
<span class="d-none d-lg-inline">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</span>
|
||||
</a>
|
||||
@ -147,7 +144,7 @@ First written: 2020/7/1
|
||||
{% for item in item_list %}
|
||||
<li class="list-group-item {% if not item.is_balanced or item.has_order_hole %} list-group-item-danger {% endif %}">
|
||||
{% if item.sn is not None %}
|
||||
<a class="list-group-item-action" href="{{ item.transaction.get_absolute_url }}">
|
||||
<a class="list-group-item-action" href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}">
|
||||
<div class="date-account-line d-flex justify-content-between align-items-center">
|
||||
{{ item.transaction.date|smart_date }} {{ item.account.title|title }}
|
||||
</div>
|
||||
|
@ -44,18 +44,15 @@ First written: 2020/7/19
|
||||
{{ text|force_escape }}
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
{% url "accounting:transaction.create" "expense" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
|
||||
{% trans "Cash Expense" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
{% url "accounting:transaction.create" "income" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
|
||||
{% trans "Cash Income" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
{% url "accounting:transaction.create" "transfer" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
|
||||
{% trans "Transfer" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
|
@ -44,18 +44,15 @@ First written: 2020/7/17
|
||||
{{ text|force_escape }}
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
{% url "accounting:transaction.create" "expense" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
|
||||
{% trans "Cash Expense" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
{% url "accounting:transaction.create" "income" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
|
||||
{% trans "Cash Income" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
{% url "accounting:transaction.create" "transfer" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
|
||||
{% trans "Transfer" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
@ -111,7 +108,7 @@ First written: 2020/7/17
|
||||
<td>{{ item.transaction.note|default:"" }}</td>
|
||||
<td class="actions">
|
||||
{% if item.sn is not None %}
|
||||
<a href="{{ item.transaction.get_absolute_url }}" class="btn btn-info" role="button">
|
||||
<a href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}" class="btn btn-info" role="button">
|
||||
<i class="fas fa-eye"></i>
|
||||
{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}
|
||||
</a>
|
||||
@ -127,7 +124,7 @@ First written: 2020/7/17
|
||||
{% for item in item_list %}
|
||||
<li class="list-group-item {% if not item.is_balanced or item.has_order_hole %} list-group-item-danger {% endif %}">
|
||||
{% if item.sn is not None %}
|
||||
<a class="list-group-item-action" href="{{ item.transaction.get_absolute_url }}">
|
||||
<a class="list-group-item-action" href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}">
|
||||
<div class="{% if item.is_credit %} journal-credit {% else %} journal-debit {% endif %}">
|
||||
<div class="date-account-line">
|
||||
{{ item.transaction.date|smart_date }} {{ item.account.title|title }}
|
||||
|
@ -43,18 +43,15 @@ First written: 2020/7/16
|
||||
{{ text|force_escape }}
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
{% url "accounting:transaction.create" "expense" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
|
||||
{% trans "Cash Expense" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
{% url "accounting:transaction.create" "income" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
|
||||
{% trans "Cash Income" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
{% url "accounting:transaction.create" "transfer" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
|
||||
{% trans "Transfer" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
|
@ -44,18 +44,15 @@ First written: 2020/7/16
|
||||
{{ text|force_escape }}
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
{% url "accounting:transaction.create" "expense" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
|
||||
{% trans "Cash Expense" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
{% url "accounting:transaction.create" "income" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
|
||||
{% trans "Cash Income" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
{% url "accounting:transaction.create" "transfer" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
|
||||
{% trans "Transfer" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
@ -134,7 +131,7 @@ First written: 2020/7/16
|
||||
<td class="amount {% if item.balance < 0 %} text-danger {% endif %}">{{ item.balance|accounting_amount }}</td>
|
||||
<td class="actions">
|
||||
{% if item.sn is not None %}
|
||||
<a href="{{ item.transaction.get_absolute_url }}" class="btn btn-info" role="button">
|
||||
<a href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}" class="btn btn-info" role="button">
|
||||
<i class="fas fa-eye"></i>
|
||||
<span class="d-none d-lg-inline">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</span>
|
||||
</a>
|
||||
@ -150,7 +147,7 @@ First written: 2020/7/16
|
||||
{% for item in item_list %}
|
||||
<li class="list-group-item {% if not item.is_balanced or item.has_order_hole or not item.is_credit_card_paid %} list-group-item-danger {% endif %}{% if item.is_existing_equipment %} list-group-item-info {% endif %}">
|
||||
{% if item.sn is not None %}
|
||||
<a class="list-group-item-action" href="{{ item.transaction.get_absolute_url }}">
|
||||
<a class="list-group-item-action" href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}">
|
||||
<div class="date-account-line">
|
||||
{{ item.transaction.date|smart_date }} {{ item.account.title|title }}
|
||||
</div>
|
||||
|
@ -44,18 +44,15 @@ First written: 2020/7/21
|
||||
{{ text|force_escape }}
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
{% url "accounting:transaction.create" "expense" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
|
||||
{% trans "Cash Expense" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
{% url "accounting:transaction.create" "income" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
|
||||
{% trans "Cash Income" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
{% url "accounting:transaction.create" "transfer" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
|
||||
{% trans "Transfer" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
@ -113,7 +110,7 @@ First written: 2020/7/21
|
||||
<td class="amount">{{ item.credit_amount|accounting_amount }}</td>
|
||||
<td>{{ item.transaction.note|default:"" }}</td>
|
||||
<td class="actions">
|
||||
<a href="{{ item.transaction.get_absolute_url }}" class="btn btn-info" role="button">
|
||||
<a href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}" class="btn btn-info" role="button">
|
||||
<i class="fas fa-eye"></i>
|
||||
{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}
|
||||
</a>
|
||||
@ -127,7 +124,7 @@ First written: 2020/7/21
|
||||
<ul class="list-group d-md-none">
|
||||
{% for item in item_list %}
|
||||
<li class="list-group-item {% if not item.is_balanced or item.has_order_hole %} list-group-item-danger {% endif %}">
|
||||
<a class="list-group-item-action" href="{{ item.transaction.get_absolute_url }}">
|
||||
<a class="list-group-item-action" href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}">
|
||||
<div class="{% if item.is_credit %} journal-credit {% else %} journal-debit {% endif %}">
|
||||
<div class="date-account-line">
|
||||
{{ item.transaction.date|smart_date }} {{ item.account.title|title }}
|
||||
|
117
accounting/templates/accounting/transactions/expense/show.html
Normal file
117
accounting/templates/accounting/transactions/expense/show.html
Normal file
@ -0,0 +1,117 @@
|
||||
{% extends "base.html" %}
|
||||
{% comment %}
|
||||
The Mia Accounting Application
|
||||
cash.html: The template for a cash-expense transaction
|
||||
|
||||
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/23
|
||||
{% endcomment %}
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load mia_core %}
|
||||
{% load accounting %}
|
||||
|
||||
{% block settings %}
|
||||
{% trans "Cash Expense Transaction" context "Accounting|" as title %}
|
||||
{% setvar "title" title %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if item.has_order_hole %}
|
||||
<div class="alert alert-danger alert-dismissible fade show">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<strong>{{ _("Error:") }}</strong> {% trans "The transactions on this day are not well-ordered. Please reorder them." context "Accounting|" as text %}{{ text|force_escape }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-2">{% trans "Date:" context "Accounting|" as text %}{{ text|force_escape }}</div>
|
||||
<div class="col-sm-10">{{ item.date|smart_date }}</div>
|
||||
</div>
|
||||
|
||||
<table class="table table-striped table-hover d-none d-sm-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</th>
|
||||
<th scope="col">{% trans "Summary" context "Accounting|" as text %}{{ text|force_escape }}</th>
|
||||
<th class="amount" scope="col">{% trans "$" context "Accounting|" as text %}{{ text|force_escape }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for x in item.debit_records %}
|
||||
<tr>
|
||||
<td>{{ x.account.title|title }}</td>
|
||||
<td>{{ x.summary|default:"" }}</td>
|
||||
<td class="amount">{{ x.amount|accounting_amount }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2">{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}</td>
|
||||
<td class="amount">{{ item.debit_total|accounting_amount }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<ul class="list-group d-sm-none">
|
||||
{% for x in item.debit_records %}
|
||||
<li class="list-group-item">
|
||||
<div class="d-flex justify-content-between align-items-center subject-line">
|
||||
{{ x.account.title|title }}
|
||||
<span class="badge badge-info">{{ x.amount|accounting_amount }}</span>
|
||||
</div>
|
||||
<div>{{ x.summary|default:"" }}</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
<li class="list-group-item">
|
||||
<div class="d-flex justify-content-between align-items-center subject-line">
|
||||
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}
|
||||
<span class="badge badge-info">{{ item.debit_total|accounting_amount }}</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{% if item.notes %}
|
||||
<div class="row">
|
||||
<div class="col-sm-2">{% trans "Notes:" context "Accounting|" as text %}{{ text|force_escape }}</div>
|
||||
<div class="col-sm-10">{{ item.notes }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-2">{{ _("Created at:") }}</div>
|
||||
<div class="col-sm-10">{{ item.created_at }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-2">{{ _("Created by:") }}</div>
|
||||
<div class="col-sm-10">{{ item.created_by.name }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-2">{{ _("Updated at:") }}</div>
|
||||
<div class="col-sm-10">{{ item.updated_at }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-2">{{ _("Updated by:") }}</div>
|
||||
<div class="col-sm-10">{{ item.updated_by.name }}</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
119
accounting/templates/accounting/transactions/income/show.html
Normal file
119
accounting/templates/accounting/transactions/income/show.html
Normal file
@ -0,0 +1,119 @@
|
||||
{% extends "base.html" %}
|
||||
{% comment %}
|
||||
The Mia Accounting Application
|
||||
cash.html: The template for a cash-income transaction
|
||||
|
||||
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/23
|
||||
{% endcomment %}
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load mia_core %}
|
||||
{% load accounting %}
|
||||
|
||||
{% block settings %}
|
||||
{% trans "Cash Income Transaction" context "Accounting|" as title %}
|
||||
{% setvar "title" title %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if item.has_order_hole %}
|
||||
<div class="alert alert-danger alert-dismissible fade show">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<strong>{{ _("Error:") }}</strong> {% trans "The transactions on this day are not well-ordered. Please reorder them." context "Accounting|" as text %}{{ text|force_escape }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-2">{% trans "Date:" context "Accounting|" as text %}{{ text|force_escape }}</div>
|
||||
<div class="col-sm-10">{{ item.date|smart_date }}</div>
|
||||
</div>
|
||||
|
||||
<table class="table table-striped table-hover d-none d-sm-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</th>
|
||||
<th scope="col">{% trans "Summary" context "Accounting|" as text %}{{ text|force_escape }}</th>
|
||||
<th class="amount" scope="col">{% trans "$" context "Accounting|" as text %}{{ text|force_escape }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for x in item.credit_records %}
|
||||
<tr>
|
||||
<td>{{ x.account.title|title }}</td>
|
||||
<td>{{ x.summary|default:"" }}</td>
|
||||
<td class="amount">{{ x.amount|accounting_amount }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2">{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}</td>
|
||||
<td class="amount">{{ item.credit_total|accounting_amount }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<ul class="list-group d-sm-none">
|
||||
{% for x in item.credit_records %}
|
||||
<li class="list-group-item">
|
||||
<div class="d-flex justify-content-between align-items-center subject-line">
|
||||
{{ x.account.title|title }}
|
||||
<span class="badge badge-info">{{ x.amount|accounting_amount }}</span>
|
||||
</div>
|
||||
<div>{{ x.summary|default:"" }}</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
<li class="list-group-item">
|
||||
<div class="d-flex justify-content-between align-items-center subject-line">
|
||||
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}
|
||||
<span class="badge badge-info">{{ item.credit_total|accounting_amount }}</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{% if item.notes %}
|
||||
<div class="row">
|
||||
<div class="col-sm-2">{% trans "Notes:" context "Accounting|" as text %}{{ text|force_escape }}</div>
|
||||
<div class="col-sm-10">{{ item.notes }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-2">{{ _("Created at:") }}</div>
|
||||
<div class="col-sm-10">{{ item.created_at }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-2">{{ _("Created by:") }}</div>
|
||||
<div class="col-sm-10">{{ item.created_by.name }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-2">{{ _("Updated at:") }}</div>
|
||||
<div class="col-sm-10">{{ item.updated_at }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-2">{{ _("Updated by:") }}</div>
|
||||
<div class="col-sm-10">{{ item.updated_by.name }}</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
171
accounting/templates/accounting/transactions/transfer/show.html
Normal file
171
accounting/templates/accounting/transactions/transfer/show.html
Normal file
@ -0,0 +1,171 @@
|
||||
{% extends "base.html" %}
|
||||
{% comment %}
|
||||
The Mia Accounting Application
|
||||
cash.html: The template for a transfer transaction
|
||||
|
||||
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/23
|
||||
{% endcomment %}
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load mia_core %}
|
||||
{% load accounting %}
|
||||
|
||||
{% block settings %}
|
||||
{% trans "Transfer Transaction" context "Accounting|" as title %}
|
||||
{% setvar "title" title %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if item.has_order_hole %}
|
||||
<div class="alert alert-danger alert-dismissible fade show">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<strong>{{ _("Error:") }}</strong> {% trans "The transactions on this day are not well-ordered. Please reorder them." context "Accounting|" as text %}{{ text|force_escape }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-2">{% trans "Date:" context "Accounting|" as text %}{{ text|force_escape }}</div>
|
||||
<div class="col-sm-10">{{ item.date|smart_date }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<h2>{% trans "Debit" context "Accounting|" as text %}{{ text|force_escape }}</h2>
|
||||
|
||||
<table class="table table-striped table-hover d-none d-lg-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</th>
|
||||
<th scope="col">{% trans "Summary" context "Accounting|" as text %}{{ text|force_escape }}</th>
|
||||
<th class="amount" scope="col">{% trans "$" context "Accounting|" as text %}{{ text|force_escape }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for x in item.debit_records %}
|
||||
<tr>
|
||||
<td>{{ x.account.title|title }}</td>
|
||||
<td>{{ x.summary|default:"" }}</td>
|
||||
<td class="amount">{{ x.amount|accounting_amount }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2">{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}</td>
|
||||
<td class="amount">{{ item.debit_total|accounting_amount }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<ul class="list-group d-lg-none">
|
||||
{% for x in item.debit_records %}
|
||||
<li class="list-group-item">
|
||||
<div class="d-flex justify-content-between align-items-center subject-line">
|
||||
{{ x.account.title|title }}
|
||||
<span class="badge badge-info">{{ x.amount|accounting_amount }}</span>
|
||||
</div>
|
||||
<div>{{ x.summary|default:"" }}</div>x
|
||||
</li>
|
||||
{% endfor %}
|
||||
<li class="list-group-item">
|
||||
<div class="d-flex justify-content-between align-items-center subject-line">
|
||||
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}
|
||||
<span class="badge badge-info">{{ item.debit_total|accounting_amount }}</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<h2>{% trans "Credit" context "Accounting|" as text %}{{ text|force_escape }}</h2>
|
||||
|
||||
<table class="table table-striped table-hover d-none d-lg-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</th>
|
||||
<th scope="col">{% trans "Summary" context "Accounting|" as text %}{{ text|force_escape }}</th>
|
||||
<th class="amount" scope="col">{% trans "$" context "Accounting|" as text %}{{ text|force_escape }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for x in item.credit_records %}
|
||||
<tr>
|
||||
<td>{{ x.account.title|title }}</td>
|
||||
<td>{{ x.summary|default:"" }}</td>
|
||||
<td class="amount">{{ x.amount|accounting_amount }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2">{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}</td>
|
||||
<td class="amount">{{ item.credit_total|accounting_amount }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<ul class="list-group d-lg-none">
|
||||
{% for x in item.credit_records %}
|
||||
<li class="list-group-item">
|
||||
<div class="d-flex justify-content-between align-items-center subject-line">
|
||||
{{ x.account.title|title }}
|
||||
<span class="badge badge-info">{{ x.amount|accounting_amount }}</span>
|
||||
</div>
|
||||
<div>{{ x.summary|default:"" }}</div>x
|
||||
</li>
|
||||
% }
|
||||
{% endfor %}
|
||||
<li class="list-group-item">
|
||||
<div class="d-flex justify-content-between align-items-center subject-line">
|
||||
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}
|
||||
<span class="badge badge-info">{{ item.credit_total|accounting_amount }}</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if item.notes %}
|
||||
<div class="row">
|
||||
<div class="col-sm-2">{% trans "Notes:" context "Accounting|" as text %}{{ text|force_escape }}</div>
|
||||
<div class="col-sm-10">{{ item.notes }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-2">{{ _("Created at:") }}</div>
|
||||
<div class="col-sm-10">{{ item.created_at }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-2">{{ _("Created by:") }}</div>
|
||||
<div class="col-sm-10">{{ item.created_by.name }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-2">{{ _("Updated at:") }}</div>
|
||||
<div class="col-sm-10">{{ item.updated_at }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-2">{{ _("Updated by:") }}</div>
|
||||
<div class="col-sm-10">{{ item.updated_by.name }}</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
@ -44,18 +44,15 @@ First written: 2020/7/19
|
||||
{{ text|force_escape }}
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
{% url "accounting:transaction.create" "expense" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
|
||||
{% trans "Cash Expense" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
{% url "accounting:transaction.create" "income" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
|
||||
{% trans "Cash Income" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
{% url "accounting:transaction.create" "transfer" as url %}
|
||||
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
|
||||
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
|
||||
{% trans "Transfer" context "Accounting|" as text %}
|
||||
{{ text|force_escape }}
|
||||
</a>
|
||||
|
Reference in New Issue
Block a user