Removed the context from the translatable text messages in the accounting application, because it is not needed now.

This commit is contained in:
依瑪貓 2020-08-06 00:41:29 +08:00
parent 518b49ee65
commit 86dfe993a4
24 changed files with 575 additions and 771 deletions

View File

@ -21,7 +21,7 @@
import datetime import datetime
import re import re
from django.utils.translation import pgettext from django.utils.translation import gettext as _
from .models import Transaction, Record, Account from .models import Transaction, Record, Account
from mia_core.period import Period from mia_core.period import Period
@ -124,8 +124,7 @@ class CashAccountConverter:
if value == "0": if value == "0":
return Account( return Account(
code="0", code="0",
title=pgettext( title=_("current assets and liabilities"),
"Accounting|", "current assets and liabilities"),
) )
try: try:
account = Account.objects.get(code=value) account = Account.objects.get(code=value)

View File

@ -21,7 +21,7 @@
import re import re
from django import forms from django import forms
from django.utils.translation import pgettext from django.utils.translation import gettext as _
from .models import Account, Record from .models import Account, Record
from .validators import validate_record_account_code, validate_record_id from .validators import validate_record_account_code, validate_record_id
@ -37,27 +37,26 @@ class RecordForm(forms.Form):
id = forms.IntegerField( id = forms.IntegerField(
required=False, required=False,
error_messages={ error_messages={
"invalid": pgettext("Accounting|", "This record is not valid."), "invalid": _("This record is not valid."),
}, },
validators=[validate_record_id]) validators=[validate_record_id])
account = forms.CharField( account = forms.CharField(
error_messages={ error_messages={
"required": pgettext("Accounting|", "Please select the account."), "required": _("Please select the account."),
}, },
validators=[validate_record_account_code]) validators=[validate_record_account_code])
summary = forms.CharField( summary = forms.CharField(
required=False, required=False,
max_length=128, max_length=128,
error_messages={ error_messages={
"max_length": pgettext("Accounting|", "This summary is too long."), "max_length": _("This summary is too long."),
}) })
amount = forms.IntegerField( amount = forms.IntegerField(
min_value=1, min_value=1,
error_messages={ error_messages={
"required": pgettext("Accounting|", "Please fill in the amount."), "required": _("Please fill in the amount."),
"invalid": pgettext("Accounting|", "Please fill in a number."), "invalid": _("Please fill in a number."),
"min_value": pgettext( "min_value": _("The amount must be at least 1."),
"Accounting|", "The amount must be at least 1."),
}) })
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
@ -108,8 +107,7 @@ class RecordForm(forms.Form):
if self.transaction is None: if self.transaction is None:
if "id" in self.data: if "id" in self.data:
error = forms.ValidationError( error = forms.ValidationError(
pgettext("Accounting|", _("This record is not for this transaction."),
"This record is not for this transaction."),
code="not_belong") code="not_belong")
self.add_error("id", error) self.add_error("id", error)
raise error raise error
@ -118,8 +116,7 @@ class RecordForm(forms.Form):
record = Record.objects.get(pk=self.data["id"]) record = Record.objects.get(pk=self.data["id"])
if record.transaction.pk != self.transaction.pk: if record.transaction.pk != self.transaction.pk:
error = forms.ValidationError( error = forms.ValidationError(
pgettext("Accounting|", _("This record is not for this transaction."),
"This record is not for this transaction."),
code="not_belong") code="not_belong")
self.add_error("id", error) self.add_error("id", error)
raise error raise error
@ -135,16 +132,14 @@ class RecordForm(forms.Form):
if self.is_credit: if self.is_credit:
if not re.match("^([123489]|7[1234])", self.data["account"]): if not re.match("^([123489]|7[1234])", self.data["account"]):
error = forms.ValidationError( error = forms.ValidationError(
pgettext("Accounting|", _("This account is not for credit records."),
"This account is not for credit records."),
code="not_credit") code="not_credit")
self.add_error("account", error) self.add_error("account", error)
raise error raise error
else: else:
if not re.match("^([1235689]|7[5678])", self.data["account"]): if not re.match("^([1235689]|7[5678])", self.data["account"]):
error = forms.ValidationError( error = forms.ValidationError(
pgettext("Accounting|", _("This account is not for debit records."),
"This account is not for debit records."),
code="not_debit") code="not_debit")
self.add_error("account", error) self.add_error("account", error)
raise error raise error
@ -164,13 +159,11 @@ class RecordForm(forms.Form):
if record.is_credit != self.is_credit: if record.is_credit != self.is_credit:
if self.is_credit: if self.is_credit:
error = forms.ValidationError( error = forms.ValidationError(
pgettext("Accounting|", _("This record is not a credit record."),
"This record is not a credit record."),
code="not_credit") code="not_credit")
else: else:
error = forms.ValidationError( error = forms.ValidationError(
pgettext("Accounting|", _("This record is not a debit record."),
"This record is not a debit record."),
code="not_debit") code="not_debit")
self.add_error("id", error) self.add_error("id", error)
raise error raise error
@ -188,13 +181,13 @@ class TransactionForm(forms.Form):
date = forms.DateField( date = forms.DateField(
required=True, required=True,
error_messages={ error_messages={
"invalid": pgettext("Accounting|", "This date is not valid.") "invalid": _("This date is not valid.")
}) })
notes = forms.CharField( notes = forms.CharField(
required=False, required=False,
max_length=128, max_length=128,
error_messages={ error_messages={
"max_length": pgettext("Accounting|", "This notes is too long.") "max_length": _("This notes is too long.")
}) })
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
@ -223,9 +216,8 @@ class TransactionForm(forms.Form):
return return
if self.debit_total() == self.credit_total(): if self.debit_total() == self.credit_total():
return return
raise forms.ValidationError(pgettext( raise forms.ValidationError(
"Accounting|", _("The total amount of debit and credit records are inconsistent."),
"The total amount of debit and credit records are inconsistent."),
code="balance") code="balance")
def is_valid(self): def is_valid(self):

File diff suppressed because it is too large Load Diff

View File

@ -27,7 +27,7 @@ First written: 2020/7/20
{% load accounting %} {% load accounting %}
{% block settings %} {% block settings %}
{% blocktrans asvar title with prep_period=period.prep_desc context "Accounting|" %}Balance Sheet {{ prep_period }}{% endblocktrans %} {% blocktrans asvar title with prep_period=period.prep_desc %}Balance Sheet {{ prep_period }}{% endblocktrans %}
{% setvar "title" title %} {% setvar "title" title %}
{% setvar "use_period_chooser" True %} {% setvar "use_period_chooser" True %}
{% static "accounting/css/report.css" as file %}{% add_css file %} {% static "accounting/css/report.css" as file %}{% add_css file %}
@ -39,26 +39,21 @@ First written: 2020/7/20
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
{% trans "New" context "Accounting|" as text %} {{ _("New")|force_escape }}
{{ text|force_escape }}
</button> </button>
<div class="dropdown-menu"> <div class="dropdown-menu">
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
{% trans "Cash Expense" context "Accounting|" as text %} {{ _("Cash Expense")|force_escape }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
{% trans "Cash Income" context "Accounting|" as text %} {{ _("Cash Income")|force_escape }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
{% trans "Transfer" context "Accounting|" as text %} {{ _("Transfer")|force_escape }}
{{ text|force_escape }}
</a> </a>
</div> </div>
</div> </div>
{% with current_report_icon="fas fa-balance-scale" %} {% with current_report_icon="fas fa-balance-scale" current_report_title=_("Balance Sheet") %}
{% trans "Balance Sheet" context "Accounting|" as current_report_title %}
{% include "accounting/include/report-chooser.html" %} {% include "accounting/include/report-chooser.html" %}
{% endwith %} {% endwith %}
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal"> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal">
@ -98,7 +93,7 @@ First written: 2020/7/20
<td class="actions"> <td class="actions">
<a href="{{ item.url }}" class="btn btn-info" role="button"> <a href="{{ item.url }}" class="btn btn-info" role="button">
<i class="fas fa-eye"></i> <i class="fas fa-eye"></i>
{% trans "View" context "Accounting|" as text %}{{ text|force_escape }} {{ _("View") }}
</a> </a>
</td> </td>
</tr> </tr>
@ -129,7 +124,7 @@ First written: 2020/7/20
<td class="actions"> <td class="actions">
<a href="{{ item.url }}" class="btn btn-info" role="button"> <a href="{{ item.url }}" class="btn btn-info" role="button">
<i class="fas fa-eye"></i> <i class="fas fa-eye"></i>
{% trans "View" context "Accounting|" as text %}{{ text|force_escape }} {{ _("View") }}
</a> </a>
</td> </td>
</tr> </tr>
@ -138,7 +133,7 @@ First written: 2020/7/20
</tbody> </tbody>
<tfoot> <tfoot>
<tr class="total"> <tr class="total">
<td>{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}</td> <td>{{ _("Total") }}</td>
<td class="amount {% if liabilities.amount < 0 %} text-danger {% endif %}"> <td class="amount {% if liabilities.amount < 0 %} text-danger {% endif %}">
{{ liabilities.amount|accounting_amount }} {{ liabilities.amount|accounting_amount }}
</td> </td>
@ -166,7 +161,7 @@ First written: 2020/7/20
<td class="actions"> <td class="actions">
<a href="{{ item.url }}" class="btn btn-info" role="button"> <a href="{{ item.url }}" class="btn btn-info" role="button">
<i class="fas fa-eye"></i> <i class="fas fa-eye"></i>
{% trans "View" context "Accounting|" as text %}{{ text|force_escape }} {{ _("View") }}
</a> </a>
</td> </td>
</tr> </tr>
@ -175,7 +170,7 @@ First written: 2020/7/20
</tbody> </tbody>
<tfoot> <tfoot>
<tr class="total"> <tr class="total">
<td>{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}</td> <td>{{ _("Total") }}</td>
<td class="amount {% if owners_equity.amount < 0 %} text-danger {% endif %}"> <td class="amount {% if owners_equity.amount < 0 %} text-danger {% endif %}">
{{ owners_equity.amount|accounting_amount }} {{ owners_equity.amount|accounting_amount }}
</td> </td>
@ -190,7 +185,7 @@ First written: 2020/7/20
<table class="table table-borderless table-hover table-sm balance-sheet-total-table"> <table class="table table-borderless table-hover table-sm balance-sheet-total-table">
<tfoot> <tfoot>
<tr class="total"> <tr class="total">
<td class="align-middle">{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}</td> <td class="align-middle">{{ _("Total") }}</td>
<td class="text-right align-middle font-italic {% if assets.amount < 0 %} text-danger {% endif %}"> <td class="text-right align-middle font-italic {% if assets.amount < 0 %} text-danger {% endif %}">
{{ assets.amount|accounting_amount }} {{ assets.amount|accounting_amount }}
</td> </td>
@ -203,7 +198,7 @@ First written: 2020/7/20
<table class="table table-borderless table-hover table-sm balance-sheet-total-table"> <table class="table table-borderless table-hover table-sm balance-sheet-total-table">
<tfoot> <tfoot>
<tr class="total"> <tr class="total">
<td class="align-middle">{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}</td> <td class="align-middle">{{ _("Total") }}</td>
<td class="text-right align-middle font-italic {% if liabilities.amount|add:owners_equity.amount < 0 %} text-danger {% endif %}"> <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 }} {{ liabilities.amount|add:owners_equity.amount|accounting_amount }}
</td> </td>
@ -244,7 +239,7 @@ First written: 2020/7/20
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
<li class="list-group-item d-flex justify-content-between align-items-center grand-total"> <li class="list-group-item d-flex justify-content-between align-items-center grand-total">
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Total") }}
<span class="badge {% if assets.amount < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill"> <span class="badge {% if assets.amount < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
{{ assets.amount|accounting_amount }} {{ assets.amount|accounting_amount }}
</span> </span>
@ -275,7 +270,7 @@ First written: 2020/7/20
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
<li class="list-group-item d-flex justify-content-between align-items-center total"> <li class="list-group-item d-flex justify-content-between align-items-center total">
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Total") }}
<span class="badge {% if liabilities.amount < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill"> <span class="badge {% if liabilities.amount < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
{{ liabilities.amount|accounting_amount }} {{ liabilities.amount|accounting_amount }}
</span> </span>
@ -304,7 +299,7 @@ First written: 2020/7/20
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
<li class="list-group-item d-flex justify-content-between align-items-center total"> <li class="list-group-item d-flex justify-content-between align-items-center total">
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Total") }}
<span class="badge {% if owners_equity.amount < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill"> <span class="badge {% if owners_equity.amount < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
{{ owners_equity.amount|accounting_amount }} {{ owners_equity.amount|accounting_amount }}
</span> </span>
@ -313,7 +308,7 @@ First written: 2020/7/20
<ul class="list-group balance-sheet-list"> <ul class="list-group balance-sheet-list">
<li class="list-group-item d-flex justify-content-between align-items-center grand-total"> <li class="list-group-item d-flex justify-content-between align-items-center grand-total">
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Total") }}
<span class="badge {% if liabilities.amount|add:owners_equity.amount < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill"> <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 }} {{ liabilities.amount|add:owners_equity.amount|accounting_amount }}
</span> </span>

