{% load markdown %} {% load i18n %} {# With "Combine transfers" on, a transfer is shown once: its "from" side with the "to" side alongside #} {% with transaction=transaction.display_transaction transfer_to=transaction.transfer_to is_transfer=transaction.shown_as_transfer %}
{% if not disable_selection or not dummy %} {% endif %}
{% if not transaction.deleted %} {% if transaction.is_paid %}{% else %}{% endif %} {% else %}
{% if transaction.is_paid %}{% else %}{% endif %}
{% endif %}
{# Date#}
{{ transaction.date|date:"SHORT_DATE_FORMAT" }} • {{ transaction.reference_date|date:"b/Y" }}
{# Description#}
{% spaceless %} {% if is_transfer %} {% endif %} {{ transaction.description }} {% if transaction.installment_plan and transaction.installment_id %} {{ transaction.installment_id }}/{{ transaction.installment_plan.installment_total_number }} {% endif %} {% if transaction.linked_transaction_id and not is_transfer %} {% endif %} {% if transaction.recurring_transaction %} {% endif %} {% if transaction.dca_expense_entries.all or transaction.dca_income_entries.all %} {% trans 'DCA' %} {% endif %} {% endspaceless %}
{# Entities #} {% comment %} First, check for the highest priority: a valid 'overriden_entities' list. {% endcomment %} {% if overriden_entities %}
{{ overriden_entities|join:", " }}
{% elif is_transfer %} {% if transaction.entities.all or transfer_to.entities.all %}
{{ transaction.entities.all|join:", "|default:"—" }}
{{ transfer_to.entities.all|join:", "|default:"—" }}
{% endif %} {% comment %} If no override, fall back to transaction entities, but ONLY if the transaction has an ID. {% endcomment %} {% elif transaction.id and transaction.entities.all %}
{{ transaction.entities.all|join:", " }}
{% endif %} {# Notes#} {% if transaction.notes %}
{{ transaction.notes | limited_markdown | linebreaksbr }}
{% endif %} {# Category#} {% if is_transfer %} {# Each side keeps its own category: "from" line, then "to" line with the arrow under the icon #} {% if transaction.category or transfer_to.category %}
{{ transaction.category.name|default:"—" }}
{{ transfer_to.category.name|default:"—" }}
{% endif %} {% elif transaction.category %}
{{ transaction.category.name }}
{% endif %} {# Tags#} {% comment %} First, check for the highest priority: a valid 'overriden_tags' list. {% endcomment %} {% if overriden_tags %}
{{ overriden_tags|join:", " }}
{% elif is_transfer %} {% if transaction.tags.all or transfer_to.tags.all %}
{{ transaction.tags.all|join:", "|default:"—" }}
{{ transfer_to.tags.all|join:", "|default:"—" }}
{% endif %} {% comment %} If no override, fall back to transaction tags, but ONLY if the transaction has an ID. {% endcomment %} {% elif transaction.id and transaction.tags.all %}
{{ transaction.tags.all|join:", " }}
{% endif %}
{% if is_transfer %} {# Each side: amount, with its account below, like a regular item #}
{% if not dummy %} {% with exchanged=transaction.exchanged_amount %} {% if exchanged %} {% endif %} {% endwith %} {% endif %}
{% if transaction.account.group %}{{ transaction.account.group.name }} • {% endif %}{{ transaction.account.name }}
{% if not dummy %} {% with exchanged=transfer_to.exchanged_amount %} {% if exchanged %} {% endif %} {% endwith %} {% endif %}
{% if transfer_to.account.group %}{{ transfer_to.account.group.name }} • {% endif %}{{ transfer_to.account.name }}
{% else %}
{% endif %} {# Exchange Rate#} {% if not dummy and not is_transfer %} {% with exchanged=transaction.exchanged_amount %} {% if exchanged %}
{% endif %} {% endwith %} {% endif %} {% if not is_transfer %}
{% if transaction.account.group %}{{ transaction.account.group.name }} • {% endif %}{{ transaction.account.name }}
{% endif %}
{% if not dummy %} {% endif %}
{% endwith %}