Renamed "voucher" to "journal entry".

This commit is contained in:
2023-03-20 22:08:58 +08:00
parent 8f909965a9
commit b1af1d7425
74 changed files with 1956 additions and 1816 deletions

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
create.html: The cash disbursement voucher creation form
create.html: The cash disbursement journal entry creation form
Copyright (c) 2023 imacat.
@ -19,10 +19,10 @@ create.html: The cash disbursement voucher creation form
Author: imacat@mail.imacat.idv.tw (imacat)
First written: 2023/2/25
#}
{% extends "accounting/voucher/disbursement/include/form.html" %}
{% extends "accounting/journal-entry/disbursement/include/form.html" %}
{% block header %}{% block title %}{{ A_("Add a New Cash Disbursement Voucher") }}{% endblock %}{% endblock %}
{% block header %}{% block title %}{{ A_("Add a New Cash Disbursement Journal Entry") }}{% endblock %}{% endblock %}
{% block back_url %}{{ request.args.get("next") or url_for("accounting.report.default") }}{% endblock %}
{% block action_url %}{{ url_for("accounting.voucher.store", voucher_type=voucher_type) }}{% endblock %}
{% block action_url %}{{ url_for("accounting.journal-entry.store", journal_entry_type=journal_entry_type) }}{% endblock %}

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
detail.html: The cash disbursement voucher detail
detail.html: The cash disbursement journal entry detail
Copyright (c) 2023 imacat.
@ -19,16 +19,16 @@ detail.html: The cash disbursement voucher detail
Author: imacat@mail.imacat.idv.tw (imacat)
First written: 2023/2/26
#}
{% extends "accounting/voucher/include/detail.html" %}
{% extends "accounting/journal-entry/include/detail.html" %}
{% block to_transfer %}
<a class="btn btn-primary" href="{{ url_for("accounting.voucher.edit", voucher=obj)|accounting_voucher_to_transfer|accounting_inherit_next }}">
<a class="btn btn-primary" href="{{ url_for("accounting.journal-entry.edit", journal_entry=obj)|accounting_journal_entry_to_transfer|accounting_inherit_next }}">
<i class="fa-solid fa-bars-staggered"></i>
{{ A_("To Transfer") }}
</a>
{% endblock %}
{% block voucher_currencies %}
{% block journal_entry_currencies %}
{% for currency in obj.currencies %}
<div class="mb-3">
<div class="mb-2 fw-bolder">{{ currency.name }}</div>
@ -36,7 +36,7 @@ First written: 2023/2/26
<ul class="list-group accounting-list-group-stripped accounting-list-group-hover">
<li class="list-group-item accounting-journal-entry-line-item accounting-journal-entry-line-item-header">{{ A_("Content") }}</li>
{% with line_items = currency.debit %}
{% include "accounting/voucher/include/detail-line-items.html" %}
{% include "accounting/journal-entry/include/detail-line-items.html" %}
{% endwith %}
<li class="list-group-item accounting-journal-entry-line-item accounting-journal-entry-line-item-total">
<div class="d-flex justify-content-between">

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
edit.html: The transfer voucher edit form
edit.html: The cash disbursement journal entry edit form
Copyright (c) 2023 imacat.
@ -19,10 +19,10 @@ edit.html: The transfer voucher edit form
Author: imacat@mail.imacat.idv.tw (imacat)
First written: 2023/2/25
#}
{% extends "accounting/voucher/transfer/include/form.html" %}
{% extends "accounting/journal-entry/disbursement/include/form.html" %}
{% block header %}{% block title %}{{ A_("Editing %(voucher)s", voucher=voucher) }}{% endblock %}{% endblock %}
{% block header %}{% block title %}{{ A_("Editing %(journal_entry)s", journal_entry=journal_entry) }}{% endblock %}{% endblock %}
{% block back_url %}{{ url_for("accounting.voucher.detail", voucher=voucher)|accounting_inherit_next }}{% endblock %}
{% block back_url %}{{ url_for("accounting.journal-entry.detail", journal_entry=journal_entry)|accounting_inherit_next }}{% endblock %}
{% block action_url %}{{ url_for("accounting.voucher.update", voucher=voucher)|accounting_voucher_with_type }}{% endblock %}
{% block action_url %}{{ url_for("accounting.journal-entry.update", journal_entry=journal_entry)|accounting_journal_entry_with_type }}{% endblock %}

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
currency-sub-form.html: The currency sub-form in the cash disbursement voucher form
form-currency.html: The currency sub-form in the cash disbursement journal entry form
Copyright (c) 2023 imacat.
@ -51,7 +51,7 @@ First written: 2023/2/25
line_item_index = loop.index,
only_one_line_item_form = debit_forms|length == 1,
form = line_item_form.form %}
{% include "accounting/voucher/include/form-line-item.html" %}
{% include "accounting/journal-entry/include/form-line-item.html" %}
{% endwith %}
{% endfor %}
</ul>

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
form.html: The cash disbursement voucher form
form.html: The cash disbursement journal entry form
Copyright (c) 2023 imacat.
@ -19,7 +19,7 @@ form.html: The cash disbursement voucher form
Author: imacat@mail.imacat.idv.tw (imacat)
First written: 2023/2/25
#}
{% extends "accounting/voucher/include/form.html" %}
{% extends "accounting/journal-entry/include/form.html" %}
{% block currency_sub_forms %}
{% if form.currencies %}
@ -33,7 +33,7 @@ First written: 2023/2/25
debit_forms = currency_form.debit,
debit_errors = currency_form.debit_errors,
debit_total = currency_form.form.debit_total|accounting_format_amount %}
{% include "accounting/voucher/disbursement/include/form-currency-item.html" %}
{% include "accounting/journal-entry/disbursement/include/form-currency.html" %}
{% endwith %}
{% endfor %}
{% else %}
@ -41,17 +41,17 @@ First written: 2023/2/25
only_one_currency_form = True,
currency_code_data = accounting_default_currency_code(),
debit_total = "-" %}
{% include "accounting/voucher/disbursement/include/form-currency-item.html" %}
{% include "accounting/journal-entry/disbursement/include/form-currency.html" %}
{% endwith %}
{% endif %}
{% endblock %}
{% block form_modals %}
{% with description_editor = form.description_editor.debit %}
{% include "accounting/voucher/include/description-editor-modal.html" %}
{% include "accounting/journal-entry/include/description-editor-modal.html" %}
{% endwith %}
{% with debit_credit = "debit",
account_options = form.debit_account_options %}
{% include "accounting/voucher/include/account-selector-modal.html" %}
{% include "accounting/journal-entry/include/account-selector-modal.html" %}
{% endwith %}
{% endblock %}

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
detail-line-items-item: The line items in the voucher detail
detail-line-items-item: The line items in the journal entry detail
Copyright (c) 2023 imacat.
@ -30,7 +30,7 @@ First written: 2023/3/14
{% endif %}
{% if line_item.original_line_item %}
<div class="fst-italic small accounting-original-line-item">
<a href="{{ url_for("accounting.voucher.detail", voucher=line_item.original_line_item.voucher)|accounting_append_next }}">
<a href="{{ url_for("accounting.journal-entry.detail", journal_entry=line_item.original_line_item.journal_entry)|accounting_append_next }}">
{{ A_("Offset %(item)s", item=line_item.original_line_item) }}
</a>
</div>
@ -43,8 +43,8 @@ First written: 2023/3/14
<ul class="ms-2 ps-0">
{% for offset in line_item.offsets %}
<li>
<a href="{{ url_for("accounting.voucher.detail", voucher=offset.voucher)|accounting_append_next }}">
{{ offset.voucher.date|accounting_format_date }} {{ offset.amount|accounting_format_amount }}
<a href="{{ url_for("accounting.journal-entry.detail", journal_entry=offset.journal_entry)|accounting_append_next }}">
{{ offset.journal_entry.date|accounting_format_date }} {{ offset.amount|accounting_format_amount }}
</a>
</li>
{% endfor %}

