mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-03-30 22:22:11 +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)")
|
||||
YEAR = "year", _("year(s)")
|
||||
|
||||
paused = models.BooleanField(default=False, verbose_name=_("Paused"))
|
||||
account = models.ForeignKey(
|
||||
"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-target="#persistent-generic-offcanvas-left">
|
||||
<i class="fa-solid fa-eye fa-fw"></i></a>
|
||||
{# <a class="text-decoration-none text-info p-1 category-action"#}
|
||||
{# role="button"#}
|
||||
{# data-bs-toggle="tooltip"#}
|
||||
{# data-bs-title="{% translate "Refresh" %}"#}
|
||||
{# hx-get="{% url 'installment_plan_refresh' installment_plan_id=installment_plan.id %}"#}
|
||||
{# hx-target="#generic-offcanvas"#}
|
||||
{# hx-trigger='confirmed'#}
|
||||
{# data-bypass-on-ctrl="true"#}
|
||||
{# data-title="{% translate "Are you sure?" %}"#}
|
||||
{# data-text="{% translate "This will update all transactions associated with this plan and recreate missing ones" %}"#}
|
||||
{# data-confirm-text="{% translate "Yes, refresh it!" %}"#}
|
||||
{# _="install prompt_swal">#}
|
||||
{# <i class="fa-solid fa-arrows-rotate fa-fw"></i></a>#}
|
||||
{% if recurring_transaction.paused %}
|
||||
<a class="text-decoration-none text-info p-1 category-action"
|
||||
role="button"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-title="{% translate "Unpause" %}"
|
||||
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 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="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"
|
||||
role="button"
|
||||
data-bs-toggle="tooltip"
|
||||
|
||||
Reference in New Issue
Block a user