mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-13 08:12:51 +02:00
feat: add paused status to RecurringTransaction
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 5.1.2 on 2024-10-18 21:45
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('transactions', '0018_recurringtransaction_last_generated_reference_date'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='recurringtransaction',
|
||||||
|
name='paused',
|
||||||
|
field=models.BooleanField(default=False, verbose_name='Paused'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -316,6 +316,7 @@ class RecurringTransaction(models.Model):
|
|||||||
MONTH = "month", _("month(s)")
|
MONTH = "month", _("month(s)")
|
||||||
YEAR = "year", _("year(s)")
|
YEAR = "year", _("year(s)")
|
||||||
|
|
||||||
|
paused = models.BooleanField(default=False, verbose_name=_("Paused"))
|
||||||
account = models.ForeignKey(
|
account = models.ForeignKey(
|
||||||
"accounts.Account", on_delete=models.CASCADE, verbose_name=_("Account")
|
"accounts.Account", on_delete=models.CASCADE, verbose_name=_("Account")
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -41,19 +41,34 @@
|
|||||||
hx-get="{% url 'recurring_transaction_transactions' recurring_transaction_id=recurring_transaction.id %}"
|
hx-get="{% url 'recurring_transaction_transactions' recurring_transaction_id=recurring_transaction.id %}"
|
||||||
hx-target="#persistent-generic-offcanvas-left">
|
hx-target="#persistent-generic-offcanvas-left">
|
||||||
<i class="fa-solid fa-eye fa-fw"></i></a>
|
<i class="fa-solid fa-eye fa-fw"></i></a>
|
||||||
{# <a class="text-decoration-none text-info p-1 category-action"#}
|
{% if recurring_transaction.paused %}
|
||||||
{# role="button"#}
|
<a class="text-decoration-none text-info p-1 category-action"
|
||||||
{# data-bs-toggle="tooltip"#}
|
role="button"
|
||||||
{# data-bs-title="{% translate "Refresh" %}"#}
|
data-bs-toggle="tooltip"
|
||||||
{# hx-get="{% url 'installment_plan_refresh' installment_plan_id=installment_plan.id %}"#}
|
data-bs-title="{% translate "Unpause" %}"
|
||||||
{# hx-target="#generic-offcanvas"#}
|
hx-get="{% url 'recurring_transaction_toggle_pause' recurring_transaction_id=recurring_transaction.id %}"
|
||||||
{# hx-trigger='confirmed'#}
|
hx-target="#generic-offcanvas"
|
||||||
{# data-bypass-on-ctrl="true"#}
|
hx-trigger='confirmed'
|
||||||
{# data-title="{% translate "Are you sure?" %}"#}
|
data-bypass-on-ctrl="true"
|
||||||
{# data-text="{% translate "This will update all transactions associated with this plan and recreate missing ones" %}"#}
|
data-title="{% translate "Are you sure?" %}"
|
||||||
{# data-confirm-text="{% translate "Yes, refresh it!" %}"#}
|
data-text="{% translate "This will start creating new transactions until you pause it" %}"
|
||||||
{# _="install prompt_swal">#}
|
data-confirm-text="{% translate "Yes, unpause it!" %}"
|
||||||
{# <i class="fa-solid fa-arrows-rotate fa-fw"></i></a>#}
|
_="install prompt_swal"><i class="fa-solid fa-play fa-fw"></i></a>
|
||||||
|
{% else %}
|
||||||
|
<a class="text-decoration-none text-info p-1 category-action"
|
||||||
|
role="button"
|
||||||
|
data-bs-toggle="tooltip"
|
||||||
|
data-bs-title="{% translate "Pause" %}"
|
||||||
|
hx-get="{% url 'recurring_transaction_toggle_pause' recurring_transaction_id=recurring_transaction.id %}"
|
||||||
|
hx-target="#generic-offcanvas"
|
||||||
|
hx-trigger='confirmed'
|
||||||
|
data-bypass-on-ctrl="true"
|
||||||
|
data-title="{% translate "Are you sure?" %}"
|
||||||
|
data-text="{% translate "This will stop the creation of new transactions until you pause it" %}"
|
||||||
|
data-confirm-text="{% translate "Yes, pause it!" %}"
|
||||||
|
_="install prompt_swal">
|
||||||
|
<i class="fa-solid fa-pause fa-fw"></i></a>
|
||||||
|
{% endif %}
|
||||||
<a class="text-danger text-decoration-none p-1 category-action"
|
<a class="text-danger text-decoration-none p-1 category-action"
|
||||||
role="button"
|
role="button"
|
||||||
data-bs-toggle="tooltip"
|
data-bs-toggle="tooltip"
|
||||||
|
|||||||
Reference in New Issue
Block a user