View File

@ -31,12 +31,12 @@ First written: 2023/2/26
{{ A_("Back") }}
</a>
{% if accounting_can_edit() %}
<a class="btn btn-primary d-none d-md-inline" href="{{ url_for("accounting.voucher.edit", voucher=obj)|accounting_inherit_next }}">
<a class="btn btn-primary d-none d-md-inline" href="{{ url_for("accounting.journal-entry.edit", journal_entry=obj)|accounting_inherit_next }}">
<i class="fa-solid fa-gear"></i>
{{ A_("Settings") }}
</a>
{% endif %}
<a class="btn btn-primary" href="{{ url_for("accounting.voucher.order", voucher_date=obj.date)|accounting_append_next }}">
<a class="btn btn-primary" href="{{ url_for("accounting.journal-entry.order", journal_entry_date=obj.date)|accounting_append_next }}">
<i class="fa-solid fa-bars-staggered"></i>
{{ A_("Order") }}
</a>
@ -58,14 +58,14 @@ First written: 2023/2/26
{% if accounting_can_edit() %}
<div class="d-md-none accounting-material-fab">
<a class="btn btn-primary" href="{{ url_for("accounting.voucher.edit", voucher=obj)|accounting_inherit_next }}">
<a class="btn btn-primary" href="{{ url_for("accounting.journal-entry.edit", journal_entry=obj)|accounting_inherit_next }}">
<i class="fa-solid fa-pen-to-square"></i>
</a>
</div>
{% endif %}
{% if accounting_can_edit() and obj.can_delete %}
<form action="{{ url_for("accounting.voucher.delete", voucher=obj) }}" method="post">
<form action="{{ url_for("accounting.journal-entry.delete", journal_entry=obj) }}" method="post">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
{% if request.args.next %}
<input type="hidden" name="next" value="{{ request.args.next }}">
@ -74,11 +74,11 @@ First written: 2023/2/26
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="accounting-delete-modal-label">{{ A_("Delete Voucher Confirmation") }}</h1>
<h1 class="modal-title fs-5" id="accounting-delete-modal-label">{{ A_("Delete Journal Entry Confirmation") }}</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{{ A_("Close") }}"></button>
</div>
<div class="modal-body">
{{ A_("Do you really want to delete this voucher?") }}
{{ A_("Do you really want to delete this journal entry?") }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ A_("Cancel") }}</button>
@ -99,13 +99,13 @@ First written: 2023/2/26
{{ obj.date|accounting_format_date }}
</div>
{% block voucher_currencies %}{% endblock %}
{% block journal_entry_currencies %}{% endblock %}
{% if obj.note %}
<div class="card mb-3">
<div class="card-body">
<i class="far fa-comment-dots"></i>
{{ obj.note|accounting_voucher_text2html|safe }}
{{ obj.note|accounting_journal_entry_text2html|safe }}
</div>
</div>
{% endif %}

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
form-line-item.html: The line item sub-form in the voucher form
form-line-item.html: The line item sub-form in the journal entry form
Copyright (c) 2023 imacat.
@ -28,7 +28,7 @@ First written: 2023/2/25
<input id="accounting-currency-{{ currency_index }}-{{ debit_credit }}-{{ line_item_index }}-original-line-item-id" class="accounting-original-line-item-id" type="hidden" name="currency-{{ currency_index }}-{{ debit_credit }}-{{ line_item_index }}-original_line_item_id" value="{{ form.original_line_item_id.data|accounting_default }}" data-date="{{ form.original_line_item_date|accounting_default }}" data-text="{{ form.original_line_item_text|accounting_default }}">
<input id="accounting-currency-{{ currency_index }}-{{ debit_credit }}-{{ line_item_index }}-account-code" type="hidden" name="currency-{{ currency_index }}-{{ debit_credit }}-{{ line_item_index }}-account_code" value="{{ form.account_code.data|accounting_default }}" data-text="{{ form.account_text }}">
<input id="accounting-currency-{{ currency_index }}-{{ debit_credit }}-{{ line_item_index }}-description" type="hidden" name="currency-{{ currency_index }}-{{ debit_credit }}-{{ line_item_index }}-description" value="{{ form.description.data|accounting_default }}">
<input id="accounting-currency-{{ currency_index }}-{{ debit_credit }}-{{ line_item_index }}-amount" type="hidden" name="currency-{{ currency_index }}-{{ debit_credit }}-{{ line_item_index }}-amount" value="{{ form.amount.data|accounting_voucher_format_amount_input }}" data-min="{{ form.offset_total|accounting_default("0") }}">
<input id="accounting-currency-{{ currency_index }}-{{ debit_credit }}-{{ line_item_index }}-amount" type="hidden" name="currency-{{ currency_index }}-{{ debit_credit }}-{{ line_item_index }}-amount" value="{{ form.amount.data|accounting_journal_entry_format_amount_input }}" data-min="{{ form.offset_total|accounting_default("0") }}">
<div class="accounting-line-item-content">
<div id="accounting-currency-{{ currency_index }}-{{ debit_credit }}-{{ line_item_index }}-control" class="form-control clickable d-flex justify-content-between {% if form.all_errors %} is-invalid {% endif %}" data-bs-toggle="modal" data-bs-target="#accounting-line-item-editor-modal">
<div>
@ -43,7 +43,7 @@ First written: 2023/2/25
<div>{{ A_("Offsets") }}</div>
<ul class="ms-2 ps-0">
{% for offset in form.offsets %}
<li>{{ offset.voucher.date|accounting_format_date }} {{ offset.amount|accounting_format_amount }}</li>
<li>{{ offset.journal_entry.date|accounting_format_date }} {{ offset.amount|accounting_format_amount }}</li>
{% endfor %}
</ul>
</div>

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
form.html: The base voucher form
form.html: The base journal entry form
Copyright (c) 2023 imacat.
@ -23,7 +23,7 @@ First written: 2023/2/26
{% block accounting_scripts %}
<script src="{{ url_for("accounting.static", filename="js/drag-and-drop-reorder.js") }}"></script>
<script src="{{ url_for("accounting.static", filename="js/voucher-form.js") }}"></script>
<script src="{{ url_for("accounting.static", filename="js/journal-entry-form.js") }}"></script>
<script src="{{ url_for("accounting.static", filename="js/journal-entry-line-item-editor.js") }}"></script>
<script src="{{ url_for("accounting.static", filename="js/account-selector.js") }}"></script>
<script src="{{ url_for("accounting.static", filename="js/original-line-item-selector.js") }}"></script>
@ -88,8 +88,8 @@ First written: 2023/2/26
</div>
</form>
{% include "accounting/voucher/include/journal-entry-line-item-editor-modal.html" %}
{% include "accounting/journal-entry/include/journal-entry-line-item-editor-modal.html" %}
{% block form_modals %}{% endblock %}
{% include "accounting/voucher/include/original-line-item-selector-modal.html" %}
{% include "accounting/journal-entry/include/original-line-item-selector-modal.html" %}
{% endblock %}

