{% 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:", " }}
{% 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 and not is_transfer %}
{{ transaction.entities.all|join:", " }}
{% endif %} {# Notes#} {% if transaction.notes and not is_transfer %}
{{ transaction.notes | limited_markdown | linebreaksbr }}
{% endif %} {# Category#} {% if transaction.category and not is_transfer %}
{{ transaction.category.name }}
{% endif %} {# Tags#} {% comment %} First, check for the highest priority: a valid 'overriden_tags' list. {% endcomment %} {% if overriden_tags %}
{{ overriden_tags|join:", " }}
{% 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 and not is_transfer %}
{{ transaction.tags.all|join:", " }}
{% endif %}
{% if is_transfer %} {# ps-5 leaves room for the timeline rail that drops from the transfer icon (see _transfer_leg) #}
{% translate 'From' as from_label %}{% translate 'To' as to_label %} {% include "cotton/transaction/_transfer_leg.html" with leg=transaction color="red" icon="fa-arrow-right-from-bracket" label=from_label first=True %} {% include "cotton/transaction/_transfer_leg.html" with leg=transfer_to color="green" icon="fa-arrow-right-to-bracket" label=to_label first=False %}
{# Notes go below the legs so they don't sit in the rail's path #} {% if transaction.notes %}
{{ transaction.notes | limited_markdown | linebreaksbr }}
{% endif %} {% endif %}
{% if not is_transfer %}
{# Exchange Rate#} {% if not dummy %} {% with exchanged=transaction.displayed_exchanged_amount %} {% if exchanged %}
{% endif %} {% endwith %} {% endif %}
{% if transaction.account.group %}{{ transaction.account.group.name }} • {% endif %}{{ transaction.account.name }}
{% endif %} {% if not dummy %} {% endif %}
{% endwith %}