mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-11-30 04:04:15 +01:00
Transfers are still two transactions, now linked to each other:
- shown as one item in lists, with each side's amount, account,
category and tags ("Combine transfers" user setting, on by default)
- date, reference date, paid and mute stay in sync between sides
- edit opens the transfer form; delete, restore, duplicate and bulk
actions act on both sides
- transfers made by the transfer form now trigger rules for each side
Recurring and quick transactions gain a Transfer type, with a "To
account" and optional "To amount", generating linked transfers. A
transfer can be converted into either.
Existing transfers are left as they are, since there is no reliable
way to pair them.
127 lines
6.8 KiB
HTML
127 lines
6.8 KiB
HTML
{% load currency_display %}
|
|
{% load i18n %}
|
|
{% if status == "active" %}
|
|
<div class="show-loading" hx-get="{% url 'active_recurring_transaction_list' %}" hx-trigger="updated from:window" hx-swap="outerHTML">
|
|
{% elif status == 'paused' %}
|
|
<div class="show-loading" hx-get="{% url 'paused_recurring_transaction_list' %}" hx-trigger="updated from:window" hx-swap="outerHTML">
|
|
{% elif status == 'finished' %}
|
|
<div class="show-loading" hx-get="{% url 'finished_recurring_transaction_list' %}" hx-trigger="updated from:window" hx-swap="outerHTML">
|
|
{% endif %}
|
|
{% if recurring_transactions %}
|
|
<c-config.search></c-config.search>
|
|
|
|
<div class="overflow-x-auto">
|
|
<table class="table table-zebra">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col" class="table-col-auto"></th>
|
|
<th scope="col">{% translate 'Name' %}</th>
|
|
<th scope="col">{% translate 'Account' %}</th>
|
|
<th scope="col">{% translate 'Amount' %}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for recurring_transaction in recurring_transactions %}
|
|
<tr class="recurring_transaction">
|
|
<td class="table-col-auto text-center">
|
|
<div class="join" role="group" aria-label="{% translate 'Actions' %}">
|
|
<a class="btn btn-secondary btn-sm join-item"
|
|
role="button"
|
|
data-tippy-content="{% translate "Edit" %}"
|
|
hx-get="{% url 'recurring_transaction_edit' recurring_transaction_id=recurring_transaction.id %}"
|
|
hx-swap="innerHTML"
|
|
hx-target="#generic-offcanvas">
|
|
<i class="fa-solid fa-pencil fa-fw"></i></a>
|
|
<a class="btn btn-secondary btn-sm join-item"
|
|
role="button"
|
|
data-tippy-content="{% translate "Transactions" %}"
|
|
hx-get="{% url 'recurring_transaction_transactions' recurring_transaction_id=recurring_transaction.id %}"
|
|
hx-swap="innerHTML"
|
|
hx-target="#persistent-generic-offcanvas-left">
|
|
<i class="fa-solid fa-eye fa-fw"></i></a>
|
|
{% if status != 'finished' %}
|
|
{% if recurring_transaction.is_paused %}
|
|
<a class="btn btn-secondary btn-sm join-item"
|
|
role="button"
|
|
data-tippy-content="{% translate "Unpause" %}"
|
|
hx-get="{% url 'recurring_transaction_toggle_pause' recurring_transaction_id=recurring_transaction.id %}"
|
|
hx-target="#generic-offcanvas"
|
|
hx-swap="innerHTML"
|
|
hx-trigger='confirmed'
|
|
data-bypass-on-ctrl="true"
|
|
data-title="{% translate "Are you sure?" %}"
|
|
data-text="{% translate "This will start creating new transactions until you pause it" %}"
|
|
data-confirm-text="{% translate "Yes, unpause it!" %}"
|
|
_="install prompt_swal"><i class="fa-solid fa-play fa-fw"></i></a>
|
|
{% else %}
|
|
<a class="btn btn-secondary btn-sm join-item"
|
|
role="button"
|
|
data-tippy-content="{% translate "Pause" %}"
|
|
hx-get="{% url 'recurring_transaction_toggle_pause' recurring_transaction_id=recurring_transaction.id %}"
|
|
hx-target="#generic-offcanvas"
|
|
hx-trigger='confirmed'
|
|
hx-swap="innerHTML"
|
|
data-bypass-on-ctrl="true"
|
|
data-title="{% translate "Are you sure?" %}"
|
|
data-text="{% translate "This will stop the creation of new transactions until you unpause it" %}"
|
|
data-confirm-text="{% translate "Yes, pause it!" %}"
|
|
_="install prompt_swal">
|
|
<i class="fa-solid fa-pause fa-fw"></i></a>
|
|
{% endif %}
|
|
<a class="btn btn-secondary btn-sm join-item"
|
|
role="button"
|
|
data-tippy-content="{% translate "Finish" %}"
|
|
hx-get="{% url 'recurring_transaction_finish' recurring_transaction_id=recurring_transaction.id %}"
|
|
hx-target="#generic-offcanvas"
|
|
hx-trigger='confirmed'
|
|
hx-swap="innerHTML"
|
|
data-bypass-on-ctrl="true"
|
|
data-title="{% translate "Are you sure?" %}"
|
|
data-text="{% translate "This will stop the creation of new transactions and delete any unpaid transactions after today" %}"
|
|
data-confirm-text="{% translate "Yes, finish it!" %}"
|
|
_="install prompt_swal">
|
|
<i class="fa-solid fa-flag-checkered fa-fw"></i></a>
|
|
{% endif %}
|
|
<a class="btn btn-error btn-sm join-item"
|
|
role="button"
|
|
data-tippy-content="{% translate "Delete" %}"
|
|
hx-delete="{% url 'recurring_transaction_delete' recurring_transaction_id=recurring_transaction.id %}"
|
|
hx-trigger='confirmed'
|
|
hx-swap="innerHTML"
|
|
data-bypass-on-ctrl="true"
|
|
data-title="{% translate "Are you sure?" %}"
|
|
data-text="{% translate "This will delete the recurrence and all transactions associated with it" %}"
|
|
data-confirm-text="{% translate "Yes, delete it!" %}"
|
|
_="install prompt_swal"><i class="fa-solid fa-trash fa-fw"></i></a>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<div class="{% if recurring_transaction.type == 'EX' %}text-error{% elif recurring_transaction.type == 'TR' %}text-info{% else %}text-success{% endif %}">
|
|
{{ recurring_transaction.description }}
|
|
</div>
|
|
<div class="text-sm text-base-content/60">{{ recurring_transaction.notes|linebreaksbr }}</div>
|
|
</td>
|
|
<td class="w-auto">
|
|
{% if recurring_transaction.account.group %}{{ recurring_transaction.account.group }} • {% endif %}{{ recurring_transaction.account }}
|
|
{% if recurring_transaction.is_transfer %}
|
|
<div><i class="fa-solid fa-arrow-right fa-fw fa-xs text-base-content/40"></i> {% if recurring_transaction.to_account.group %}{{ recurring_transaction.to_account.group }} • {% endif %}{{ recurring_transaction.to_account }}</div>
|
|
{% endif %}
|
|
</td>
|
|
<td class="w-auto">
|
|
<c-amount.display
|
|
:amount="recurring_transaction.amount"
|
|
:prefix="recurring_transaction.account.currency.prefix"
|
|
:suffix="recurring_transaction.account.currency.suffix"
|
|
:decimal_places="recurring_transaction.account.currency.decimal_places"
|
|
color="{% if recurring_transaction.type == "EX" %}red{% elif recurring_transaction.type == "IN" %}green{% endif %}"></c-amount.display>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<c-msg.empty title="{% translate "No recurring transactions" %}" remove-padding></c-msg.empty>
|
|
{% endif %}
|
|
</div>
|