View File

@ -37,8 +37,8 @@ First written: 2023/2/25
<ul id="accounting-original-line-item-selector-option-list" class="list-group accounting-selector-list">
{% for line_item in form.original_line_item_options %}
<li id="accounting-original-line-item-selector-option-{{ line_item.id }}" class="list-group-item d-flex justify-content-between accounting-clickable accounting-original-line-item-selector-option" data-id="{{ line_item.id }}" data-date="{{ line_item.voucher.date }}" data-debit-credit="{{ "debit" if line_item.is_debit else "credit" }}" data-currency-code="{{ line_item.currency.code }}" data-account-code="{{ line_item.account_code }}" data-account-text="{{ line_item.account }}" data-description="{{ line_item.description|accounting_default }}" data-net-balance="{{ line_item.net_balance|accounting_voucher_format_amount_input }}" data-text="{{ line_item }}" data-query-values="{{ line_item.query_values|tojson|forceescape }}" data-bs-toggle="modal" data-bs-target="#accounting-line-item-editor-modal">
<div>{{ line_item.voucher.date|accounting_format_date }} {{ line_item.description|accounting_default }}</div>
<li id="accounting-original-line-item-selector-option-{{ line_item.id }}" class="list-group-item d-flex justify-content-between accounting-clickable accounting-original-line-item-selector-option" data-id="{{ line_item.id }}" data-date="{{ line_item.journal_entry.date }}" data-debit-credit="{{ "debit" if line_item.is_debit else "credit" }}" data-currency-code="{{ line_item.currency.code }}" data-account-code="{{ line_item.account_code }}" data-account-text="{{ line_item.account }}" data-description="{{ line_item.description|accounting_default }}" data-net-balance="{{ line_item.net_balance|accounting_journal_entry_format_amount_input }}" data-text="{{ line_item }}" data-query-values="{{ line_item.query_values|tojson|forceescape }}" data-bs-toggle="modal" data-bs-target="#accounting-line-item-editor-modal">
<div>{{ line_item.journal_entry.date|accounting_format_date }} {{ line_item.description|accounting_default }}</div>
<div>
<span class="badge bg-primary rounded-pill">
<span id="accounting-original-line-item-selector-option-{{ line_item.id }}-net-balance">{{ line_item.net_balance|accounting_format_amount }}</span>

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
order.html: The order of the vouchers in a same day
order.html: The order of the journal entries in a same day
Copyright (c) 2023 imacat.
@ -23,10 +23,10 @@ First written: 2023/2/26
{% block accounting_scripts %}
<script src="{{ url_for("accounting.static", filename="js/drag-and-drop-reorder.js") }}"></script>
<script src="{{ url_for("accounting.static", filename="js/voucher-order.js") }}"></script>
<script src="{{ url_for("accounting.static", filename="js/journal-entry-order.js") }}"></script>
{% endblock %}
{% block header %}{% block title %}{{ A_("Vouchers on %(date)s", date=date) }}{% endblock %}{% endblock %}
{% block header %}{% block title %}{{ A_("Journal Entries on %(date)s", date=date) }}{% endblock %}{% endblock %}
{% block content %}
@ -38,7 +38,7 @@ First written: 2023/2/26
</div>
{% if list|length > 1 and accounting_can_edit() %}
<form action="{{ url_for("accounting.voucher.sort", voucher_date=date) }}" method="post">
<form action="{{ url_for("accounting.journal-entry.sort", journal_entry_date=date) }}" method="post">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
{% if request.args.next %}
<input type="hidden" name="next" value="{{ request.args.next }}">

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
create.html: The cash receipt voucher creation form
create.html: The cash receipt journal entry creation form
Copyright (c) 2023 imacat.
@ -19,10 +19,10 @@ create.html: The cash receipt voucher creation form
Author: imacat@mail.imacat.idv.tw (imacat)
First written: 2023/2/25
#}
{% extends "accounting/voucher/receipt/include/form.html" %}
{% extends "accounting/journal-entry/receipt/include/form.html" %}
{% block header %}{% block title %}{{ A_("Add a New Cash Receipt Voucher") }}{% endblock %}{% endblock %}
{% block header %}{% block title %}{{ A_("Add a New Cash Receipt Journal Entry") }}{% endblock %}{% endblock %}
{% block back_url %}{{ request.args.get("next") or url_for("accounting.report.default") }}{% endblock %}
{% block action_url %}{{ url_for("accounting.voucher.store", voucher_type=voucher_type) }}{% endblock %}
{% block action_url %}{{ url_for("accounting.journal-entry.store", journal_entry_type=journal_entry_type) }}{% endblock %}

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
detail.html: The cash receipt voucher detail
detail.html: The cash receipt journal entry detail
Copyright (c) 2023 imacat.
@ -19,16 +19,16 @@ detail.html: The cash receipt voucher detail
Author: imacat@mail.imacat.idv.tw (imacat)
First written: 2023/2/26
#}
{% extends "accounting/voucher/include/detail.html" %}
{% extends "accounting/journal-entry/include/detail.html" %}
{% block to_transfer %}
<a class="btn btn-primary" href="{{ url_for("accounting.voucher.edit", voucher=obj)|accounting_voucher_to_transfer|accounting_inherit_next }}">
<a class="btn btn-primary" href="{{ url_for("accounting.journal-entry.edit", journal_entry=obj)|accounting_journal_entry_to_transfer|accounting_inherit_next }}">
<i class="fa-solid fa-bars-staggered"></i>
{{ A_("To Transfer") }}
</a>
{% endblock %}
{% block voucher_currencies %}
{% block journal_entry_currencies %}
{% for currency in obj.currencies %}
<div class="mb-3">
<div class="mb-2 fw-bolder">{{ currency.name }}</div>
@ -36,7 +36,7 @@ First written: 2023/2/26
<ul class="list-group accounting-list-group-stripped accounting-list-group-hover">
<li class="list-group-item accounting-journal-entry-line-item accounting-journal-entry-line-item-header">{{ A_("Content") }}</li>
{% with line_items = currency.credit %}
{% include "accounting/voucher/include/detail-line-items.html" %}
{% include "accounting/journal-entry/include/detail-line-items.html" %}
{% endwith %}
<li class="list-group-item accounting-journal-entry-line-item accounting-journal-entry-line-item-total">
<div class="d-flex justify-content-between">

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
edit.html: The cash receipt voucher edit form
edit.html: The cash receipt journal entry edit form
Copyright (c) 2023 imacat.
@ -19,10 +19,10 @@ edit.html: The cash receipt voucher edit form
Author: imacat@mail.imacat.idv.tw (imacat)
First written: 2023/2/25
#}
{% extends "accounting/voucher/receipt/include/form.html" %}
{% extends "accounting/journal-entry/receipt/include/form.html" %}
{% block header %}{% block title %}{{ A_("Editing %(voucher)s", voucher=voucher) }}{% endblock %}{% endblock %}
{% block header %}{% block title %}{{ A_("Editing %(journal_entry)s", journal_entry=journal_entry) }}{% endblock %}{% endblock %}
{% block back_url %}{{ url_for("accounting.voucher.detail", voucher=voucher)|accounting_inherit_next }}{% endblock %}
{% block back_url %}{{ url_for("accounting.journal-entry.detail", journal_entry=journal_entry)|accounting_inherit_next }}{% endblock %}
{% block action_url %}{{ url_for("accounting.voucher.update", voucher=voucher)|accounting_voucher_with_type }}{% endblock %}
{% block action_url %}{{ url_for("accounting.journal-entry.update", journal_entry=journal_entry)|accounting_journal_entry_with_type }}{% endblock %}

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
currency-sub-form.html: The currency sub-form in the cash receipt voucher form
form-currency.html: The currency sub-form in the cash receipt journal entry form
Copyright (c) 2023 imacat.
@ -51,7 +51,7 @@ First written: 2023/2/25
line_item_index = loop.index,
only_one_line_item_form = credit_forms|length == 1,
form = line_item_form.form %}
{% include "accounting/voucher/include/form-line-item.html" %}
{% include "accounting/journal-entry/include/form-line-item.html" %}
{% endwith %}
{% endfor %}
</ul>

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
form.html: The cash receipt voucher form
form.html: The cash receipt journal entry form
Copyright (c) 2023 imacat.
@ -19,7 +19,7 @@ form.html: The cash receipt voucher form
Author: imacat@mail.imacat.idv.tw (imacat)
First written: 2023/2/25
#}
{% extends "accounting/voucher/include/form.html" %}
{% extends "accounting/journal-entry/include/form.html" %}
{% block currency_sub_forms %}
{% if form.currencies %}
@ -33,7 +33,7 @@ First written: 2023/2/25
credit_forms = currency_form.credit,
credit_errors = currency_form.credit_errors,
credit_total = currency_form.form.credit_total|accounting_format_amount %}
{% include "accounting/voucher/receipt/include/form-currency-item.html" %}
{% include "accounting/journal-entry/receipt/include/form-currency.html" %}
{% endwith %}
{% endfor %}
{% else %}
@ -41,17 +41,17 @@ First written: 2023/2/25
only_one_currency_form = True,
currency_code_data = accounting_default_currency_code(),
credit_total = "-" %}
{% include "accounting/voucher/receipt/include/form-currency-item.html" %}
{% include "accounting/journal-entry/receipt/include/form-currency.html" %}
{% endwith %}
{% endif %}
{% endblock %}
{% block form_modals %}
{% with description_editor = form.description_editor.credit %}
{% include "accounting/voucher/include/description-editor-modal.html" %}
{% include "accounting/journal-entry/include/description-editor-modal.html" %}
{% endwith %}
{% with debit_credit = "credit",
account_options = form.credit_account_options %}
{% include "accounting/voucher/include/account-selector-modal.html" %}
{% include "accounting/journal-entry/include/account-selector-modal.html" %}
{% endwith %}
{% endblock %}

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
create.html: The transfer voucher creation form
create.html: The transfer journal entry creation form
Copyright (c) 2023 imacat.
@ -19,10 +19,10 @@ create.html: The transfer voucher creation form
Author: imacat@mail.imacat.idv.tw (imacat)
First written: 2023/2/25
#}
{% extends "accounting/voucher/transfer/include/form.html" %}
{% extends "accounting/journal-entry/transfer/include/form.html" %}
{% block header %}{% block title %}{{ A_("Add a New Transfer Voucher") }}{% endblock %}{% endblock %}
{% block header %}{% block title %}{{ A_("Add a New Transfer Journal Entry") }}{% endblock %}{% endblock %}
{% block back_url %}{{ request.args.get("next") or url_for("accounting.report.default") }}{% endblock %}
{% block action_url %}{{ url_for("accounting.voucher.store", voucher_type=voucher_type) }}{% endblock %}
{% block action_url %}{{ url_for("accounting.journal-entry.store", journal_entry_type=journal_entry_type) }}{% endblock %}

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
detail.html: The transfer voucher detail
detail.html: The transfer journal entry detail
Copyright (c) 2023 imacat.
@ -19,9 +19,9 @@ detail.html: The transfer voucher detail
Author: imacat@mail.imacat.idv.tw (imacat)
First written: 2023/2/26
#}
{% extends "accounting/voucher/include/detail.html" %}
{% extends "accounting/journal-entry/include/detail.html" %}
{% block voucher_currencies %}
{% block journal_entry_currencies %}
{% for currency in obj.currencies %}
<div class="mb-3">
<div class="mb-2 fw-bolder">{{ currency.name }}</div>
@ -32,7 +32,7 @@ First written: 2023/2/26
<ul class="list-group accounting-list-group-stripped accounting-list-group-hover">
<li class="list-group-item accounting-journal-entry-line-item accounting-journal-entry-line-item-header">{{ A_("Debit") }}</li>
{% with line_items = currency.debit %}
{% include "accounting/voucher/include/detail-line-items.html" %}
{% include "accounting/journal-entry/include/detail-line-items.html" %}
{% endwith %}
<li class="list-group-item accounting-journal-entry-line-item accounting-journal-entry-line-item-total">
<div class="d-flex justify-content-between">
@ -48,7 +48,7 @@ First written: 2023/2/26
<ul class="list-group accounting-list-group-stripped accounting-list-group-hover">
<li class="list-group-item accounting-journal-entry-line-item accounting-journal-entry-line-item-header">{{ A_("Credit") }}</li>
{% with line_items = currency.credit %}
{% include "accounting/voucher/include/detail-line-items.html" %}
{% include "accounting/journal-entry/include/detail-line-items.html" %}
{% endwith %}
<li class="list-group-item accounting-journal-entry-line-item accounting-journal-entry-line-item-total">
<div class="d-flex justify-content-between">

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
edit.html: The cash disbursement voucher edit form
edit.html: The transfer journal entry edit form
Copyright (c) 2023 imacat.
@ -19,10 +19,10 @@ edit.html: The cash disbursement voucher edit form
Author: imacat@mail.imacat.idv.tw (imacat)
First written: 2023/2/25
#}
{% extends "accounting/voucher/disbursement/include/form.html" %}
{% extends "accounting/journal-entry/transfer/include/form.html" %}
{% block header %}{% block title %}{{ A_("Editing %(voucher)s", voucher=voucher) }}{% endblock %}{% endblock %}
{% block header %}{% block title %}{{ A_("Editing %(journal_entry)s", journal_entry=journal_entry) }}{% endblock %}{% endblock %}
{% block back_url %}{{ url_for("accounting.voucher.detail", voucher=voucher)|accounting_inherit_next }}{% endblock %}
{% block back_url %}{{ url_for("accounting.journal-entry.detail", journal_entry=journal_entry)|accounting_inherit_next }}{% endblock %}
{% block action_url %}{{ url_for("accounting.voucher.update", voucher=voucher)|accounting_voucher_with_type }}{% endblock %}
{% block action_url %}{{ url_for("accounting.journal-entry.update", journal_entry=journal_entry)|accounting_journal_entry_with_type }}{% endblock %}

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
currency-sub-form.html: The currency sub-form in the transfer voucher form
form-currency.html: The currency sub-form in the transfer journal entry form
Copyright (c) 2023 imacat.
@ -53,7 +53,7 @@ First written: 2023/2/25
line_item_index = loop.index,
only_one_line_item_form = debit_forms|length == 1,
form = line_item_form.form %}
{% include "accounting/voucher/include/form-line-item.html" %}
{% include "accounting/journal-entry/include/form-line-item.html" %}
{% endwith %}
{% endfor %}
</ul>
@ -84,7 +84,7 @@ First written: 2023/2/25
line_item_index = loop.index,
only_one_line_item_form = credit_forms|length == 1,
form = line_item_form.form %}
{% include "accounting/voucher/include/form-line-item.html" %}
{% include "accounting/journal-entry/include/form-line-item.html" %}
{% endwith %}
{% endfor %}
</ul>

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
form.html: The transfer voucher form
form.html: The transfer journal entry form
Copyright (c) 2023 imacat.
@ -19,7 +19,7 @@ form.html: The transfer voucher form
Author: imacat@mail.imacat.idv.tw (imacat)
First written: 2023/2/25
#}
{% extends "accounting/voucher/include/form.html" %}
{% extends "accounting/journal-entry/include/form.html" %}
{% block currency_sub_forms %}
{% if form.currencies %}
@ -36,7 +36,7 @@ First written: 2023/2/25
credit_forms = currency_form.credit,
credit_errors = currency_form.credit_errors,
credit_total = currency_form.form.credit_total|accounting_format_amount %}
{% include "accounting/voucher/transfer/include/form-currency-item.html" %}
{% include "accounting/journal-entry/transfer/include/form-currency.html" %}
{% endwith %}
{% endfor %}
{% else %}
@ -45,24 +45,24 @@ First written: 2023/2/25
currency_code_data = accounting_default_currency_code(),
debit_total = "-",
credit_total = "-" %}
{% include "accounting/voucher/transfer/include/form-currency-item.html" %}
{% include "accounting/journal-entry/transfer/include/form-currency.html" %}
{% endwith %}
{% endif %}
{% endblock %}
{% block form_modals %}
{% with description_editor = form.description_editor.debit %}
{% include "accounting/voucher/include/description-editor-modal.html" %}
{% include "accounting/journal-entry/include/description-editor-modal.html" %}
{% endwith %}
{% with description_editor = form.description_editor.credit %}
{% include "accounting/voucher/include/description-editor-modal.html" %}
{% include "accounting/journal-entry/include/description-editor-modal.html" %}
{% endwith %}
{% with debit_credit = "debit",
account_options = form.debit_account_options %}
{% include "accounting/voucher/include/account-selector-modal.html" %}
{% include "accounting/journal-entry/include/account-selector-modal.html" %}
{% endwith %}
{% with debit_credit = "credit",
account_options = form.credit_account_options %}
{% include "accounting/voucher/include/account-selector-modal.html" %}
{% include "accounting/journal-entry/include/account-selector-modal.html" %}
{% endwith %}
{% endblock %}

