diff --git a/accounting/models.py b/accounting/models.py index daf340d..6ff2d4e 100644 --- a/accounting/models.py +++ b/accounting/models.py @@ -94,6 +94,13 @@ class Transaction(models.Model): credit_sum = sum([x.amount for x in self.credit_records]) return debit_sum == credit_sum + @property + def has_order_hole(self): + """Whether the order of the transactions on this day is not + 1, 2, 3, 4, 5..., and should be reordered. """ + # TODO: To be done + return False + @property def is_cash_income(self): """Whether this transaction is a cash income transaction.""" diff --git a/accounting/templates/accounting/cash.html b/accounting/templates/accounting/cash.html index 92725f2..9139867 100644 --- a/accounting/templates/accounting/cash.html +++ b/accounting/templates/accounting/cash.html @@ -34,34 +34,80 @@ First written: 2020/7/1
{{ request.resolver_match.app_name }}
{% if records %} -{% trans "Date" context "Accounting|" %} | -{% trans "Subject" context "Accounting|" %} | -{% trans "Summary" context "Accounting|" %} | -{% trans "Income" context "Accounting|" %} | -{% trans "Expense" context "Accounting|" %} | -{% trans "Balance" context "Accounting|" %} | -{% trans "View" context "Accounting|" %} | -
---|
{{ record.transaction.date|smart_date }} | -{{ record.subject.title_zhtw }} | -{{ record.summary }} | -{{ record.credit_amount|default:""|intcomma:False }} | -{{ record.debit_amount|default:""|intcomma:False }} | -{{ record.amount|intcomma:False }} | -{% trans "View" context "Accounting|" %} | +{% trans "Date" context "Accounting|" %} | +{% trans "Subject" context "Accounting|" %} | +{% trans "Summary" context "Accounting|" %} | +{% trans "Income" context "Accounting|" %} | +{% trans "Expense" context "Accounting|" %} | +{% trans "Balance" context "Accounting|" %} | +{% trans "View" context "Accounting|" %} |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{ record.transaction.date|smart_date }} | +{{ record.subject.title_zhtw }} | +{{ record.summary }}{% if not record.transaction.is_balanced %} + + {% trans "Unbalanced" context "Accounting|" %} + + {% endif %}{% if record.transaction.has_order_hole %} + + {% trans "Need Reorder" context "Accounting|" %} + + {% endif %} | +{{ record.credit_amount|default:""|intcomma:False }} | +{{ record.debit_amount|default:""|intcomma:False }} | +{{ record.amount|intcomma:False }} | ++ + + {% trans "View" context "Accounting|" %} + + | +
No data.
+{% trans "There is currently no data." %}
{% endif %} {% endblock %}