View File

@ -27,7 +27,7 @@ First written: 2020/7/15
{% load accounting %} {% load accounting %}
{% block settings %} {% block settings %}
{% blocktrans asvar title with account=account.title context "Accounting|" %}Cash Summary for {{ account }}{% endblocktrans %} {% blocktrans asvar title with account=account.title %}Cash Summary for {{ account }}{% endblocktrans %}
{% setvar "title" title %} {% setvar "title" title %}
{% static "accounting/css/report.css" as file %}{% add_css file %} {% static "accounting/css/report.css" as file %}{% add_css file %}
{% endblock %} {% endblock %}
@ -38,41 +38,36 @@ First written: 2020/7/15
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
{% trans "New" context "Accounting|" as text %} {{ _("New")|force_escape }}
{{ text|force_escape }}
</button> </button>
<div class="dropdown-menu"> <div class="dropdown-menu">
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
{% trans "Cash Expense" context "Accounting|" as text %} {{ _("Cash Expense")|force_escape }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
{% trans "Cash Income" context "Accounting|" as text %} {{ _("Cash Income")|force_escape }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
{% trans "Transfer" context "Accounting|" as text %} {{ _("Transfer")|force_escape }}
{{ text|force_escape }}
</a> </a>
</div> </div>
</div> </div>
{% with current_report_icon="fas fa-money-bill-wave" %} {% with current_report_icon="fas fa-money-bill-wave" current_report_title=_("Cash Summary") %}
{% trans "Cash Summary" context "Accounting|" as current_report_title %}
{% include "accounting/include/report-chooser.html" %} {% include "accounting/include/report-chooser.html" %}
{% endwith %} {% endwith %}
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<span class="d-none d-md-inline">{{ account.title|title_case }}</span> <span class="d-none d-md-inline">{{ account.title|title_case }}</span>
<span class="d-md-none">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</span> <span class="d-md-none">{{ _("Account") }}</span>
</button> </button>
<div class="dropdown-menu account-picker"> <div class="dropdown-menu account-picker">
<div class="dropdown-header">{% trans "Shortcuts" context "Accounting|Account|" as text %}{{ text|force_escape }}</div> <div class="dropdown-header">{{ _("Shortcuts") }}</div>
{% for x in shortcut_accounts %} {% for x in shortcut_accounts %}
<a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:cash-summary" x %}"> <a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:cash-summary" x %}">
{{ x.title|title_case }} {{ x.title|title_case }}
</a> </a>
{% endfor %} {% endfor %}
<div class="dropdown-header">{% trans "All" context "Accounting|Account|" as text %}{{ text|force_escape }}</div> <div class="dropdown-header">{{ _("All") }}</div>
{% for x in all_accounts %} {% for x in all_accounts %}
<a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:cash-summary" x %}"> <a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:cash-summary" x %}">
{{ x.code }} {{ x.title|title_case }} {{ x.code }} {{ x.title|title_case }}
@ -89,12 +84,12 @@ First written: 2020/7/15
<table class="table table-striped table-hover d-none d-sm-table general-journal-table"> <table class="table table-striped table-hover d-none d-sm-table general-journal-table">
<thead> <thead>
<tr> <tr>
<th scope="col">{% trans "Month" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Month") }}</th>
<th class="amount" scope="col">{% trans "Income" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Income") }}</th>
<th class="amount" scope="col">{% trans "Expense" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Expense") }}</th>
<th class="amount" scope="col">{% trans "Balance" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Balance") }}</th>
<th class="amount" scope="col">{% trans "Cumulative Balance" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Cumulative Balance") }}</th>
<th class="actions" scope="col">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="actions" scope="col">{{ _("View") }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -109,7 +104,7 @@ First written: 2020/7/15
{% if item.month is not None %} {% if item.month is not None %}
<a class="btn btn-info" role="button" href="{% url "accounting:cash" account item.month|date:"Y-m" %}"> <a class="btn btn-info" role="button" href="{% url "accounting:cash" account item.month|date:"Y-m" %}">
<i class="fas fa-eye"></i> <i class="fas fa-eye"></i>
<span class="d-none d-lg-inline">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</span> <span class="d-none d-lg-inline">{{ _("View") }}</span>
</a> </a>
{% endif %} {% endif %}
</td> </td>

View File

@ -27,7 +27,7 @@ First written: 2020/7/1
{% load accounting %} {% load accounting %}
{% block settings %} {% block settings %}
{% blocktrans asvar title with account=account.title prep_period=period.prep_desc context "Accounting|" %}Cash Account for {{ account }} {{ prep_period }}{% endblocktrans %} {% blocktrans asvar title with account=account.title prep_period=period.prep_desc %}Cash Account for {{ account }} {{ prep_period }}{% endblocktrans %}
{% setvar "title" title %} {% setvar "title" title %}
{% setvar "use_period_chooser" True %} {% setvar "use_period_chooser" True %}
{% static "accounting/css/report.css" as file %}{% add_css file %} {% static "accounting/css/report.css" as file %}{% add_css file %}
@ -39,41 +39,36 @@ First written: 2020/7/1
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
{% trans "New" context "Accounting|" as text %} {{ _("New") }}
{{ text|force_escape }}
</button> </button>
<div class="dropdown-menu"> <div class="dropdown-menu">
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
{% trans "Cash Expense" context "Accounting|" as text %} {{ _("Cash Expense") }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
{% trans "Cash Income" context "Accounting|" as text %} {{ _("Cash Income") }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
{% trans "Transfer" context "Accounting|" as text %} {{ _("Transfer") }}
{{ text|force_escape }}
</a> </a>
</div> </div>
</div> </div>
{% with current_report_icon="fas fa-money-bill-wave" %} {% with current_report_icon="fas fa-money-bill-wave" current_report_title=_("Cash Account") %}
{% trans "Cash Account" context "Accounting|" as current_report_title %}
{% include "accounting/include/report-chooser.html" %} {% include "accounting/include/report-chooser.html" %}
{% endwith %} {% endwith %}
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<span class="d-none d-md-inline">{{ account.title|title_case }}</span> <span class="d-none d-md-inline">{{ account.title|title_case }}</span>
<span class="d-md-none">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</span> <span class="d-md-none">{{ _("Account") }}</span>
</button> </button>
<div class="dropdown-menu account-picker"> <div class="dropdown-menu account-picker">
<div class="dropdown-header">{% trans "Shortcuts" context "Accounting|Account|" as text %}{{ text|force_escape }}</div> <div class="dropdown-header">{{ _("Shortcuts") }}</div>
{% for x in shortcut_accounts %} {% for x in shortcut_accounts %}
<a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:cash" x period %}"> <a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:cash" x period %}">
{{ x.title|title_case }} {{ x.title|title_case }}
</a> </a>
{% endfor %} {% endfor %}
<div class="dropdown-header">{% trans "All" context "Accounting|Account|" as text %}{{ text|force_escape }}</div> <div class="dropdown-header">{{ _("All") }}</div>
{% for x in all_accounts %} {% for x in all_accounts %}
<a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:cash" x period %}"> <a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:cash" x period %}">
{{ x.code }} {{ x.title|title_case }} {{ x.code }} {{ x.title|title_case }}
@ -97,13 +92,13 @@ First written: 2020/7/1
<table class="table table-striped table-hover d-none d-md-table general-journal-table"> <table class="table table-striped table-hover d-none d-md-table general-journal-table">
<thead> <thead>
<tr> <tr>
<th scope="col">{% trans "Date" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Date") }}</th>
<th scope="col">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Account") }}</th>
<th scope="col">{% trans "Summary" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Summary") }}</th>
<th class="amount" scope="col">{% trans "Income" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Income") }}</th>
<th class="amount" scope="col">{% trans "Expense" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Expense") }}</th>
<th class="amount" scope="col">{% trans "Balance" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Balance") }}</th>
<th class="actions" scope="col">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="actions" scope="col">{{ _("View") }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -113,13 +108,11 @@ First written: 2020/7/1
<td>{{ item.account.title|title_case }}</td> <td>{{ item.account.title|title_case }}</td>
<td>{{ item.summary|default:"" }}{% if not item.is_balanced %} <td>{{ item.summary|default:"" }}{% if not item.is_balanced %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Unbalanced" context "Accounting|" as text %} {{ _("Unbalanced") }}
{{ text|force_escape }}
</span> </span>
{% endif %}{% if item.has_order_hole %} {% endif %}{% if item.has_order_hole %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Need Reorder" context "Accounting|" as text %} {{ _("Need Reorder") }}
{{ text|force_escape }}
</span> </span>
{% endif %}</td> {% endif %}</td>
<td class="amount">{{ item.credit_amount|accounting_amount }}</td> <td class="amount">{{ item.credit_amount|accounting_amount }}</td>
@ -129,7 +122,7 @@ First written: 2020/7/1
{% if item.pk is not None %} {% if item.pk is not None %}
<a href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}" 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> <i class="fas fa-eye"></i>
<span class="d-none d-lg-inline">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</span> <span class="d-none d-lg-inline">{{ _("View") }}</span>
</a> </a>
{% endif %} {% endif %}
</td> </td>
@ -152,14 +145,12 @@ First written: 2020/7/1
{{ item.summary|default:"" }} {{ item.summary|default:"" }}
{% if not item.is_balanced %} {% if not item.is_balanced %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Unbalanced" context "Accounting|" as text %} {{ _("Unbalanced") }}
{{ text|force_escape }}
</span> </span>
{% endif %} {% endif %}
{% if item.has_order_hole %} {% if item.has_order_hole %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Need Reorder" context "Accounting|" as text %} {{ _("Need Reorder") }}
{{ text|force_escape }}
</span> </span>
{% endif %} {% endif %}
</div> </div>

View File

@ -30,22 +30,21 @@ First written: 2020/7/9
<!-- Modal Header --> <!-- Modal Header -->
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">{% trans "Search Accounting Records" context "Accounting|" as text %}{{ text|force_escape }}</h4> <h4 class="modal-title">{{ _("Search Accounting Records") }}</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
</div> </div>
<!-- Modal body --> <!-- Modal body -->
<div class="modal-body"> <div class="modal-body">
<label for="accounting-query">{% trans "Search:" context "Accounting|" as text %}{{ text|force_escape }}</label> <label for="accounting-query">{{ _("Search:") }}</label>
{% trans "e.g. Coffee" context "Accounting|" as text %} <input id="accounting-query" type="text" name="q" value="{% if request.resolver_match.url_name == "search" %}{{ request.GET.q }}{% endif %}" placeholder="{{ _("e.g. Coffee") }}" required="required" />
<input id="accounting-query" type="text" name="q" value="{% if request.resolver_match.url_name == "search" %}{{ request.GET.q }}{% endif %}" placeholder="{{ text|force_escape }}" required="required" />
</div> </div>
<!-- Modal footer --> <!-- Modal footer -->
<div class="modal-footer"> <div class="modal-footer">
<button class="btn btn-primary" type="submit"> <button class="btn btn-primary" type="submit">
<i class="fas fa-search"></i> <i class="fas fa-search"></i>
{% trans "Search" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Search") }}
</button> </button>
</div> </div>
</div> </div>
@ -60,58 +59,48 @@ First written: 2020/7/9
<i class="{{ current_report_icon }}"></i> <i class="{{ current_report_icon }}"></i>
{{ current_report_title }} {{ current_report_title }}
</span> </span>
<span class="d-md-none">{% trans "Book" context "Accounting|" as text %}{{ text|force_escape }}</span> <span class="d-md-none">{{ _("Book") }}</span>
</button> </button>
<div class="dropdown-menu account-picker"> <div class="dropdown-menu account-picker">
<a class="dropdown-item {% if request.resolver_match.url_name == "cash" %} active {% endif %}" href="{{ reports.cash }}"> <a class="dropdown-item {% if request.resolver_match.url_name == "cash" %} active {% endif %}" href="{{ reports.cash }}">
<i class="fas fa-money-bill-wave"></i> <i class="fas fa-money-bill-wave"></i>
{% trans "Cash Account" context "Accounting|" as text %} {{ _("Cash Account") }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item {% if request.resolver_match.url_name == "cash-summary" %} active {% endif %}" href="{{ reports.cash_summary }}"> <a class="dropdown-item {% if request.resolver_match.url_name == "cash-summary" %} active {% endif %}" href="{{ reports.cash_summary }}">
<i class="fas fa-money-bill-wave"></i> <i class="fas fa-money-bill-wave"></i>
{% trans "Cash Summary" context "Accounting|" as text %} {{ _("Cash Summary") }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item {% if request.resolver_match.url_name == "ledger" %} active {% endif %}" href="{{ reports.ledger }}"> <a class="dropdown-item {% if request.resolver_match.url_name == "ledger" %} active {% endif %}" href="{{ reports.ledger }}">
<i class="fas fa-file-invoice-dollar"></i> <i class="fas fa-file-invoice-dollar"></i>
{% trans "Ledger" context "Accounting|" as text %} {{ _("Ledger") }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item {% if request.resolver_match.url_name == "ledger-summary" %} active {% endif %}" href="{{ reports.ledger_summary }}"> <a class="dropdown-item {% if request.resolver_match.url_name == "ledger-summary" %} active {% endif %}" href="{{ reports.ledger_summary }}">
<i class="fas fa-file-invoice-dollar"></i> <i class="fas fa-file-invoice-dollar"></i>
{% trans "Ledger Summary" context "Accounting|" as text %} {{ _("Ledger Summary") }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item {% if request.resolver_match.url_name == "journal" %} active {% endif %}" href="{{ reports.journal }}"> <a class="dropdown-item {% if request.resolver_match.url_name == "journal" %} active {% endif %}" href="{{ reports.journal }}">
<i class="fas fa-book"></i> <i class="fas fa-book"></i>
{% trans "Journal" context "Accounting|" as text %} {{ _("Journal") }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item {% if request.resolver_match.url_name == "trial-balance" %} active {% endif %}" href="{{ reports.trial_balance }}"> <a class="dropdown-item {% if request.resolver_match.url_name == "trial-balance" %} active {% endif %}" href="{{ reports.trial_balance }}">
<i class="fas fa-balance-scale-right"></i> <i class="fas fa-balance-scale-right"></i>
{% trans "Trial Balance" context "Accounting|" as text %} {{ _("Trial Balance") }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item {% if request.resolver_match.url_name == "income-statement" %} active {% endif %}" href="{{ reports.income_statement }}"> <a class="dropdown-item {% if request.resolver_match.url_name == "income-statement" %} active {% endif %}" href="{{ reports.income_statement }}">
<i class="fas fa-file-invoice"></i> <i class="fas fa-file-invoice"></i>
{% trans "Income Statement" context "Accounting|" as text %} {{ _("Income Statement") }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item {% if request.resolver_match.url_name == "balance-sheet" %} active {% endif %}" href="{{ reports.balance_sheet }}"> <a class="dropdown-item {% if request.resolver_match.url_name == "balance-sheet" %} active {% endif %}" href="{{ reports.balance_sheet }}">
<i class="fas fa-balance-scale"></i> <i class="fas fa-balance-scale"></i>
{% trans "Balance Sheet" context "Accounting|" as text %} {{ _("Balance Sheet") }}
{{ text|force_escape }}
</a> </a>
<span class="dropdown-item dropdown-search {% if request.resolver_match.url_name == "search" %} active {% endif %}" data-toggle="modal" data-target="#accounting-search-modal"> <span class="dropdown-item dropdown-search {% if request.resolver_match.url_name == "search" %} active {% endif %}" data-toggle="modal" data-target="#accounting-search-modal">
<i class="fas fa-search"></i> <i class="fas fa-search"></i>
{% trans "Search" context "Accounting|" as text %} {{ _("Search") }}
{{ text|force_escape }}
</span> </span>
<a class="dropdown-item {% if request.resolver_match.url_name == "accounts" %} active {% endif %}" href="{% url "accounting:accounts" %}"> <a class="dropdown-item {% if request.resolver_match.url_name == "accounts" %} active {% endif %}" href="{% url "accounting:accounts" %}">
<i class="fas fa-list-ol"></i> <i class="fas fa-list-ol"></i>
{% trans "Accounts" context "Accounting|" as text %} {{ _("Accounts") }}
{{ text|force_escape }}
</a> </a>
</div> </div>
</div> </div>

View File

@ -34,7 +34,7 @@ First written: 2020/4/3
<h4 class="modal-title"> <h4 class="modal-title">
<label for="summary-summary"> <label for="summary-summary">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
{% trans "Summary" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Summary") }}
</label> </label>
</h4> </h4>
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
@ -47,26 +47,26 @@ First written: 2020/4/3
</div> </div>
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="nav-item"> <li class="nav-item">
<span id="summary-tab-category" class="summary-tab nav-link active">{% trans "General" context "Accounting|Summary|" as text %}{{ text|force_escape }}</span> <span id="summary-tab-category" class="summary-tab nav-link active">{{ _("General") }}</span>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<span id="summary-tab-travel" class="summary-tab nav-link">{% trans "Travel" context "Accounting|Summary|" as text %}{{ text|force_escape }}</span> <span id="summary-tab-travel" class="summary-tab nav-link">{{ _("Travel") }}</span>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<span id="summary-tab-bus" class="summary-tab nav-link">{% trans "Bus" context "Accounting|Summary|" as text %}{{ text|force_escape }}</span> <span id="summary-tab-bus" class="summary-tab nav-link">{{ _("Bus") }}</span>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<span id="summary-tab-regular" class="summary-tab nav-link">{% trans "Regular" context "Accounting|Summary|" as text %}{{ text|force_escape }}</span> <span id="summary-tab-regular" class="summary-tab nav-link">{{ _("Regular") }}</span>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<span id="summary-tab-count" class="summary-tab nav-link">{% trans "Count" context "Accounting|Summary|" as text %}{{ text|force_escape }}</span> <span id="summary-tab-count" class="summary-tab nav-link">{{ _("Count") }}</span>
</li> </li>
</ul> </ul>
<!-- A general category --> <!-- A general category -->
<div id="summary-tab-content-category" class="summary-tab-content"> <div id="summary-tab-content-category" class="summary-tab-content">
<div class="row"> <div class="row">
<label class="col-sm-2 col-form-label" for="summary-general-category">{% trans "Category:" context "Accounting|Summary|" as text %}{{ text|force_escape }}</label> <label class="col-sm-2 col-form-label" for="summary-general-category">{{ _("Category:") }}</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input id="summary-general-category" class="form-control summary-helper-input" type="text" value="" /> <input id="summary-general-category" class="form-control summary-helper-input" type="text" value="" />
<div id="summary-general-categories-known" class="summary-categories-known"></div> <div id="summary-general-categories-known" class="summary-categories-known"></div>
@ -77,20 +77,20 @@ First written: 2020/4/3
<!-- A general travel route --> <!-- A general travel route -->
<div id="summary-tab-content-travel" class="summary-tab-content d-none"> <div id="summary-tab-content-travel" class="summary-tab-content d-none">
<div class="row"> <div class="row">
<label class="col-sm-2 col-form-label" for="summary-travel-category">{% trans "Category:" context "Accounting|Summary|" as text %}{{ text|force_escape }}</label> <label class="col-sm-2 col-form-label" for="summary-travel-category">{{ _("Category:") }}</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input id="summary-travel-category" class="form-control summary-helper-input summary-travel-part" type="text" value="" /> <input id="summary-travel-category" class="form-control summary-helper-input summary-travel-part" type="text" value="" />
<div id="summary-travel-categories-known" class="summary-categories-known"></div> <div id="summary-travel-categories-known" class="summary-categories-known"></div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<label class="col-sm-2 col-form-label" for="summary-travel-from">{% trans "From:" context "Accounting|Summary|" as text %}{{ text|force_escape }}</label> <label class="col-sm-2 col-form-label" for="summary-travel-from">{{ _("From:") }}</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input id="summary-travel-from" class="form-control summary-helper-input summary-travel-part" type="text" value="" /> <input id="summary-travel-from" class="form-control summary-helper-input summary-travel-part" type="text" value="" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<label class="col-sm-2 col-form-label" for="summary-travel-direction">{% trans "Direction:" context "Accounting|Summary|" as text %}{{ text|force_escape }}</label> <label class="col-sm-2 col-form-label" for="summary-travel-direction">{{ _("Direction:") }}</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input id="summary-travel-direction" class="summary-helper-input" type="hidden" value="" /> <input id="summary-travel-direction" class="summary-helper-input" type="hidden" value="" />
<span id="btn-summary-one-way" class="btn btn-outline-primary btn-summary-helper btn-summary-travel-direction"><%="→"%></span> <span id="btn-summary-one-way" class="btn btn-outline-primary btn-summary-helper btn-summary-travel-direction"><%="→"%></span>
@ -98,7 +98,7 @@ First written: 2020/4/3
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<label class="col-sm-2 col-form-label" for="summary-travel-to">{% trans "To:" context "Accounting|Summary|" as text %}{{ text|force_escape }}</label> <label class="col-sm-2 col-form-label" for="summary-travel-to">{{ _("To:") }}</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input id="summary-travel-to" class="form-control summary-helper-input summary-travel-part" type="text" value="" /> <input id="summary-travel-to" class="form-control summary-helper-input summary-travel-part" type="text" value="" />
</div> </div>
@ -108,26 +108,26 @@ First written: 2020/4/3
<!-- A bus route --> <!-- A bus route -->
<div id="summary-tab-content-bus" class="summary-tab-content d-none"> <div id="summary-tab-content-bus" class="summary-tab-content d-none">
<div class="row"> <div class="row">
<label class="col-sm-2 col-form-label" for="summary-bus-category">{% trans "Category:" context "Accounting|Summary|" as text %}{{ text|force_escape }}</label> <label class="col-sm-2 col-form-label" for="summary-bus-category">{{ _("Category:") }}</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input id="summary-bus-category" class="form-control summary-helper-input summary-bus-part" type="text" value="" /> <input id="summary-bus-category" class="form-control summary-helper-input summary-bus-part" type="text" value="" />
<div id="summary-bus-categories-known" class="summary-categories-known"></div> <div id="summary-bus-categories-known" class="summary-categories-known"></div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<label class="col-sm-2 col-form-label" for="summary-bus-route">{% trans "Route:" context "Accounting|Summary|" as text %}{{ text|force_escape }}</label> <label class="col-sm-2 col-form-label" for="summary-bus-route">{{ _("Route:") }}</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input id="summary-bus-route" class="form-control summary-helper-input summary-bus-part" type="text" value="" /> <input id="summary-bus-route" class="form-control summary-helper-input summary-bus-part" type="text" value="" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<label class="col-sm-2 col-form-label" for="summary-bus-from">{% trans "From:" context "Accounting|Summary|" as text %}{{ text|force_escape }}</label> <label class="col-sm-2 col-form-label" for="summary-bus-from">{{ _("From:") }}</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input id="summary-bus-from" class="form-control summary-helper-input summary-bus-part" type="text" value="" /> <input id="summary-bus-from" class="form-control summary-helper-input summary-bus-part" type="text" value="" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<label class="col-sm-2 col-form-label" for="summary-bus-to">{% trans "To:" context "Accounting|Summary|" as text %}{{ text|force_escape }}</label> <label class="col-sm-2 col-form-label" for="summary-bus-to">{{ _("To:") }}</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input id="summary-bus-to" class="form-control summary-helper-input summary-bus-part" type="text" value="" /> <input id="summary-bus-to" class="form-control summary-helper-input summary-bus-part" type="text" value="" />
</div> </div>
@ -145,7 +145,7 @@ First written: 2020/4/3
<div id="summary-tab-content-count" class="summary-tab-content d-none"> <div id="summary-tab-content-count" class="summary-tab-content d-none">
<div class="row"> <div class="row">
<label class="col-sm-2 col-form-label" for="summary-count">{% trans "Count:" context "Accounting|Summary|" as text %}{{ text|force_escape }}</label> <label class="col-sm-2 col-form-label" for="summary-count">{{ _("Count:") }}</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input id="summary-count" class="form-control summary-helper-input" type="number" min="1" value="" /> <input id="summary-count" class="form-control summary-helper-input" type="number" min="1" value="" />
</div> </div>

View File

@ -27,7 +27,7 @@ First written: 2020/7/19
{% load accounting %} {% load accounting %}
{% block settings %} {% block settings %}
{% blocktrans asvar title with prep_period=period.prep_desc context "Accounting|" %}Income Statement {{ prep_period }}{% endblocktrans %} {% blocktrans asvar title with prep_period=period.prep_desc %}Income Statement {{ prep_period }}{% endblocktrans %}
{% setvar "title" title %} {% setvar "title" title %}
{% setvar "use_period_chooser" True %} {% setvar "use_period_chooser" True %}
{% static "accounting/css/report.css" as file %}{% add_css file %} {% static "accounting/css/report.css" as file %}{% add_css file %}
@ -39,26 +39,21 @@ First written: 2020/7/19
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
{% trans "New" context "Accounting|" as text %} {{ _("New")|force_escape }}
{{ text|force_escape }}
</button> </button>
<div class="dropdown-menu"> <div class="dropdown-menu">
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
{% trans "Cash Expense" context "Accounting|" as text %} {{ _("Cash Expense")|force_escape }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
{% trans "Cash Income" context "Accounting|" as text %} {{ _("Cash Income")|force_escape }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
{% trans "Transfer" context "Accounting|" as text %} {{ _("Transfer")|force_escape }}
{{ text|force_escape }}
</a> </a>
</div> </div>
</div> </div>
{% with current_report_icon="fas fa-file-invoice" %} {% with current_report_icon="fas fa-file-invoice" current_report_title=_("Income Statement") %}
{% trans "Income Statement" context "Accounting|" as current_report_title %}
{% include "accounting/include/report-chooser.html" %} {% include "accounting/include/report-chooser.html" %}
{% endwith %} {% endwith %}
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal"> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal">
@ -82,7 +77,7 @@ First written: 2020/7/19
<thead> <thead>
<tr> <tr>
<th scope="col"></th> <th scope="col"></th>
<th class="amount" colspan="2" scope="col">{% trans "Amount" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" colspan="2" scope="col">{{ _("Amount") }}</th>
<th scope="col"></th> <th scope="col"></th>
</tr> </tr>
</thead> </thead>
@ -110,13 +105,13 @@ First written: 2020/7/19
<td class="actions"> <td class="actions">
<a href="{% url "accounting:ledger" item period %}" class="btn btn-info" role="button"> <a href="{% url "accounting:ledger" item period %}" class="btn btn-info" role="button">
<i class="fas fa-eye"></i> <i class="fas fa-eye"></i>
<span class="d-none d-lg-inline">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</span> <span class="d-none d-lg-inline">{{ _("View") }}</span>
</a> </a>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
<tr class="total"> <tr class="total">
<td><div>{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}</div></td> <td><div>{{ _("Total") }}</div></td>
<td class="amount"></td> <td class="amount"></td>
<td class="amount {% if group.amount < 0 %} text-danger {% endif %}">{{ group.amount|accounting_amount }}</td> <td class="amount {% if group.amount < 0 %} text-danger {% endif %}">{{ group.amount|accounting_amount }}</td>
<td class="actions"></td> <td class="actions"></td>
@ -124,7 +119,7 @@ First written: 2020/7/19
{% endfor %} {% endfor %}
{% else %} {% else %}
<tr class="total"> <tr class="total">
<td><div>{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}</div></td> <td><div>{{ _("Total") }}</div></td>
<td class="amount"></td> <td class="amount"></td>
<td class="amount">-</td> <td class="amount">-</td>
<td class="actions"></td> <td class="actions"></td>
@ -179,7 +174,7 @@ First written: 2020/7/19
</li> </li>
{% endfor %} {% endfor %}
<li class="list-group-item d-flex justify-content-between align-items-center total"> <li class="list-group-item d-flex justify-content-between align-items-center total">
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Total") }}
<div class="float-right"> <div class="float-right">
<span class="badge {% if group.amount < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill"> <span class="badge {% if group.amount < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
{{ group.amount|accounting_amount }} {{ group.amount|accounting_amount }}
@ -189,7 +184,7 @@ First written: 2020/7/19
{% endfor %} {% endfor %}
{% else %} {% else %}
<li class="list-group-item d-flex justify-content-between align-items-center total"> <li class="list-group-item d-flex justify-content-between align-items-center total">
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Total") }}
<div class="float-right"> <div class="float-right">
<span class="badge {% if group.amount < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">-</span> <span class="badge {% if group.amount < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">-</span>
</div> </div>

View File

@ -27,7 +27,7 @@ First written: 2020/7/17
{% load accounting %} {% load accounting %}
{% block settings %} {% block settings %}
{% blocktrans asvar title with prep_period=period.prep_desc context "Accounting|" %}Journal {{ prep_period }}{% endblocktrans %} {% blocktrans asvar title with prep_period=period.prep_desc %}Journal {{ prep_period }}{% endblocktrans %}
{% setvar "title" title %} {% setvar "title" title %}
{% setvar "use_period_chooser" True %} {% setvar "use_period_chooser" True %}
{% static "accounting/css/report.css" as file %}{% add_css file %} {% static "accounting/css/report.css" as file %}{% add_css file %}
@ -39,26 +39,21 @@ First written: 2020/7/17
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
{% trans "New" context "Accounting|" as text %} {{ _("New")|force_escape }}
{{ text|force_escape }}
</button> </button>
<div class="dropdown-menu"> <div class="dropdown-menu">
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
{% trans "Cash Expense" context "Accounting|" as text %} {{ _("Cash Expense")|force_escape }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
{% trans "Cash Income" context "Accounting|" as text %} {{ _("Cash Income")|force_escape }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
{% trans "Transfer" context "Accounting|" as text %} {{ _("Transfer")|force_escape }}
{{ text|force_escape }}
</a> </a>
</div> </div>
</div> </div>
{% with current_report_icon="fas fa-book" %} {% with current_report_icon="fas fa-book" current_report_title=_("Journal") %}
{% trans "Journal" context "Accounting|" as current_report_title %}
{% include "accounting/include/report-chooser.html" %} {% include "accounting/include/report-chooser.html" %}
{% endwith %} {% endwith %}
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal"> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal">
@ -77,13 +72,13 @@ First written: 2020/7/17
<table class="table table-striped table-hover d-none d-lg-table general-journal-table"> <table class="table table-striped table-hover d-none d-lg-table general-journal-table">
<thead> <thead>
<tr> <tr>
<th scope="col">{% trans "Date" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Date") }}</th>
<th scope="col">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Account") }}</th>
<th scope="col">{% trans "Summary" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Summary") }}</th>
<th class="amount" scope="col">{% trans "Debit" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Debit") }}</th>
<th class="amount" scope="col">{% trans "Credit" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Credit") }}</th>
<th scope="col">{% trans "Notes" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Notes") }}</th>
<th class="actions" scope="col">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="actions" scope="col">{{ _("View") }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -93,13 +88,11 @@ First written: 2020/7/17
<td>{{ item.account.title|title_case }}</td> <td>{{ item.account.title|title_case }}</td>
<td><div class="{% if item.is_credit %} journal-credit {% else %} journal-debit {% endif %}">{{ item.summary|default:"" }}{% if not item.is_balanced %} <td><div class="{% if item.is_credit %} journal-credit {% else %} journal-debit {% endif %}">{{ item.summary|default:"" }}{% if not item.is_balanced %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Unbalanced" context "Accounting|" as text %} {{ _("Unbalanced") }}
{{ text|force_escape }}
</span> </span>
{% endif %}{% if item.has_order_hole %} {% endif %}{% if item.has_order_hole %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Need Reorder" context "Accounting|" as text %} {{ _("Need Reorder") }}
{{ text|force_escape }}
</span> </span>
{% endif %}</div></td> {% endif %}</div></td>
<td class="amount">{{ item.debit_amount|accounting_amount }}</td> <td class="amount">{{ item.debit_amount|accounting_amount }}</td>
@ -109,7 +102,7 @@ First written: 2020/7/17
{% if item.pk is not None %} {% if item.pk is not None %}
<a href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}" 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> <i class="fas fa-eye"></i>
{% trans "View" context "Accounting|" as text %}{{ text|force_escape }} {{ _("View") }}
</a> </a>
{% endif %} {% endif %}
</td> </td>
@ -133,14 +126,12 @@ First written: 2020/7/17
{{ item.summary|default:"" }} {{ item.summary|default:"" }}
{% if not item.is_balanced %} {% if not item.is_balanced %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Unbalanced" context "Accounting|" as text %} {{ _("Unbalanced") }}
{{ text|force_escape }}
</span> </span>
{% endif %} {% endif %}
{% if item.has_order_hole %} {% if item.has_order_hole %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Need Reorder" context "Accounting|" as text %} {{ _("Need Reorder") }}
{{ text|force_escape }}
</span> </span>
{% endif %} {% endif %}
</div> </div>
@ -170,8 +161,7 @@ First written: 2020/7/17
{{ item.summary|default:"" }} {{ item.summary|default:"" }}
{% if not item.is_balanced %} {% if not item.is_balanced %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Unbalanced" context "Accounting|" as text %} {{ _("Unbalanced") }}
{{ text|force_escape }}
</span> </span>
{% endif %} {% endif %}
</div> </div>

View File

@ -27,7 +27,7 @@ First written: 2020/7/16
{% load accounting %} {% load accounting %}
{% block settings %} {% block settings %}
{% blocktrans asvar title with account=account.title context "Accounting|" %}Ledger Summary for {{ account }}{% endblocktrans %} {% blocktrans asvar title with account=account.title %}Ledger Summary for {{ account }}{% endblocktrans %}
{% setvar "title" title %} {% setvar "title" title %}
{% static "accounting/css/report.css" as file %}{% add_css file %} {% static "accounting/css/report.css" as file %}{% add_css file %}
{% endblock %} {% endblock %}
@ -38,32 +38,27 @@ First written: 2020/7/16
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
{% trans "New" context "Accounting|" as text %} {{ _("New")|force_escape }}
{{ text|force_escape }}
</button> </button>
<div class="dropdown-menu"> <div class="dropdown-menu">
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
{% trans "Cash Expense" context "Accounting|" as text %} {{ _("Cash Expense")|force_escape }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
{% trans "Cash Income" context "Accounting|" as text %} {{ _("Cash Income")|force_escape }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
{% trans "Transfer" context "Accounting|" as text %} {{ _("Transfer")|force_escape }}
{{ text|force_escape }}
</a> </a>
</div> </div>
</div> </div>
{% with current_report_icon="fas fa-file-invoice-dollar" %} {% with current_report_icon="fas fa-file-invoice-dollar" current_report_title=_("Ledger Summary") %}
{% trans "Ledger Summary" context "Accounting|" as current_report_title %}
{% include "accounting/include/report-chooser.html" %} {% include "accounting/include/report-chooser.html" %}
{% endwith %} {% endwith %}
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<span class="d-none d-md-inline">{{ account.title|title_case }}</span> <span class="d-none d-md-inline">{{ account.title|title_case }}</span>
<span class="d-md-none">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</span> <span class="d-md-none">{{ _("Account") }}</span>
</button> </button>
<div class="dropdown-menu account-picker"> <div class="dropdown-menu account-picker">
{% for x in accounts %} {% for x in accounts %}
@ -82,12 +77,12 @@ First written: 2020/7/16
<table class="table table-striped table-hover d-none d-sm-table general-journal-table"> <table class="table table-striped table-hover d-none d-sm-table general-journal-table">
<thead> <thead>
<tr> <tr>
<th scope="col">{% trans "Month" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Month") }}</th>
<th class="amount" scope="col">{% trans "Debit" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Debit") }}</th>
<th class="amount" scope="col">{% trans "Credit" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Credit") }}</th>
<th class="amount" scope="col">{% trans "Balance" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Balance") }}</th>
<th class="amount" scope="col">{% trans "Cumulative Balance" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Cumulative Balance") }}</th>
<th class="actions" scope="col">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="actions" scope="col">{{ _("View") }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -102,7 +97,7 @@ First written: 2020/7/16
{% if item.month is not None %} {% if item.month is not None %}
<a class="btn btn-info" role="button" href="{% url "accounting:ledger" account item.month|date:"Y-m" %}"> <a class="btn btn-info" role="button" href="{% url "accounting:ledger" account item.month|date:"Y-m" %}">
<i class="fas fa-eye"></i> <i class="fas fa-eye"></i>
<span class="d-none d-lg-inline">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</span> <span class="d-none d-lg-inline">{{ _("View") }}</span>
</a> </a>
{% endif %} {% endif %}
</td> </td>

View File

@ -27,7 +27,7 @@ First written: 2020/7/16
{% load accounting %} {% load accounting %}
{% block settings %} {% block settings %}
{% blocktrans asvar title with account=account.title prep_period=period.prep_desc context "Accounting|" %}Ledger for {{ account }} {{ prep_period }}{% endblocktrans %} {% blocktrans asvar title with account=account.title prep_period=period.prep_desc %}Ledger for {{ account }} {{ prep_period }}{% endblocktrans %}
{% setvar "title" title %} {% setvar "title" title %}
{% setvar "use_period_chooser" True %} {% setvar "use_period_chooser" True %}
{% static "accounting/css/report.css" as file %}{% add_css file %} {% static "accounting/css/report.css" as file %}{% add_css file %}
@ -39,32 +39,27 @@ First written: 2020/7/16
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
{% trans "New" context "Accounting|" as text %} {{ _("New")|force_escape }}
{{ text|force_escape }}
</button> </button>
<div class="dropdown-menu"> <div class="dropdown-menu">
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
{% trans "Cash Expense" context "Accounting|" as text %} {{ _("Cash Expense")|force_escape }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
{% trans "Cash Income" context "Accounting|" as text %} {{ _("Cash Income")|force_escape }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
{% trans "Transfer" context "Accounting|" as text %} {{ _("Transfer")|force_escape }}
{{ text|force_escape }}
</a> </a>
</div> </div>
</div> </div>
{% with current_report_icon="fas fa-file-invoice-dollar" %} {% with current_report_icon="fas fa-file-invoice-dollar" current_report_title=_("Ledger") %}
{% trans "Ledger" context "Accounting|" as current_report_title %}
{% include "accounting/include/report-chooser.html" %} {% include "accounting/include/report-chooser.html" %}
{% endwith %} {% endwith %}
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<span class="d-none d-md-inline">{{ account.title|title_case }}</span> <span class="d-none d-md-inline">{{ account.title|title_case }}</span>
<span class="d-md-none">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</span> <span class="d-md-none">{{ _("Account") }}</span>
</button> </button>
<div class="dropdown-menu account-picker"> <div class="dropdown-menu account-picker">
{% for x in accounts %} {% for x in accounts %}
@ -90,13 +85,13 @@ First written: 2020/7/16
<table class="table table-striped table-hover d-none d-md-table general-journal-table"> <table class="table table-striped table-hover d-none d-md-table general-journal-table">
<thead> <thead>
<tr> <tr>
<th scope="col">{% trans "Date" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Date") }}</th>
<th scope="col">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Account") }}</th>
<th scope="col">{% trans "Summary" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Summary") }}</th>
<th class="amount" scope="col">{% trans "Debit" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Debit") }}</th>
<th class="amount" scope="col">{% trans "Credit" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Credit") }}</th>
<th class="amount" scope="col">{% trans "Balance" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Balance") }}</th>
<th class="actions" scope="col">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="actions" scope="col">{{ _("View") }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -106,23 +101,19 @@ First written: 2020/7/16
<td>{{ item.account.title|title_case }}</td> <td>{{ item.account.title|title_case }}</td>
<td>{{ item.summary|default:"" }}{% if not item.is_balanced %} <td>{{ item.summary|default:"" }}{% if not item.is_balanced %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Unbalanced" context "Accounting|" as text %} {{ _("Unbalanced") }}
{{ text|force_escape }}
</span> </span>
{% endif %}{% if item.has_order_hole %} {% endif %}{% if item.has_order_hole %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Need Reorder" context "Accounting|" as text %} {{ _("Need Reorder") }}
{{ text|force_escape }}
</span> </span>
{% endif %}{% if not item.is_credit_card_paid %} {% endif %}{% if not item.is_credit_card_paid %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Unpaid" context "Accounting|" as text %} {{ _("Unpaid") }}
{{ text|force_escape }}
</span> </span>
{% endif %}{% if item.is_existing_equipment %} {% endif %}{% if item.is_existing_equipment %}
<span class="badge badge-info badge-pill"> <span class="badge badge-info badge-pill">
{% trans "Existing" context "Accounting|" as text %} {{ _("Existing") }}
{{ text|force_escape }}
</span> </span>
{% endif %}</td> {% endif %}</td>
<td class="amount">{{ item.debit_amount|accounting_amount }}</td> <td class="amount">{{ item.debit_amount|accounting_amount }}</td>
@ -132,7 +123,7 @@ First written: 2020/7/16
{% if item.pk is not None %} {% if item.pk is not None %}
<a href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}" 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> <i class="fas fa-eye"></i>
<span class="d-none d-lg-inline">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</span> <span class="d-none d-lg-inline">{{ _("View") }}</span>
</a> </a>
{% endif %} {% endif %}
</td> </td>
@ -155,26 +146,22 @@ First written: 2020/7/16
{{ item.summary|default:"" }} {{ item.summary|default:"" }}
{% if not item.is_balanced %} {% if not item.is_balanced %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Unbalanced" context "Accounting|" as text %} {{ _("Unbalanced") }}
{{ text|force_escape }}
</span> </span>
{% endif %} {% endif %}
{% if item.has_order_hole %} {% if item.has_order_hole %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Need Reorder" context "Accounting|" as text %} {{ _("Need Reorder") }}
{{ text|force_escape }}
</span> </span>
{% endif %} {% endif %}
{% if not item.is_credit_card_paid %} {% if not item.is_credit_card_paid %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Unpaid" context "Accounting|" as text %} {{ _("Unpaid") }}
{{ text|force_escape }}
</span> </span>
{% endif %} {% endif %}
{% if item.is_existing_equipment %} {% if item.is_existing_equipment %}
<span class="badge badge-info badge-pill"> <span class="badge badge-info badge-pill">
{% trans "Existing" context "Accounting|" as text %} {{ _("Existing") }}
{{ text|force_escape }}
</span> </span>
{% endif %} {% endif %}
</div> </div>

View File

@ -27,7 +27,7 @@ First written: 2020/7/21
{% load accounting %} {% load accounting %}
{% block settings %} {% block settings %}
{% blocktrans asvar title with query=request.GET.q context "Accounting|" %}Search Result for “{{ query }}”{% endblocktrans %} {% blocktrans asvar title with query=request.GET.q %}Search Result for “{{ query }}”{% endblocktrans %}
{% setvar "title" title %} {% setvar "title" title %}
{% setvar "use_period_chooser" True %} {% setvar "use_period_chooser" True %}
{% static "accounting/css/report.css" as file %}{% add_css file %} {% static "accounting/css/report.css" as file %}{% add_css file %}
@ -39,26 +39,21 @@ First written: 2020/7/21
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
{% trans "New" context "Accounting|" as text %} {{ _("New")|force_escape }}
{{ text|force_escape }}
</button> </button>
<div class="dropdown-menu"> <div class="dropdown-menu">
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
{% trans "Cash Expense" context "Accounting|" as text %} {{ _("Cash Expense")|force_escape }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
{% trans "Cash Income" context "Accounting|" as text %} {{ _("Cash Income")|force_escape }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
{% trans "Transfer" context "Accounting|" as text %} {{ _("Transfer")|force_escape }}
{{ text|force_escape }}
</a> </a>
</div> </div>
</div> </div>
{% with current_report_icon="fas fa-search" %} {% with current_report_icon="fas fa-search" current_report_title=_("Search") %}
{% trans "Search" context "Accounting|" as current_report_title %}
{% include "accounting/include/report-chooser.html" %} {% include "accounting/include/report-chooser.html" %}
{% endwith %} {% endwith %}
<form class="btn btn-primary input-group" action="{% url "accounting:search" %}" method="get"> <form class="btn btn-primary input-group" action="{% url "accounting:search" %}" method="get">
@ -66,8 +61,7 @@ First written: 2020/7/21
<label for="search-input" class="search-label"> <label for="search-input" class="search-label">
<button type="submit"> <button type="submit">
<i class="fas fa-search"></i> <i class="fas fa-search"></i>
{% trans "Search" context "Accounting|" as text %} {{ _("Search") }}
{{ text|force_escape }}
</button> </button>
</label> </label>
</form> </form>
@ -80,13 +74,13 @@ First written: 2020/7/21
<table class="table table-striped table-hover d-none d-md-table general-journal-table"> <table class="table table-striped table-hover d-none d-md-table general-journal-table">
<thead> <thead>
<tr> <tr>
<th scope="col">{% trans "Date" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Date") }}</th>
<th scope="col">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Account") }}</th>
<th scope="col">{% trans "Summary" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Summary") }}</th>
<th class="amount" scope="col">{% trans "Debit" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Debit") }}</th>
<th class="amount" scope="col">{% trans "Credit" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Credit") }}</th>
<th scope="col">{% trans "Notes" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Notes") }}</th>
<th class="actions" scope="col">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="actions" scope="col">{{ _("View") }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -96,13 +90,11 @@ First written: 2020/7/21
<td>{{ item.account.title|title_case }}</td> <td>{{ item.account.title|title_case }}</td>
<td><div class="{% if item.is_credit %} journal-credit {% else %} journal-debit {% endif %}">{{ item.summary|default:"" }}{% if not item.is_balanced %} <td><div class="{% if item.is_credit %} journal-credit {% else %} journal-debit {% endif %}">{{ item.summary|default:"" }}{% if not item.is_balanced %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Unbalanced" context "Accounting|" as text %} {{ _("Unbalanced") }}
{{ text|force_escape }}
</span> </span>
{% endif %}{% if item.has_order_hole %} {% endif %}{% if item.has_order_hole %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Need Reorder" context "Accounting|" as text %} {{ _("Need Reorder") }}
{{ text|force_escape }}
</span> </span>
{% endif %}</div></td> {% endif %}</div></td>
<td class="amount">{{ item.debit_amount|accounting_amount }}</td> <td class="amount">{{ item.debit_amount|accounting_amount }}</td>
@ -111,7 +103,7 @@ First written: 2020/7/21
<td class="actions"> <td class="actions">
<a href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}" 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> <i class="fas fa-eye"></i>
{% trans "View" context "Accounting|" as text %}{{ text|force_escape }} {{ _("View") }}
</a> </a>
</td> </td>
</tr> </tr>
@ -133,14 +125,12 @@ First written: 2020/7/21
{{ item.summary|default:"" }} {{ item.summary|default:"" }}
{% if not item.is_balanced %} {% if not item.is_balanced %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Unbalanced" context "Accounting|" as text %} {{ _("Unbalanced") }}
{{ text|force_escape }}
</span> </span>
{% endif %} {% endif %}
{% if item.has_order_hole %} {% if item.has_order_hole %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{% trans "Need Reorder" context "Accounting|" as text %} {{ _("Need Reorder") }}
{{ text|force_escape }}
</span> </span>
{% endif %} {% endif %}
</div> </div>

View File

@ -25,8 +25,7 @@ First written: 2020/7/23
{% load mia_core %} {% load mia_core %}
{% block settings %} {% block settings %}
{% trans "Cash Expense Transaction" context "Accounting|" as title %} {% setvar "title" _("Cash Expense Transaction") %}
{% setvar "title" title %}
{% setvar "use_jqueryui" True %} {% setvar "use_jqueryui" True %}
{% static "accounting/css/transactions.css" as file %}{% add_css file %} {% static "accounting/css/transactions.css" as file %}{% add_css file %}
{% static "accounting/css/summary-helper.css" as file %}{% add_css file %} {% static "accounting/css/summary-helper.css" as file %}{% add_css file %}
@ -55,7 +54,7 @@ First written: 2020/7/23
{% csrf_token %} {% csrf_token %}
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2"> <div class="col-sm-2">
<label for="txn-date">{% trans "Date:" context "Accounting|" as text %}{{ text|force_escape }}</label> <label for="txn-date">{{ _("Date:") }}</label>
</div> </div>
<div class="col-sm-10"> <div class="col-sm-10">
<input id="txn-date" class="form-control {% if item.date.errors %} is-invalid {% endif %}" type="date" name="date" value="{{ item.date.value }}" required="required" /> <input id="txn-date" class="form-control {% if item.date.errors %} is-invalid {% endif %}" type="date" name="date" value="{{ item.date.value }}" required="required" />
@ -80,7 +79,7 @@ First written: 2020/7/23
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
<div class="d-flex justify-content-between align-items-center"> <div class="d-flex justify-content-between align-items-center">
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Total") }}
<span id="debit-total" class="amount">{{ item.debit_total }}</span> <span id="debit-total" class="amount">{{ item.debit_total }}</span>
</div> </div>
</li> </li>
@ -90,7 +89,7 @@ First written: 2020/7/23
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2"> <div class="col-sm-2">
<label for="txn-note">{% trans "Notes:" context "Accounting|" as text %}{{ text|force_escape }}</label> <label for="txn-note">{{ _("Notes:") }}</label>
</div> </div>
<div class="col-sm-10"> <div class="col-sm-10">
<textarea id="txn-note" class="form-control {% if item.notes.errors %} is-invalid {% endif %}" name="notes">{{ item.notes.value|default:"" }}</textarea> <textarea id="txn-note" class="form-control {% if item.notes.errors %} is-invalid {% endif %}" name="notes">{{ item.notes.value|default:"" }}</textarea>
@ -102,7 +101,7 @@ First written: 2020/7/23
<div class="col-sm-12"> <div class="col-sm-12">
<button class="btn btn-primary" type="submit"> <button class="btn btn-primary" type="submit">
<i class="fas fa-save"></i> <i class="fas fa-save"></i>
{% trans "Save" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Save") }}
</button> </button>
</div> </div>
</div> </div>

View File

@ -26,8 +26,7 @@ First written: 2020/7/23
{% load accounting %} {% load accounting %}
{% block settings %} {% block settings %}
{% trans "Cash Expense Transaction" context "Accounting|" as title %} {% setvar "title" _("Cash Expense Transaction") %}
{% setvar "title" title %}
{% static "accounting/css/transactions.css" as file %}{% add_css file %} {% static "accounting/css/transactions.css" as file %}{% add_css file %}
{% endblock %} {% endblock %}
@ -36,7 +35,7 @@ First written: 2020/7/23
{% if item.has_order_hole %} {% if item.has_order_hole %}
<div class="alert alert-danger alert-dismissible fade show"> <div class="alert alert-danger alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert">&times;</button> <button type="button" class="close" data-dismiss="alert">&times;</button>
<strong>{{ _("Error:") }}</strong> {% trans "The transactions on this day are not well-ordered. Please reorder them." context "Accounting|" as text %}{{ text|force_escape }} <strong>{{ _("Error:") }}</strong> {{ _("The transactions on this day are not well-ordered. Please reorder them.") }}
</div> </div>
{% endif %} {% endif %}
@ -50,12 +49,12 @@ First written: 2020/7/23
<!-- Modal Header --> <!-- Modal Header -->
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">{% trans "Cash Expense Transaction Deletion Confirmation" context "Accounting|" as text %}{{ text|force_escape }}</h4> <h4 class="modal-title">{{ _("Cash Expense Transaction Deletion Confirmation") }}</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
</div> </div>
<!-- Modal body --> <!-- Modal body -->
<div class="modal-body">{% trans "Do you really want to delete this cash expense transaction?" context "Accounting|" as text %}{{ text|force_escape }}</div> <div class="modal-body">{{ _("Do you really want to delete this cash expense transaction?") }}</div>
<!-- Modal footer --> <!-- Modal footer -->
<div class="modal-footer"> <div class="modal-footer">
@ -77,7 +76,7 @@ First written: 2020/7/23
{% trans "Edit" context "Navigation|" as text %}{{ text|force_escape }} {% trans "Edit" context "Navigation|" as text %}{{ text|force_escape }}
</a> </a>
{% if not item.has_many_same_day %} {% if not item.has_many_same_day %}
<button type="button" class="btn btn-secondary d-none d-sm-inline" disabled="disabled" title="{% trans "There is no other transaction at the same day." context "Accounting|" as text %}{{ text|force_escape }}"> <button type="button" class="btn btn-secondary d-none d-sm-inline" disabled="disabled" title="{{ _("There is no other transaction at the same day.") }}">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
{% trans "Sort" context "Navigation|" as text %}{{ text|force_escape }} {% trans "Sort" context "Navigation|" as text %}{{ text|force_escape }}
</button> </button>
@ -97,7 +96,7 @@ First written: 2020/7/23
</button> </button>
<div class="dropdown-menu"> <div class="dropdown-menu">
{% if not item.has_many_same_day %} {% if not item.has_many_same_day %}
<span class="dropdown-item disabled" title="{% trans "There is no other transaction at the same day." context "Accounting|" as text %}{{ text|force_escape }}"> <span class="dropdown-item disabled" title="{{ _("There is no other transaction at the same day.") }}">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
{% trans "Sort" context "Navigation|" as text %}{{ text|force_escape }} {% trans "Sort" context "Navigation|" as text %}{{ text|force_escape }}
</span> </span>
@ -120,16 +119,16 @@ First written: 2020/7/23
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-2">{% trans "Date:" context "Accounting|" as text %}{{ text|force_escape }}</div> <div class="col-sm-2">{{ _("Date:") }}</div>
<div class="col-sm-10">{{ item.date|smart_date }}</div> <div class="col-sm-10">{{ item.date|smart_date }}</div>
</div> </div>
<table class="table table-striped table-hover d-none d-sm-table"> <table class="table table-striped table-hover d-none d-sm-table">
<thead> <thead>
<tr> <tr>
<th scope="col">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Account") }}</th>
<th scope="col">{% trans "Summary" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Summary") }}</th>
<th class="amount" scope="col">{% trans "$" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("$") }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -143,7 +142,7 @@ First written: 2020/7/23
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="2">{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}</td> <td colspan="2">{{ _("Total") }}</td>
<td class="amount">{{ item.debit_total|accounting_amount }}</td> <td class="amount">{{ item.debit_total|accounting_amount }}</td>
</tr> </tr>
</tfoot> </tfoot>
@ -161,7 +160,7 @@ First written: 2020/7/23
{% endfor %} {% endfor %}
<li class="list-group-item"> <li class="list-group-item">
<div class="d-flex justify-content-between align-items-center account-line"> <div class="d-flex justify-content-between align-items-center account-line">
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Total") }}
<span class="badge badge-info">{{ item.debit_total|accounting_amount }}</span> <span class="badge badge-info">{{ item.debit_total|accounting_amount }}</span>
</div> </div>
</li> </li>
@ -169,7 +168,7 @@ First written: 2020/7/23
{% if item.notes %} {% if item.notes %}
<div class="row"> <div class="row">
<div class="col-sm-2">{% trans "Notes:" context "Accounting|" as text %}{{ text|force_escape }}</div> <div class="col-sm-2">{{ _("Notes:") }}</div>
<div class="col-sm-10">{{ item.notes }}</div> <div class="col-sm-10">{{ item.notes }}</div>
</div> </div>
{% endif %} {% endif %}

View File

@ -25,8 +25,7 @@ First written: 2020/7/23
{% load mia_core %} {% load mia_core %}
{% block settings %} {% block settings %}
{% trans "Cash Income Transaction" context "Accounting|" as title %} {% setvar "title" _("Cash Income Transaction") %}
{% setvar "title" title %}
{% setvar "use_jqueryui" True %} {% setvar "use_jqueryui" True %}
{% static "accounting/css/transactions.css" as file %}{% add_css file %} {% static "accounting/css/transactions.css" as file %}{% add_css file %}
{% static "accounting/css/summary-helper.css" as file %}{% add_css file %} {% static "accounting/css/summary-helper.css" as file %}{% add_css file %}
@ -55,7 +54,7 @@ First written: 2020/7/23
{% csrf_token %} {% csrf_token %}
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2"> <div class="col-sm-2">
<label for="txn-date">{% trans "Date:" context "Accounting|" as text %}{{ text|force_escape }}</label> <label for="txn-date">{{ _("Date:") }}</label>
</div> </div>
<div class="col-sm-10"> <div class="col-sm-10">
<input id="txn-date" class="form-control {% if item.date.errors %} is-invalid {% endif %}" type="date" name="date" value="{{ item.date.value }}" required="required" /> <input id="txn-date" class="form-control {% if item.date.errors %} is-invalid {% endif %}" type="date" name="date" value="{{ item.date.value }}" required="required" />
@ -80,7 +79,7 @@ First written: 2020/7/23
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
<div class="d-flex justify-content-between align-items-center"> <div class="d-flex justify-content-between align-items-center">
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Total") }}
<span id="credit-total" class="amount">{{ item.credit_total }}</span> <span id="credit-total" class="amount">{{ item.credit_total }}</span>
</div> </div>
</li> </li>
@ -90,7 +89,7 @@ First written: 2020/7/23
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2"> <div class="col-sm-2">
<label for="txn-note">{% trans "Notes:" context "Accounting|" as text %}{{ text|force_escape }}</label> <label for="txn-note">{{ _("Notes:") }}</label>
</div> </div>
<div class="col-sm-10"> <div class="col-sm-10">
<textarea id="txn-note" class="form-control {% if item.notes.errors %} is-invalid {% endif %}" name="notes">{{ item.notes.value|default:"" }}</textarea> <textarea id="txn-note" class="form-control {% if item.notes.errors %} is-invalid {% endif %}" name="notes">{{ item.notes.value|default:"" }}</textarea>
@ -102,7 +101,7 @@ First written: 2020/7/23
<div class="col-sm-12"> <div class="col-sm-12">
<button class="btn btn-primary" type="submit"> <button class="btn btn-primary" type="submit">
<i class="fas fa-save"></i> <i class="fas fa-save"></i>
{% trans "Save" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Save") }}
</button> </button>
</div> </div>
</div> </div>

View File

@ -26,8 +26,7 @@ First written: 2020/7/23
{% load accounting %} {% load accounting %}
{% block settings %} {% block settings %}
{% trans "Cash Income Transaction" context "Accounting|" as title %} {% setvar "title" _("Cash Income Transaction") %}
{% setvar "title" title %}
{% static "accounting/css/transactions.css" as file %}{% add_css file %} {% static "accounting/css/transactions.css" as file %}{% add_css file %}
{% endblock %} {% endblock %}
@ -36,7 +35,7 @@ First written: 2020/7/23
{% if item.has_order_hole %} {% if item.has_order_hole %}
<div class="alert alert-danger alert-dismissible fade show"> <div class="alert alert-danger alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert">&times;</button> <button type="button" class="close" data-dismiss="alert">&times;</button>
<strong>{{ _("Error:") }}</strong> {% trans "The transactions on this day are not well-ordered. Please reorder them." context "Accounting|" as text %}{{ text|force_escape }} <strong>{{ _("Error:") }}</strong> {{ _("The transactions on this day are not well-ordered. Please reorder them.") }}
</div> </div>
{% endif %} {% endif %}
@ -50,12 +49,12 @@ First written: 2020/7/23
<!-- Modal Header --> <!-- Modal Header -->
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">{% trans "Cash Income Transaction Deletion Confirmation" context "Accounting|" as text %}{{ text|force_escape }}</h4> <h4 class="modal-title">{{ _("Cash Income Transaction Deletion Confirmation") }}</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
</div> </div>
<!-- Modal body --> <!-- Modal body -->
<div class="modal-body">{% trans "Do you really want to delete this cash income transaction?" context "Accounting|" as text %}{{ text|force_escape }}</div> <div class="modal-body">{{ _("Do you really want to delete this cash income transaction?") }}</div>
<!-- Modal footer --> <!-- Modal footer -->
<div class="modal-footer"> <div class="modal-footer">
@ -77,7 +76,7 @@ First written: 2020/7/23
{% trans "Edit" context "Navigation|" as text %}{{ text|force_escape }} {% trans "Edit" context "Navigation|" as text %}{{ text|force_escape }}
</a> </a>
{% if not item.has_many_same_day %} {% if not item.has_many_same_day %}
<button type="button" class="btn btn-secondary d-none d-sm-inline" disabled="disabled" title="{% trans "There is no other transaction at the same day." context "Accounting|" as text %}{{ text|force_escape }}"> <button type="button" class="btn btn-secondary d-none d-sm-inline" disabled="disabled" title="{{ _("There is no other transaction at the same day.") }}">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
{% trans "Sort" context "Navigation|" as text %}{{ text|force_escape }} {% trans "Sort" context "Navigation|" as text %}{{ text|force_escape }}
</button> </button>
@ -97,7 +96,7 @@ First written: 2020/7/23
</button> </button>
<div class="dropdown-menu"> <div class="dropdown-menu">
{% if not item.has_many_same_day %} {% if not item.has_many_same_day %}
<span class="dropdown-item disabled" title="{% trans "There is no other transaction at the same day." context "Accounting|" as text %}{{ text|force_escape }}"> <span class="dropdown-item disabled" title="{{ _("There is no other transaction at the same day.") }}">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
{% trans "Sort" context "Navigation|" as text %}{{ text|force_escape }} {% trans "Sort" context "Navigation|" as text %}{{ text|force_escape }}
</span> </span>
@ -120,16 +119,16 @@ First written: 2020/7/23
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-2">{% trans "Date:" context "Accounting|" as text %}{{ text|force_escape }}</div> <div class="col-sm-2">{{ _("Date:") }}</div>
<div class="col-sm-10">{{ item.date|smart_date }}</div> <div class="col-sm-10">{{ item.date|smart_date }}</div>
</div> </div>
<table class="table table-striped table-hover d-none d-sm-table"> <table class="table table-striped table-hover d-none d-sm-table">
<thead> <thead>
<tr> <tr>
<th scope="col">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Account") }}</th>
<th scope="col">{% trans "Summary" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Summary") }}</th>
<th class="amount" scope="col">{% trans "$" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("$") }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -143,7 +142,7 @@ First written: 2020/7/23
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="2">{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}</td> <td colspan="2">{{ _("Total") }}</td>
<td class="amount">{{ item.credit_total|accounting_amount }}</td> <td class="amount">{{ item.credit_total|accounting_amount }}</td>
</tr> </tr>
</tfoot> </tfoot>
@ -161,7 +160,7 @@ First written: 2020/7/23
{% endfor %} {% endfor %}
<li class="list-group-item"> <li class="list-group-item">
<div class="d-flex justify-content-between align-items-center account-line"> <div class="d-flex justify-content-between align-items-center account-line">
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Total") }}
<span class="badge badge-info">{{ item.credit_total|accounting_amount }}</span> <span class="badge badge-info">{{ item.credit_total|accounting_amount }}</span>
</div> </div>
</li> </li>
@ -169,7 +168,7 @@ First written: 2020/7/23
{% if item.notes %} {% if item.notes %}
<div class="row"> <div class="row">
<div class="col-sm-2">{% trans "Notes:" context "Accounting|" as text %}{{ text|force_escape }}</div> <div class="col-sm-2">{{ _("Notes:") }}</div>
<div class="col-sm-10">{{ item.notes }}</div> <div class="col-sm-10">{{ item.notes }}</div>
</div> </div>
{% endif %} {% endif %}

View File

@ -25,8 +25,7 @@ First written: 2020/7/23
{% load mia_core %} {% load mia_core %}
{% block settings %} {% block settings %}
{% trans "Transfer Transaction" context "Accounting|" as title %} {% setvar "title" _("Transfer Transaction") %}
{% setvar "title" title %}
{% setvar "use_jqueryui" True %} {% setvar "use_jqueryui" True %}
{% static "accounting/css/transactions.css" as file %}{% add_css file %} {% static "accounting/css/transactions.css" as file %}{% add_css file %}
{% static "accounting/css/summary-helper.css" as file %}{% add_css file %} {% static "accounting/css/summary-helper.css" as file %}{% add_css file %}
@ -55,7 +54,7 @@ First written: 2020/7/23
{% csrf_token %} {% csrf_token %}
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2"> <div class="col-sm-2">
<label for="txn-date">{% trans "Date:" context "Accounting|" as text %}{{ text|force_escape }}</label> <label for="txn-date">{{ _("Date:") }}</label>
</div> </div>
<div class="col-sm-10"> <div class="col-sm-10">
<input id="txn-date" class="form-control {% if item.date.errors %} is-invalid {% endif %}" type="date" name="date" value="{{ item.date.value }}" required="required" /> <input id="txn-date" class="form-control {% if item.date.errors %} is-invalid {% endif %}" type="date" name="date" value="{{ item.date.value }}" required="required" />
@ -65,7 +64,7 @@ First written: 2020/7/23
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-6"> <div class="col-sm-6">
<h2>{% trans "Debit" context "Accounting|" as text %}{{ text|force_escape }}</h2> <h2>{{ _("Debit") }}</h2>
<ul id="debit-records" class="list-group"> <ul id="debit-records" class="list-group">
{% for record in item.debit_records %} {% for record in item.debit_records %}
@ -82,7 +81,7 @@ First written: 2020/7/23
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
<div id="debit-total-row" class="d-flex justify-content-between align-items-center form-control {% if item.balance_error %} is-invalid {% endif %} balance-row"> <div id="debit-total-row" class="d-flex justify-content-between align-items-center form-control {% if item.balance_error %} is-invalid {% endif %} balance-row">
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Total") }}
<span id="debit-total" class="amount">{{ item.debit_total }}</span> <span id="debit-total" class="amount">{{ item.debit_total }}</span>
</div> </div>
<div id="debit-total-error" class="invalid-feedback balance-error">{{ item.balance_error|default:"" }}</div> <div id="debit-total-error" class="invalid-feedback balance-error">{{ item.balance_error|default:"" }}</div>
@ -91,7 +90,7 @@ First written: 2020/7/23
</div> </div>
<div class="col-sm-6"> <div class="col-sm-6">
<h2>{% trans "Credit" context "Accounting|" as text %}{{ text|force_escape }}</h2> <h2>{{ _("Credit") }}</h2>
<ul id="credit-records" class="list-group"> <ul id="credit-records" class="list-group">
{% for record in item.credit_records %} {% for record in item.credit_records %}
@ -108,7 +107,7 @@ First written: 2020/7/23
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
<div id="credit-total-row" class="d-flex justify-content-between align-items-center form-control {% if item.balance_error %} is-invalid {% endif %} balance-row"> <div id="credit-total-row" class="d-flex justify-content-between align-items-center form-control {% if item.balance_error %} is-invalid {% endif %} balance-row">
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Total") }}
<span id="credit-total" class="amount">{{ item.credit_total }}</span> <span id="credit-total" class="amount">{{ item.credit_total }}</span>
</div> </div>
<div id="credit-total-error" class="invalid-feedback balance-error">{{ item.balance_error|default:"" }}</div> <div id="credit-total-error" class="invalid-feedback balance-error">{{ item.balance_error|default:"" }}</div>
@ -119,7 +118,7 @@ First written: 2020/7/23
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2"> <div class="col-sm-2">
<label for="txn-note">{% trans "Notes:" context "Accounting|" as text %}{{ text|force_escape }}</label> <label for="txn-note">{{ _("Notes:") }}</label>
</div> </div>
<div class="col-sm-10"> <div class="col-sm-10">
<textarea id="txn-note" class="form-control {% if item.notes.errors %} is-invalid {% endif %}" name="notes">{{ item.notes.value|default:"" }}</textarea> <textarea id="txn-note" class="form-control {% if item.notes.errors %} is-invalid {% endif %}" name="notes">{{ item.notes.value|default:"" }}</textarea>
@ -131,7 +130,7 @@ First written: 2020/7/23
<div class="col-sm-12"> <div class="col-sm-12">
<button class="btn btn-primary" type="submit"> <button class="btn btn-primary" type="submit">
<i class="fas fa-save"></i> <i class="fas fa-save"></i>
{% trans "Save" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Save") }}
</button> </button>
</div> </div>
</div> </div>

View File

@ -26,8 +26,7 @@ First written: 2020/7/23
{% load accounting %} {% load accounting %}
{% block settings %} {% block settings %}
{% trans "Transfer Transaction" context "Accounting|" as title %} {% setvar "title" _("Transfer Transaction") %}
{% setvar "title" title %}
{% static "accounting/css/transactions.css" as file %}{% add_css file %} {% static "accounting/css/transactions.css" as file %}{% add_css file %}
{% endblock %} {% endblock %}
@ -36,7 +35,7 @@ First written: 2020/7/23
{% if item.has_order_hole %} {% if item.has_order_hole %}
<div class="alert alert-danger alert-dismissible fade show"> <div class="alert alert-danger alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert">&times;</button> <button type="button" class="close" data-dismiss="alert">&times;</button>
<strong>{{ _("Error:") }}</strong> {% trans "The transactions on this day are not well-ordered. Please reorder them." context "Accounting|" as text %}{{ text|force_escape }} <strong>{{ _("Error:") }}</strong> {{ _("The transactions on this day are not well-ordered. Please reorder them.") }}
</div> </div>
{% endif %} {% endif %}
@ -50,12 +49,12 @@ First written: 2020/7/23
<!-- Modal Header --> <!-- Modal Header -->
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">{% trans "Transfer Transaction Deletion Confirmation" context "Accounting|" as text %}{{ text|force_escape }}</h4> <h4 class="modal-title">{{ _("Transfer Transaction Deletion Confirmation") }}</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
</div> </div>
<!-- Modal body --> <!-- Modal body -->
<div class="modal-body">{% trans "Do you really want to delete this transfer transaction?" context "Accounting|" as text %}{{ text|force_escape }}</div> <div class="modal-body">{{ _("Do you really want to delete this transfer transaction?") }}</div>
<!-- Modal footer --> <!-- Modal footer -->
<div class="modal-footer"> <div class="modal-footer">
@ -77,7 +76,7 @@ First written: 2020/7/23
{% trans "Edit" context "Navigation|" as text %}{{ text|force_escape }} {% trans "Edit" context "Navigation|" as text %}{{ text|force_escape }}
</a> </a>
{% if not item.has_many_same_day %} {% if not item.has_many_same_day %}
<button type="button" class="btn btn-secondary d-none d-sm-inline" disabled="disabled" title="{% trans "There is no other transaction at the same day." context "Accounting|" as text %}{{ text|force_escape }}"> <button type="button" class="btn btn-secondary d-none d-sm-inline" disabled="disabled" title="{{ _("There is no other transaction at the same day.") }}">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
{% trans "Sort" context "Navigation|" as text %}{{ text|force_escape }} {% trans "Sort" context "Navigation|" as text %}{{ text|force_escape }}
</button> </button>
@ -93,7 +92,7 @@ First written: 2020/7/23
</button> </button>
<div class="dropdown-menu"> <div class="dropdown-menu">
{% if not item.has_many_same_day %} {% if not item.has_many_same_day %}
<span class="dropdown-item disabled" title="{% trans "There is no other transaction at the same day." context "Accounting|" as text %}{{ text|force_escape }}"> <span class="dropdown-item disabled" title="{{ _("There is no other transaction at the same day.") }}">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
{% trans "Sort" context "Navigation|" as text %}{{ text|force_escape }} {% trans "Sort" context "Navigation|" as text %}{{ text|force_escape }}
</span> </span>
@ -112,20 +111,20 @@ First written: 2020/7/23
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-2">{% trans "Date:" context "Accounting|" as text %}{{ text|force_escape }}</div> <div class="col-sm-2">{{ _("Date:") }}</div>
<div class="col-sm-10">{{ item.date|smart_date }}</div> <div class="col-sm-10">{{ item.date|smart_date }}</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
<h2>{% trans "Debit" context "Accounting|" as text %}{{ text|force_escape }}</h2> <h2>{{ _("Debit") }}</h2>
<table class="table table-striped table-hover d-none d-lg-table"> <table class="table table-striped table-hover d-none d-lg-table">
<thead> <thead>
<tr> <tr>
<th scope="col">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Account") }}</th>
<th scope="col">{% trans "Summary" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Summary") }}</th>
<th class="amount" scope="col">{% trans "$" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("$") }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -139,7 +138,7 @@ First written: 2020/7/23
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="2">{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}</td> <td colspan="2">{{ _("Total") }}</td>
<td class="amount">{{ item.debit_total|accounting_amount }}</td> <td class="amount">{{ item.debit_total|accounting_amount }}</td>
</tr> </tr>
</tfoot> </tfoot>
@ -157,7 +156,7 @@ First written: 2020/7/23
{% endfor %} {% endfor %}
<li class="list-group-item"> <li class="list-group-item">
<div class="d-flex justify-content-between align-items-center account-line"> <div class="d-flex justify-content-between align-items-center account-line">
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Total") }}
<span class="badge badge-info">{{ item.debit_total|accounting_amount }}</span> <span class="badge badge-info">{{ item.debit_total|accounting_amount }}</span>
</div> </div>
</li> </li>
@ -165,14 +164,14 @@ First written: 2020/7/23
</div> </div>
<div class="col-sm-6"> <div class="col-sm-6">
<h2>{% trans "Credit" context "Accounting|" as text %}{{ text|force_escape }}</h2> <h2>{{ _("Credit") }}</h2>
<table class="table table-striped table-hover d-none d-lg-table"> <table class="table table-striped table-hover d-none d-lg-table">
<thead> <thead>
<tr> <tr>
<th scope="col">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Account") }}</th>
<th scope="col">{% trans "Summary" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Summary") }}</th>
<th class="amount" scope="col">{% trans "$" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("$") }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -186,7 +185,7 @@ First written: 2020/7/23
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="2">{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}</td> <td colspan="2">{{ _("Total") }}</td>
<td class="amount">{{ item.credit_total|accounting_amount }}</td> <td class="amount">{{ item.credit_total|accounting_amount }}</td>
</tr> </tr>
</tfoot> </tfoot>
@ -205,7 +204,7 @@ First written: 2020/7/23
{% endfor %} {% endfor %}
<li class="list-group-item"> <li class="list-group-item">
<div class="d-flex justify-content-between align-items-center account-line"> <div class="d-flex justify-content-between align-items-center account-line">
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Total") }}
<span class="badge badge-info">{{ item.credit_total|accounting_amount }}</span> <span class="badge badge-info">{{ item.credit_total|accounting_amount }}</span>
</div> </div>
</li> </li>
@ -215,7 +214,7 @@ First written: 2020/7/23
{% if item.notes %} {% if item.notes %}
<div class="row"> <div class="row">
<div class="col-sm-2">{% trans "Notes:" context "Accounting|" as text %}{{ text|force_escape }}</div> <div class="col-sm-2">{{ _("Notes:") }}</div>
<div class="col-sm-10">{{ item.notes }}</div> <div class="col-sm-10">{{ item.notes }}</div>
</div> </div>
{% endif %} {% endif %}

View File

@ -27,7 +27,7 @@ First written: 2020/7/19
{% load accounting %} {% load accounting %}
{% block settings %} {% block settings %}
{% blocktrans asvar title with prep_period=period.prep_desc context "Accounting|" %}Trial Balance {{ prep_period }}{% endblocktrans %} {% blocktrans asvar title with prep_period=period.prep_desc %}Trial Balance {{ prep_period }}{% endblocktrans %}
{% setvar "title" title %} {% setvar "title" title %}
{% setvar "use_period_chooser" True %} {% setvar "use_period_chooser" True %}
{% static "accounting/css/report.css" as file %}{% add_css file %} {% static "accounting/css/report.css" as file %}{% add_css file %}
@ -39,26 +39,21 @@ First written: 2020/7/19
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
{% trans "New" context "Accounting|" as text %} {{ _("New")|force_escape }}
{{ text|force_escape }}
</button> </button>
<div class="dropdown-menu"> <div class="dropdown-menu">
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
{% trans "Cash Expense" context "Accounting|" as text %} {{ _("Cash Expense")|force_escape }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
{% trans "Cash Income" context "Accounting|" as text %} {{ _("Cash Income")|force_escape }}
{{ text|force_escape }}
</a> </a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
{% trans "Transfer" context "Accounting|" as text %} {{ _("Transfer")|force_escape }}
{{ text|force_escape }}
</a> </a>
</div> </div>
</div> </div>
{% with current_report_icon="fas fa-balance-scale-right" %} {% with current_report_icon="fas fa-balance-scale-right" current_report_title=_("Trial Balance") %}
{% trans "Trial Balance" context "Accounting|" as current_report_title %}
{% include "accounting/include/report-chooser.html" %} {% include "accounting/include/report-chooser.html" %}
{% endwith %} {% endwith %}
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal"> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal">
@ -84,10 +79,10 @@ First written: 2020/7/19
<table class="table table-borderless table-hover trial-balance-table"> <table class="table table-borderless table-hover trial-balance-table">
<thead> <thead>
<tr> <tr>
<th scope="col">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</th> <th scope="col">{{ _("Account") }}</th>
<th class="amount" scope="col">{% trans "Debit" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Debit") }}</th>
<th class="amount" scope="col">{% trans "Credit" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="amount" scope="col">{{ _("Credit") }}</th>
<th class="actions" scope="col">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</th> <th class="actions" scope="col">{{ _("View") }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -99,7 +94,7 @@ First written: 2020/7/19
<td class="actions"> <td class="actions">
<a href="{% url "accounting:ledger" item period %}" class="btn btn-info" role="button"> <a href="{% url "accounting:ledger" item period %}" class="btn btn-info" role="button">
<i class="fas fa-eye"></i> <i class="fas fa-eye"></i>
<span class="d-none d-lg-inline">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</span> <span class="d-none d-lg-inline">{{ _("View") }}</span>
</a> </a>
</td> </td>
</tr> </tr>
@ -107,7 +102,7 @@ First written: 2020/7/19
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<td>{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}</td> <td>{{ _("Total") }}</td>
<td class="amount">{{ total_item.debit_amount|accounting_amount }}</td> <td class="amount">{{ total_item.debit_amount|accounting_amount }}</td>
<td class="amount">{{ total_item.credit_amount|accounting_amount }}</td> <td class="amount">{{ total_item.credit_amount|accounting_amount }}</td>
<td></td> <td></td>
@ -147,7 +142,7 @@ First written: 2020/7/19
</li> </li>
{% endfor %} {% endfor %}
<li class="list-group-item d-flex justify-content-between align-items-center total"> <li class="list-group-item d-flex justify-content-between align-items-center total">
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} {{ _("Total") }}
<div> <div>
<span class="badge badge-success badge-pill"> <span class="badge badge-success badge-pill">
{{ total_item.debit_amount|intcomma:False }} {{ total_item.debit_amount|intcomma:False }}

View File

@ -29,7 +29,7 @@ from django.db.models import Q, Sum, Case, When, F, Count, Max, Min, Value, \
from django.db.models.functions import StrIndex, Left from django.db.models.functions import StrIndex, Left
from django.urls import reverse from django.urls import reverse
from django.utils import timezone from django.utils import timezone
from django.utils.translation import pgettext from django.utils.translation import gettext as _
from .forms import TransactionForm, RecordForm from .forms import TransactionForm, RecordForm
from .models import Account, Transaction, Record from .models import Account, Transaction, Record
@ -258,8 +258,7 @@ def get_cash_accounts():
.order_by("code")) .order_by("code"))
accounts.insert(0, Account( accounts.insert(0, Account(
code="0", code="0",
title=pgettext( title=_("current assets and liabilities"),
"Accounting|", "current assets and liabilities"),
)) ))
return accounts return accounts

View File

@ -20,7 +20,7 @@
""" """
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.db.models import Q from django.db.models import Q
from django.utils.translation import pgettext from django.utils.translation import gettext as _
from .models import Account, Record from .models import Account, Record
@ -37,9 +37,8 @@ def validate_record_id(value):
try: try:
Record.objects.get(pk=value) Record.objects.get(pk=value)
except Record.DoesNotExist: except Record.DoesNotExist:
raise ValidationError( raise ValidationError(_("This record does not exists."),
pgettext("Accounting|", "This record does not exists."), code="not_exist")
code="not_exist")
def validate_record_account_code(value): def validate_record_account_code(value):
@ -54,14 +53,12 @@ def validate_record_account_code(value):
try: try:
Account.objects.get(code=value) Account.objects.get(code=value)
except Account.DoesNotExist: except Account.DoesNotExist:
raise ValidationError( raise ValidationError(_("This account does not exist."),
pgettext("Accounting|", "This account does not exist."), code="not_exist")
code="not_exist")
child = Account.objects.filter( child = Account.objects.filter(
Q(code__startswith=value), Q(code__startswith=value),
~Q(code=value), ~Q(code=value),
).first() ).first()
if child is not None: if child is not None:
raise ValidationError( raise ValidationError(_("You cannot select a parent account."),
pgettext("Accounting|", "You cannot select a parent account."), code="parent_account")
code="parent_account")

View File

@ -31,7 +31,7 @@ from django.template.loader import render_to_string
from django.urls import reverse from django.urls import reverse
from django.utils import timezone from django.utils import timezone
from django.utils.decorators import method_decorator from django.utils.decorators import method_decorator
from django.utils.translation import pgettext, gettext_noop from django.utils.translation import gettext as _, gettext_noop
from django.views.decorators.http import require_GET, require_POST from django.views.decorators.http import require_GET, require_POST
from django.views.generic import RedirectView from django.views.generic import RedirectView
@ -133,7 +133,7 @@ def cash(request, account, period):
if len(records) > 0 if len(records) > 0
else Transaction(date=timezone.localdate())), else Transaction(date=timezone.localdate())),
account=account, account=account,
summary=pgettext("Accounting|", "Total"), summary=_("Total"),
) )
record_sum.balance = balance record_sum.balance = balance
record_sum.credit_amount = sum([ record_sum.credit_amount = sum([
@ -248,7 +248,7 @@ def cash_summary(request, account):
cumulative_balance = cumulative_balance + month.balance cumulative_balance = cumulative_balance + month.balance
month.cumulative_balance = cumulative_balance month.cumulative_balance = cumulative_balance
months.append(MonthlySummary( months.append(MonthlySummary(
label=pgettext("Accounting|", "Total"), label=_("Total"),
credit=sum([x.credit for x in months]), credit=sum([x.credit for x in months]),
debit=sum([x.debit for x in months]), debit=sum([x.debit for x in months]),
balance=sum([x.balance for x in months]), balance=sum([x.balance for x in months]),
@ -319,7 +319,7 @@ def ledger(request, account, period):
record_brought_forward = Record( record_brought_forward = Record(
transaction=Transaction(date=period.start), transaction=Transaction(date=period.start),
account=account, account=account,
summary=pgettext("Accounting|", "Brought Forward"), summary=_("Brought Forward"),
is_credit=balance < 0, is_credit=balance < 0,
amount=abs(balance), amount=abs(balance),
) )
@ -396,7 +396,7 @@ def ledger_summary(request, account):
cumulative_balance = cumulative_balance + month.balance cumulative_balance = cumulative_balance + month.balance
month.cumulative_balance = cumulative_balance month.cumulative_balance = cumulative_balance
months.append(MonthlySummary( months.append(MonthlySummary(
label=pgettext("Accounting|", "Total"), label=_("Total"),
credit=sum([x.credit for x in months]), credit=sum([x.credit for x in months]),
debit=sum([x.debit for x in months]), debit=sum([x.debit for x in months]),
balance=sum([x.balance for x in months]), balance=sum([x.balance for x in months]),
@ -591,7 +591,7 @@ def trial_balance(request, period):
accounts = nominal + real accounts = nominal + real
accounts.sort(key=lambda x: x.code) accounts.sort(key=lambda x: x.code)
total_account = Account() total_account = Account()
total_account.title = pgettext("Accounting|", "Total") total_account.title = _("Total")
total_account.debit_amount = sum([x.debit_amount for x in accounts total_account.debit_amount = sum([x.debit_amount for x in accounts
if x.debit_amount is not None]) if x.debit_amount is not None])
total_account.credit_amount = sum([x.credit_amount for x in accounts total_account.credit_amount = sum([x.credit_amount for x in accounts
@ -649,10 +649,10 @@ def income_statement(request, period):
Q(code="4") | Q(code="5") | Q(code="6") Q(code="4") | Q(code="5") | Q(code="6")
| Q(code="7") | Q(code="8") | Q(code="9")).order_by("code")) | Q(code="7") | Q(code="8") | Q(code="9")).order_by("code"))
cumulative_accounts = { cumulative_accounts = {
"5": Account(title=pgettext("Accounting|", "Gross Income")), "5": Account(title=_("Gross Income")),
"6": Account(title=pgettext("Accounting|", "Operating Income")), "6": Account(title=_("Operating Income")),
"7": Account(title=pgettext("Accounting|", "Before Tax Income")), "7": Account(title=_("Before Tax Income")),
"8": Account(title=pgettext("Accounting|", "After Tax Income")), "8": Account(title=_("After Tax Income")),
"9": Account.objects.get(code=Account.NET_CHANGE), "9": Account.objects.get(code=Account.NET_CHANGE),
} }
cumulative_total = 0 cumulative_total = 0
@ -1011,13 +1011,12 @@ def account_options(request):
x.is_for_debit = re.match("^([1235689]|7[5678])", x.code) is not None x.is_for_debit = re.match("^([1235689]|7[5678])", x.code) is not None
x.is_for_credit = re.match("^([123489]|7[1234])", x.code) is not None x.is_for_credit = re.match("^([123489]|7[1234])", x.code) is not None
data = { data = {
"header_in_use": pgettext("Accounting|", "---Accounts In Use---"), "header_in_use": _("---Accounts In Use---"),
"debit_in_use": [x.option_data for x in accounts "debit_in_use": [x.option_data for x in accounts
if x.is_for_debit and x.is_in_use], if x.is_for_debit and x.is_in_use],
"credit_in_use": [x.option_data for x in accounts "credit_in_use": [x.option_data for x in accounts
if x.is_for_credit and x.is_in_use], if x.is_for_credit and x.is_in_use],
"header_not_in_use": pgettext( "header_not_in_use": _("---Accounts Not In Use---"),
"Accounting|", "---Accounts Not In Use---"),
"debit_not_in_use": [x.option_data for x in accounts "debit_not_in_use": [x.option_data for x in accounts
if x.is_for_debit and not x.is_in_use], if x.is_for_debit and not x.is_in_use],
"credit_not_in_use": [x.option_data for x in accounts "credit_not_in_use": [x.option_data for x in accounts

View File

@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: mia 1.0\n" "Project-Id-Version: mia 1.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-06 00:00+0800\n" "POT-Creation-Date: 2020-08-06 00:39+0800\n"
"PO-Revision-Date: 2020-08-05 23:59+0800\n" "PO-Revision-Date: 2020-08-06 00:40+0800\n"
"Last-Translator: imacat <imacat@mail.imacat.idv.tw>\n" "Last-Translator: imacat <imacat@mail.imacat.idv.tw>\n"
"Language-Team: Traditional Chinese <imacat@mail.imacat.idv.tw>\n" "Language-Team: Traditional Chinese <imacat@mail.imacat.idv.tw>\n"
"Language: Traditional Chinese\n" "Language: Traditional Chinese\n"