View File

@ -37,7 +37,7 @@ First written: 2023/3/7
{% endwith %}
</div>
{% include "accounting/report/include/add-voucher-material-fab.html" %}
{% include "accounting/report/include/add-journal-entry-material-fab.html" %}
{% include "accounting/report/include/period-chooser.html" %}

View File

@ -1,6 +1,6 @@
{#
The Mia! Accounting Flask Project
add-voucher-material-fab.html: The material floating action buttons to add a new voucher
add-journal-entry-material-fab.html: The material floating action buttons to add a new journal entry
Copyright (c) 2023 imacat.
@ -22,13 +22,13 @@ First written: 2023/2/25
{% if accounting_can_edit() %}
<div id="accounting-material-fab-speed-dial" class="d-md-none accounting-material-fab">
<div id="accounting-material-fab-speed-dial-actions" class="d-md-none accounting-material-fab-speed-dial-group">
<a class="btn rounded-pill" href="{{ url_for("accounting.voucher.create", voucher_type=report.voucher_types.CASH_DISBURSEMENT)|accounting_append_next }}">
<a class="btn rounded-pill" href="{{ url_for("accounting.journal-entry.create", journal_entry_type=report.journal_entry_types.CASH_DISBURSEMENT)|accounting_append_next }}">
{{ A_("Cash expense") }}
</a>
<a class="btn rounded-pill" href="{{ url_for("accounting.voucher.create", voucher_type=report.voucher_types.CASH_RECEIPT)|accounting_append_next }}">
<a class="btn rounded-pill" href="{{ url_for("accounting.journal-entry.create", journal_entry_type=report.journal_entry_types.CASH_RECEIPT)|accounting_append_next }}">
{{ A_("Cash income") }}
</a>
<a class="btn rounded-pill" href="{{ url_for("accounting.voucher.create", voucher_type=report.voucher_types.TRANSFER)|accounting_append_next }}">
<a class="btn rounded-pill" href="{{ url_for("accounting.journal-entry.create", journal_entry_type=report.journal_entry_types.TRANSFER)|accounting_append_next }}">
{{ A_("Transfer") }}
</a>
</div>

View File

@ -27,17 +27,17 @@ First written: 2023/3/8
</button>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="{{ url_for("accounting.voucher.create", voucher_type=report.voucher_types.CASH_DISBURSEMENT)|accounting_append_next }}">
<a class="dropdown-item" href="{{ url_for("accounting.journal-entry.create", journal_entry_type=report.journal_entry_types.CASH_DISBURSEMENT)|accounting_append_next }}">
{{ A_("Cash Expense") }}
</a>
</li>
<li>
<a class="dropdown-item" href="{{ url_for("accounting.voucher.create", voucher_type=report.voucher_types.CASH_RECEIPT)|accounting_append_next }}">
<a class="dropdown-item" href="{{ url_for("accounting.journal-entry.create", journal_entry_type=report.journal_entry_types.CASH_RECEIPT)|accounting_append_next }}">
{{ A_("Cash Income") }}
</a>
</li>
<li>
<a class="dropdown-item" href="{{ url_for("accounting.voucher.create", voucher_type=report.voucher_types.TRANSFER)|accounting_append_next }}">
<a class="dropdown-item" href="{{ url_for("accounting.journal-entry.create", journal_entry_type=report.journal_entry_types.TRANSFER)|accounting_append_next }}">
{{ A_("Transfer") }}
</a>
</li>

View File

@ -38,7 +38,7 @@ First written: 2023/3/5
{% endwith %}
</div>
{% include "accounting/report/include/add-voucher-material-fab.html" %}
{% include "accounting/report/include/add-journal-entry-material-fab.html" %}
{% include "accounting/report/include/period-chooser.html" %}

View File

@ -37,7 +37,7 @@ First written: 2023/3/7
{% endwith %}
</div>
{% include "accounting/report/include/add-voucher-material-fab.html" %}
{% include "accounting/report/include/add-journal-entry-material-fab.html" %}
{% include "accounting/report/include/period-chooser.html" %}

View File

@ -36,7 +36,7 @@ First written: 2023/3/4
{% endwith %}
</div>
{% include "accounting/report/include/add-voucher-material-fab.html" %}
{% include "accounting/report/include/add-journal-entry-material-fab.html" %}
{% include "accounting/report/include/period-chooser.html" %}
@ -60,8 +60,8 @@ First written: 2023/3/4
</div>
<div class="accounting-report-table-body">
{% for line_item in report.line_items %}
<a class="accounting-report-table-row" href="{{ url_for("accounting.voucher.detail", voucher=line_item.voucher)|accounting_append_next }}">
<div>{{ line_item.voucher.date|accounting_format_date }}</div>
<a class="accounting-report-table-row" href="{{ url_for("accounting.journal-entry.detail", journal_entry=line_item.journal_entry)|accounting_append_next }}">
<div>{{ line_item.journal_entry.date|accounting_format_date }}</div>
<div>{{ line_item.currency.name }}</div>
<div>
<span class="d-none d-md-inline">{{ line_item.account.code }}</span>
@ -77,11 +77,11 @@ First written: 2023/3/4
<div class="list-group d-md-none">
{% for line_item in report.line_items %}
<a class="list-group-item list-group-item-action" href="{{ url_for("accounting.voucher.detail", voucher=line_item.voucher)|accounting_append_next }}">
<a class="list-group-item list-group-item-action" href="{{ url_for("accounting.journal-entry.detail", journal_entry=line_item.journal_entry)|accounting_append_next }}">
<div class="d-flex justify-content-between">
<div {% if not line_item.is_debit %} class="accounting-mobile-journal-credit" {% endif %}>
<div class="text-muted small">
{{ line_item.voucher.date|accounting_format_date }}
{{ line_item.journal_entry.date|accounting_format_date }}
{{ line_item.account.title|title }}
{% if line_item.currency.code != accounting_default_currency_code() %}
<span class="badge rounded-pill bg-info">{{ line_item.currency.code }}</span>

View File

@ -38,7 +38,7 @@ First written: 2023/3/5
{% endwith %}
</div>
{% include "accounting/report/include/add-voucher-material-fab.html" %}
{% include "accounting/report/include/add-journal-entry-material-fab.html" %}
{% include "accounting/report/include/period-chooser.html" %}

View File

@ -35,7 +35,7 @@ First written: 2023/3/8
{% endwith %}
</div>
{% include "accounting/report/include/add-voucher-material-fab.html" %}
{% include "accounting/report/include/add-journal-entry-material-fab.html" %}
{% include "accounting/report/include/search-modal.html" %}
@ -57,8 +57,8 @@ First written: 2023/3/8
</div>
<div class="accounting-report-table-body">
{% for line_item in report.line_items %}
<a class="accounting-report-table-row" href="{{ url_for("accounting.voucher.detail", voucher=line_item.voucher)|accounting_append_next }}">
<div>{{ line_item.voucher.date|accounting_format_date }}</div>
<a class="accounting-report-table-row" href="{{ url_for("accounting.journal-entry.detail", journal_entry=line_item.journal_entry)|accounting_append_next }}">
<div>{{ line_item.journal_entry.date|accounting_format_date }}</div>
<div>{{ line_item.currency.name }}</div>
<div>
<span class="d-none d-md-inline">{{ line_item.account.code }}</span>
@ -74,11 +74,11 @@ First written: 2023/3/8
<div class="list-group d-md-none">
{% for line_item in report.line_items %}
<a class="list-group-item list-group-item-action" href="{{ url_for("accounting.voucher.detail", voucher=line_item.voucher)|accounting_append_next }}">
<a class="list-group-item list-group-item-action" href="{{ url_for("accounting.journal-entry.detail", journal_entry=line_item.journal_entry)|accounting_append_next }}">
<div class="d-flex justify-content-between">
<div {% if not line_item.is_debit %} class="accounting-mobile-journal-credit" {% endif %}>
<div class="text-muted small">
{{ line_item.voucher.date|accounting_format_date }}
{{ line_item.journal_entry.date|accounting_format_date }}
{{ line_item.account.title|title }}
{% if line_item.currency.code != accounting_default_currency_code() %}
<span class="badge rounded-pill bg-info">{{ line_item.currency.code }}</span>

View File

@ -37,7 +37,7 @@ First written: 2023/3/5
{% endwith %}
</div>
{% include "accounting/report/include/add-voucher-material-fab.html" %}
{% include "accounting/report/include/add-journal-entry-material-fab.html" %}
{% include "accounting/report/include/period-chooser.html" %}