From 97465c07fe8a17ed58f49685f9796fa60b67de36 Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Fri, 24 Jan 2025 16:06:47 -0300 Subject: [PATCH 01/17] fix: import preset not working behind nginx due to long url/csrf missing --- app/apps/accounts/views/account_groups.py | 3 --- app/apps/accounts/views/accounts.py | 3 --- app/apps/currencies/views/currencies.py | 3 --- app/apps/currencies/views/exchange_rates.py | 4 +--- app/apps/dca/views.py | 5 +---- app/apps/import_app/views.py | 17 +++++++---------- app/apps/rules/views.py | 3 --- app/apps/transactions/views/categories.py | 3 --- app/apps/transactions/views/entities.py | 2 -- .../transactions/views/installment_plans.py | 2 -- .../views/recurring_transactions.py | 3 --- app/apps/transactions/views/tags.py | 2 -- app/apps/transactions/views/transactions.py | 2 -- .../fragments/profiles/list_presets.html | 2 +- app/templates/layouts/base.html | 3 ++- 15 files changed, 12 insertions(+), 45 deletions(-) diff --git a/app/apps/accounts/views/account_groups.py b/app/apps/accounts/views/account_groups.py index c7089b3..2c0f70c 100644 --- a/app/apps/accounts/views/account_groups.py +++ b/app/apps/accounts/views/account_groups.py @@ -2,9 +2,7 @@ from django.contrib import messages from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.shortcuts import render, get_object_or_404 -from django.urls import reverse from django.utils.translation import gettext_lazy as _ -from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_http_methods from apps.accounts.forms import AccountGroupForm @@ -89,7 +87,6 @@ def account_group_edit(request, pk): @only_htmx @login_required -@csrf_exempt @require_http_methods(["DELETE"]) def account_group_delete(request, pk): account_group = get_object_or_404(AccountGroup, id=pk) diff --git a/app/apps/accounts/views/accounts.py b/app/apps/accounts/views/accounts.py index 922bc78..a6bffa2 100644 --- a/app/apps/accounts/views/accounts.py +++ b/app/apps/accounts/views/accounts.py @@ -2,9 +2,7 @@ from django.contrib import messages from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.shortcuts import render, get_object_or_404 -from django.urls import reverse from django.utils.translation import gettext_lazy as _ -from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_http_methods from apps.accounts.forms import AccountForm @@ -89,7 +87,6 @@ def account_edit(request, pk): @only_htmx @login_required -@csrf_exempt @require_http_methods(["DELETE"]) def account_delete(request, pk): account = get_object_or_404(Account, id=pk) diff --git a/app/apps/currencies/views/currencies.py b/app/apps/currencies/views/currencies.py index 81d9ae7..1fa431a 100644 --- a/app/apps/currencies/views/currencies.py +++ b/app/apps/currencies/views/currencies.py @@ -2,9 +2,7 @@ from django.contrib import messages from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.shortcuts import render, get_object_or_404 -from django.urls import reverse from django.utils.translation import gettext_lazy as _ -from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_http_methods from apps.common.decorators.htmx import only_htmx @@ -89,7 +87,6 @@ def currency_edit(request, pk): @only_htmx @login_required -@csrf_exempt @require_http_methods(["DELETE"]) def currency_delete(request, pk): currency = get_object_or_404(Currency, id=pk) diff --git a/app/apps/currencies/views/exchange_rates.py b/app/apps/currencies/views/exchange_rates.py index 46ef4a2..f7e9ed4 100644 --- a/app/apps/currencies/views/exchange_rates.py +++ b/app/apps/currencies/views/exchange_rates.py @@ -1,12 +1,11 @@ from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator -from django.db.models import F, CharField, Value +from django.db.models import CharField, Value from django.db.models.functions import Concat from django.http import HttpResponse from django.shortcuts import render, get_object_or_404 from django.utils.translation import gettext_lazy as _ -from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_http_methods from apps.common.decorators.htmx import only_htmx @@ -135,7 +134,6 @@ def exchange_rate_edit(request, pk): @only_htmx @login_required -@csrf_exempt @require_http_methods(["DELETE"]) def exchange_rate_delete(request, pk): exchange_rate = get_object_or_404(ExchangeRate, id=pk) diff --git a/app/apps/dca/views.py b/app/apps/dca/views.py index 045167f..547b9ef 100644 --- a/app/apps/dca/views.py +++ b/app/apps/dca/views.py @@ -6,12 +6,11 @@ from django.db.models.functions import TruncMonth from django.http import HttpResponse from django.shortcuts import render, get_object_or_404 from django.utils.translation import gettext_lazy as _ -from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_http_methods from apps.common.decorators.htmx import only_htmx -from apps.dca.models import DCAStrategy, DCAEntry from apps.dca.forms import DCAEntryForm, DCAStrategyForm +from apps.dca.models import DCAStrategy, DCAEntry @login_required @@ -82,7 +81,6 @@ def strategy_edit(request, strategy_id): @only_htmx @login_required -@csrf_exempt @require_http_methods(["DELETE"]) def strategy_delete(request, strategy_id): dca_strategy = get_object_or_404(DCAStrategy, id=strategy_id) @@ -209,7 +207,6 @@ def strategy_entry_edit(request, strategy_id, entry_id): @only_htmx @login_required -@csrf_exempt @require_http_methods(["DELETE"]) def strategy_entry_delete(request, entry_id, strategy_id): dca_entry = get_object_or_404(DCAEntry, id=entry_id, strategy__id=strategy_id) diff --git a/app/apps/import_app/views.py b/app/apps/import_app/views.py index 1069eca..434a75b 100644 --- a/app/apps/import_app/views.py +++ b/app/apps/import_app/views.py @@ -5,15 +5,14 @@ from django.contrib.auth.decorators import login_required from django.core.files.storage import FileSystemStorage from django.http import HttpResponse from django.shortcuts import render, get_object_or_404 -from django.views.decorators.csrf import csrf_exempt -from django.views.decorators.http import require_http_methods from django.utils.translation import gettext_lazy as _ +from django.views.decorators.http import require_http_methods from apps.common.decorators.htmx import only_htmx from apps.import_app.forms import ImportRunFileUploadForm, ImportProfileForm from apps.import_app.models import ImportRun, ImportProfile -from apps.import_app.tasks import process_import from apps.import_app.services import PresetService +from apps.import_app.tasks import process_import def import_view(request): @@ -66,9 +65,9 @@ def import_profile_list(request): @login_required @require_http_methods(["GET", "POST"]) def import_profile_add(request): - message = request.GET.get("message", None) or request.POST.get("message", None) + message = request.POST.get("message", None) - if request.method == "POST": + if request.method == "POST" and request.POST.get("submit"): form = ImportProfileForm(request.POST) if form.is_valid(): @@ -84,9 +83,9 @@ def import_profile_add(request): else: form = ImportProfileForm( initial={ - "name": request.GET.get("name"), - "version": int(request.GET.get("version", 1)), - "yaml_config": request.GET.get("yaml_config"), + "name": request.POST.get("name"), + "version": int(request.POST.get("version", 1)), + "yaml_config": request.POST.get("yaml_config"), } ) @@ -128,7 +127,6 @@ def import_profile_edit(request, profile_id): @only_htmx @login_required -@csrf_exempt @require_http_methods(["DELETE"]) def import_profile_delete(request, profile_id): profile = ImportProfile.objects.get(id=profile_id) @@ -213,7 +211,6 @@ def import_run_add(request, profile_id): @only_htmx @login_required -@csrf_exempt @require_http_methods(["DELETE"]) def import_run_delete(request, profile_id, run_id): run = ImportRun.objects.get(profile__id=profile_id, id=run_id) diff --git a/app/apps/rules/views.py b/app/apps/rules/views.py index 0ea1fd9..0d87d8c 100644 --- a/app/apps/rules/views.py +++ b/app/apps/rules/views.py @@ -3,7 +3,6 @@ from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.shortcuts import render, get_object_or_404, redirect from django.utils.translation import gettext_lazy as _ -from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_http_methods from apps.common.decorators.htmx import only_htmx @@ -118,7 +117,6 @@ def transaction_rule_view(request, transaction_rule_id): @only_htmx @login_required -@csrf_exempt @require_http_methods(["DELETE"]) def transaction_rule_delete(request, transaction_rule_id): transaction_rule = get_object_or_404(TransactionRule, id=transaction_rule_id) @@ -201,7 +199,6 @@ def transaction_rule_action_edit(request, transaction_rule_action_id): @only_htmx @login_required -@csrf_exempt @require_http_methods(["DELETE"]) def transaction_rule_action_delete(request, transaction_rule_action_id): transaction_rule_action = get_object_or_404( diff --git a/app/apps/transactions/views/categories.py b/app/apps/transactions/views/categories.py index 1f6fea5..a2779c8 100644 --- a/app/apps/transactions/views/categories.py +++ b/app/apps/transactions/views/categories.py @@ -2,9 +2,7 @@ from django.contrib import messages from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.shortcuts import render, get_object_or_404 -from django.urls import reverse from django.utils.translation import gettext_lazy as _ -from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_http_methods from apps.common.decorators.htmx import only_htmx @@ -111,7 +109,6 @@ def category_edit(request, category_id): @only_htmx @login_required -@csrf_exempt @require_http_methods(["DELETE"]) def category_delete(request, category_id): category = get_object_or_404(TransactionCategory, id=category_id) diff --git a/app/apps/transactions/views/entities.py b/app/apps/transactions/views/entities.py index 8252642..1104941 100644 --- a/app/apps/transactions/views/entities.py +++ b/app/apps/transactions/views/entities.py @@ -3,7 +3,6 @@ from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.shortcuts import render, get_object_or_404 from django.utils.translation import gettext_lazy as _ -from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_http_methods from apps.common.decorators.htmx import only_htmx @@ -110,7 +109,6 @@ def entity_edit(request, entity_id): @only_htmx @login_required -@csrf_exempt @require_http_methods(["DELETE"]) def entity_delete(request, entity_id): entity = get_object_or_404(TransactionEntity, id=entity_id) diff --git a/app/apps/transactions/views/installment_plans.py b/app/apps/transactions/views/installment_plans.py index 6c330ec..c437a05 100644 --- a/app/apps/transactions/views/installment_plans.py +++ b/app/apps/transactions/views/installment_plans.py @@ -4,7 +4,6 @@ from django.http import HttpResponse from django.shortcuts import render, get_object_or_404 from django.utils import timezone from django.utils.translation import gettext_lazy as _ -from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_http_methods from apps.common.decorators.htmx import only_htmx @@ -152,7 +151,6 @@ def installment_plan_refresh(request, installment_plan_id): @only_htmx @login_required -@csrf_exempt @require_http_methods(["DELETE"]) def installment_plan_delete(request, installment_plan_id): installment_plan = get_object_or_404(InstallmentPlan, id=installment_plan_id) diff --git a/app/apps/transactions/views/recurring_transactions.py b/app/apps/transactions/views/recurring_transactions.py index 6b7f9e9..7b59fe3 100644 --- a/app/apps/transactions/views/recurring_transactions.py +++ b/app/apps/transactions/views/recurring_transactions.py @@ -1,5 +1,4 @@ from dateutil.relativedelta import relativedelta - from django.contrib import messages from django.contrib.auth.decorators import login_required from django.db.models import Q @@ -7,7 +6,6 @@ from django.http import HttpResponse from django.shortcuts import render, get_object_or_404 from django.utils import timezone from django.utils.translation import gettext_lazy as _ -from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_http_methods from apps.common.decorators.htmx import only_htmx @@ -230,7 +228,6 @@ def recurring_transaction_finish(request, recurring_transaction_id): @only_htmx @login_required -@csrf_exempt @require_http_methods(["DELETE"]) def recurring_transaction_delete(request, recurring_transaction_id): recurring_transaction = get_object_or_404( diff --git a/app/apps/transactions/views/tags.py b/app/apps/transactions/views/tags.py index fdc66da..0157641 100644 --- a/app/apps/transactions/views/tags.py +++ b/app/apps/transactions/views/tags.py @@ -3,7 +3,6 @@ from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.shortcuts import render, get_object_or_404 from django.utils.translation import gettext_lazy as _ -from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_http_methods from apps.common.decorators.htmx import only_htmx @@ -110,7 +109,6 @@ def tag_edit(request, tag_id): @only_htmx @login_required -@csrf_exempt @require_http_methods(["DELETE"]) def tag_delete(request, tag_id): tag = get_object_or_404(TransactionTag, id=tag_id) diff --git a/app/apps/transactions/views/transactions.py b/app/apps/transactions/views/transactions.py index 1869064..d6c3b83 100644 --- a/app/apps/transactions/views/transactions.py +++ b/app/apps/transactions/views/transactions.py @@ -8,7 +8,6 @@ from django.http import HttpResponse from django.shortcuts import render, get_object_or_404 from django.utils import timezone from django.utils.translation import gettext_lazy as _ -from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_http_methods from apps.common.decorators.htmx import only_htmx @@ -143,7 +142,6 @@ def transaction_clone(request, transaction_id, **kwargs): @only_htmx @login_required -@csrf_exempt @require_http_methods(["DELETE"]) def transaction_delete(request, transaction_id, **kwargs): transaction = get_object_or_404(Transaction, id=transaction_id) diff --git a/app/templates/import_app/fragments/profiles/list_presets.html b/app/templates/import_app/fragments/profiles/list_presets.html index 0b64342..ba22a00 100644 --- a/app/templates/import_app/fragments/profiles/list_presets.html +++ b/app/templates/import_app/fragments/profiles/list_presets.html @@ -20,7 +20,7 @@ {% for preset in presets %} diff --git a/app/templates/layouts/base.html b/app/templates/layouts/base.html index 6545aa9..90f0384 100644 --- a/app/templates/layouts/base.html +++ b/app/templates/layouts/base.html @@ -28,7 +28,8 @@
+ {% block body_hyperscript %}{% endblock %}" + hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'> {% include 'includes/navbar.html' %}
From b9cd97f0b80e01f508bc823e4340a6e6772b2ce3 Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Fri, 24 Jan 2025 16:30:31 -0300 Subject: [PATCH 02/17] locale: update translations and remove dutch from available languages until translation is done --- app/WYGIWYH/settings.py | 2 +- app/apps/import_app/models.py | 6 +- .../0015_alter_usersettings_language.py | 18 + app/locale/nl/LC_MESSAGES/django.po | 458 +++++++++++------ app/locale/pt_BR/LC_MESSAGES/django.po | 475 ++++++++++++------ .../import_app/fragments/runs/list.html | 2 +- .../import_app/pages/runs_index.html | 8 - 7 files changed, 665 insertions(+), 304 deletions(-) create mode 100644 app/apps/users/migrations/0015_alter_usersettings_language.py delete mode 100644 app/templates/import_app/pages/runs_index.html diff --git a/app/WYGIWYH/settings.py b/app/WYGIWYH/settings.py index 9b0c7a8..6875bc0 100644 --- a/app/WYGIWYH/settings.py +++ b/app/WYGIWYH/settings.py @@ -163,7 +163,7 @@ AUTH_USER_MODEL = "users.User" LANGUAGE_CODE = "en" LANGUAGES = ( ("en", "English"), - ("nl", "Nederlands"), + # ("nl", "Nederlands"), ("pt-br", "Português (Brasil)"), ) diff --git a/app/apps/import_app/models.py b/app/apps/import_app/models.py index 170b431..3eb739d 100644 --- a/app/apps/import_app/models.py +++ b/app/apps/import_app/models.py @@ -9,7 +9,7 @@ from apps.import_app.schemas import version_1 class ImportProfile(models.Model): class Versions(models.IntegerChoices): - VERSION_1 = 1, _("Version") + " 1" + VERSION_1 = 1, "Version 1" name = models.CharField(max_length=100, verbose_name=_("Name"), unique=True) yaml_config = models.TextField(verbose_name=_("YAML Configuration")) @@ -25,6 +25,10 @@ class ImportProfile(models.Model): class Meta: ordering = ["name"] + def get_version_display(self): + version_number = self.Versions(self.version).name.split("_")[1] + return _("Version {number}").format(number=version_number) + def clean(self): if self.version and self.version == self.Versions.VERSION_1: try: diff --git a/app/apps/users/migrations/0015_alter_usersettings_language.py b/app/apps/users/migrations/0015_alter_usersettings_language.py new file mode 100644 index 0000000..8eb375a --- /dev/null +++ b/app/apps/users/migrations/0015_alter_usersettings_language.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.5 on 2025-01-24 19:29 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0014_alter_usersettings_date_format_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='usersettings', + name='language', + field=models.CharField(choices=[('auto', 'Auto'), ('en', 'English'), ('pt-br', 'Português (Brasil)')], default='auto', max_length=10, verbose_name='Language'), + ), + ] diff --git a/app/locale/nl/LC_MESSAGES/django.po b/app/locale/nl/LC_MESSAGES/django.po index 20689bd..81c841e 100644 --- a/app/locale/nl/LC_MESSAGES/django.po +++ b/app/locale/nl/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-01-22 13:17+0000\n" +"POT-Creation-Date: 2025-01-24 19:24+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -24,20 +24,21 @@ msgstr "" #: apps/accounts/forms.py:40 apps/accounts/forms.py:96 #: apps/currencies/forms.py:52 apps/currencies/forms.py:92 apps/dca/forms.py:41 -#: apps/dca/forms.py:93 apps/rules/forms.py:45 apps/rules/forms.py:87 -#: apps/transactions/forms.py:150 apps/transactions/forms.py:506 -#: apps/transactions/forms.py:549 apps/transactions/forms.py:581 -#: apps/transactions/forms.py:616 apps/transactions/forms.py:754 +#: apps/dca/forms.py:93 apps/import_app/forms.py:34 apps/rules/forms.py:45 +#: apps/rules/forms.py:87 apps/transactions/forms.py:150 +#: apps/transactions/forms.py:506 apps/transactions/forms.py:549 +#: apps/transactions/forms.py:581 apps/transactions/forms.py:616 +#: apps/transactions/forms.py:754 msgid "Update" msgstr "" #: apps/accounts/forms.py:48 apps/accounts/forms.py:104 #: apps/common/widgets/tom_select.py:12 apps/currencies/forms.py:60 #: apps/currencies/forms.py:100 apps/dca/forms.py:49 apps/dca/forms.py:102 -#: apps/rules/forms.py:53 apps/rules/forms.py:95 apps/transactions/forms.py:159 -#: apps/transactions/forms.py:514 apps/transactions/forms.py:557 -#: apps/transactions/forms.py:589 apps/transactions/forms.py:624 -#: apps/transactions/forms.py:762 +#: apps/import_app/forms.py:42 apps/rules/forms.py:53 apps/rules/forms.py:95 +#: apps/transactions/forms.py:159 apps/transactions/forms.py:514 +#: apps/transactions/forms.py:557 apps/transactions/forms.py:589 +#: apps/transactions/forms.py:624 apps/transactions/forms.py:762 #: templates/account_groups/fragments/list.html:9 #: templates/accounts/fragments/list.html:9 #: templates/categories/fragments/list.html:9 @@ -46,7 +47,8 @@ msgstr "" #: templates/dca/fragments/strategy/list.html:9 #: templates/entities/fragments/list.html:9 #: templates/exchange_rates/fragments/list.html:10 -#: templates/import_app/fragments/list.html:9 +#: templates/import_app/fragments/profiles/list.html:7 +#: templates/import_app/fragments/profiles/list.html:10 #: templates/installment_plans/fragments/list.html:9 #: templates/mini_tools/unit_price_calculator.html:162 #: templates/recurring_transactions/fragments/list.html:9 @@ -55,7 +57,6 @@ msgid "Add" msgstr "" #: apps/accounts/forms.py:57 templates/accounts/fragments/list.html:26 -#: templates/import_app/fragments/list.html:26 msgid "Group" msgstr "" @@ -66,8 +67,8 @@ msgstr "" #: apps/accounts/forms.py:119 apps/rules/models.py:27 #: apps/transactions/forms.py:39 apps/transactions/forms.py:214 #: apps/transactions/forms.py:221 apps/transactions/forms.py:401 -#: apps/transactions/forms.py:648 apps/transactions/models.py:111 -#: apps/transactions/models.py:230 apps/transactions/models.py:410 +#: apps/transactions/forms.py:648 apps/transactions/models.py:159 +#: apps/transactions/models.py:311 apps/transactions/models.py:491 msgid "Category" msgstr "" @@ -75,21 +76,22 @@ msgstr "" #: apps/transactions/filters.py:74 apps/transactions/forms.py:47 #: apps/transactions/forms.py:230 apps/transactions/forms.py:238 #: apps/transactions/forms.py:394 apps/transactions/forms.py:641 -#: apps/transactions/models.py:117 apps/transactions/models.py:232 -#: apps/transactions/models.py:414 templates/includes/navbar.html:98 +#: apps/transactions/models.py:165 apps/transactions/models.py:313 +#: apps/transactions/models.py:495 templates/includes/navbar.html:98 #: templates/tags/fragments/list.html:5 templates/tags/pages/index.html:4 msgid "Tags" msgstr "" #: apps/accounts/models.py:9 apps/accounts/models.py:21 apps/dca/models.py:14 -#: apps/rules/models.py:9 apps/transactions/models.py:19 -#: apps/transactions/models.py:39 apps/transactions/models.py:58 +#: apps/import_app/models.py:14 apps/rules/models.py:9 +#: apps/transactions/models.py:67 apps/transactions/models.py:87 +#: apps/transactions/models.py:106 #: templates/account_groups/fragments/list.html:25 #: templates/accounts/fragments/list.html:25 #: templates/categories/fragments/table.html:16 #: templates/currencies/fragments/list.html:26 #: templates/entities/fragments/table.html:16 -#: templates/import_app/fragments/list.html:25 +#: templates/import_app/fragments/profiles/list.html:36 #: templates/installment_plans/fragments/table.html:16 #: templates/recurring_transactions/fragments/table.html:18 #: templates/rules/fragments/list.html:26 @@ -109,13 +111,11 @@ msgstr "" #: apps/accounts/models.py:31 apps/currencies/models.py:32 #: templates/accounts/fragments/list.html:27 -#: templates/import_app/fragments/list.html:27 msgid "Currency" msgstr "" #: apps/accounts/models.py:37 apps/currencies/models.py:20 #: templates/accounts/fragments/list.html:28 -#: templates/import_app/fragments/list.html:28 msgid "Exchange Currency" msgstr "" @@ -135,7 +135,6 @@ msgstr "" #: apps/accounts/models.py:54 templates/accounts/fragments/list.html:30 #: templates/categories/fragments/list.html:24 #: templates/entities/fragments/list.html:24 -#: templates/import_app/fragments/list.html:30 #: templates/tags/fragments/list.html:24 msgid "Archived" msgstr "" @@ -146,16 +145,15 @@ msgstr "" #: apps/accounts/models.py:59 apps/rules/models.py:19 #: apps/transactions/forms.py:59 apps/transactions/forms.py:386 -#: apps/transactions/forms.py:633 apps/transactions/models.py:84 -#: apps/transactions/models.py:190 apps/transactions/models.py:392 +#: apps/transactions/forms.py:633 apps/transactions/models.py:132 +#: apps/transactions/models.py:271 apps/transactions/models.py:473 msgid "Account" msgstr "" #: apps/accounts/models.py:60 apps/transactions/filters.py:53 #: templates/accounts/fragments/list.html:5 -#: templates/accounts/pages/index.html:4 -#: templates/import_app/fragments/list.html:5 -#: templates/includes/navbar.html:104 templates/includes/navbar.html:106 +#: templates/accounts/pages/index.html:4 templates/includes/navbar.html:104 +#: templates/includes/navbar.html:106 #: templates/transactions/fragments/summary.html:9 msgid "Accounts" msgstr "" @@ -164,27 +162,27 @@ msgstr "" msgid "Exchange currency cannot be the same as the account's main currency." msgstr "" -#: apps/accounts/views/account_groups.py:44 +#: apps/accounts/views/account_groups.py:42 msgid "Account Group added successfully" msgstr "" -#: apps/accounts/views/account_groups.py:72 +#: apps/accounts/views/account_groups.py:70 msgid "Account Group updated successfully" msgstr "" -#: apps/accounts/views/account_groups.py:99 +#: apps/accounts/views/account_groups.py:96 msgid "Account Group deleted successfully" msgstr "" -#: apps/accounts/views/accounts.py:44 +#: apps/accounts/views/accounts.py:42 msgid "Account added successfully" msgstr "" -#: apps/accounts/views/accounts.py:72 +#: apps/accounts/views/accounts.py:70 msgid "Account updated successfully" msgstr "" -#: apps/accounts/views/accounts.py:99 +#: apps/accounts/views/accounts.py:96 msgid "Account deleted successfully" msgstr "" @@ -349,7 +347,7 @@ msgstr "" #: apps/currencies/forms.py:68 apps/dca/models.py:156 apps/rules/models.py:22 #: apps/transactions/forms.py:63 apps/transactions/forms.py:242 -#: apps/transactions/models.py:94 +#: apps/transactions/models.py:142 #: templates/dca/fragments/strategy/details.html:53 #: templates/exchange_rates/fragments/table.html:11 msgid "Date" @@ -405,27 +403,27 @@ msgstr "" msgid "From and To currencies cannot be the same." msgstr "" -#: apps/currencies/views/currencies.py:44 +#: apps/currencies/views/currencies.py:42 msgid "Currency added successfully" msgstr "" -#: apps/currencies/views/currencies.py:72 +#: apps/currencies/views/currencies.py:70 msgid "Currency updated successfully" msgstr "" -#: apps/currencies/views/currencies.py:99 +#: apps/currencies/views/currencies.py:96 msgid "Currency deleted successfully" msgstr "" -#: apps/currencies/views/exchange_rates.py:90 +#: apps/currencies/views/exchange_rates.py:89 msgid "Exchange rate added successfully" msgstr "" -#: apps/currencies/views/exchange_rates.py:118 +#: apps/currencies/views/exchange_rates.py:117 msgid "Exchange rate updated successfully" msgstr "" -#: apps/currencies/views/exchange_rates.py:145 +#: apps/currencies/views/exchange_rates.py:143 msgid "Exchange rate deleted successfully" msgstr "" @@ -438,8 +436,8 @@ msgid "Payment Currency" msgstr "" #: apps/dca/models.py:27 apps/dca/models.py:179 apps/rules/models.py:26 -#: apps/transactions/forms.py:256 apps/transactions/models.py:107 -#: apps/transactions/models.py:239 apps/transactions/models.py:420 +#: apps/transactions/forms.py:256 apps/transactions/models.py:155 +#: apps/transactions/models.py:320 apps/transactions/models.py:501 msgid "Notes" msgstr "" @@ -479,30 +477,104 @@ msgstr "" msgid "DCA Entries" msgstr "" -#: apps/dca/views.py:38 +#: apps/dca/views.py:37 msgid "DCA Strategy added successfully" msgstr "" -#: apps/dca/views.py:65 +#: apps/dca/views.py:64 msgid "DCA Strategy updated successfully" msgstr "" -#: apps/dca/views.py:92 +#: apps/dca/views.py:90 msgid "DCA strategy deleted successfully" msgstr "" -#: apps/dca/views.py:165 +#: apps/dca/views.py:163 msgid "Entry added successfully" msgstr "" -#: apps/dca/views.py:192 +#: apps/dca/views.py:190 msgid "Entry updated successfully" msgstr "" -#: apps/dca/views.py:219 +#: apps/dca/views.py:216 msgid "Entry deleted successfully" msgstr "" +#: apps/import_app/forms.py:49 +msgid "Select a file" +msgstr "" + +#: apps/import_app/forms.py:61 +#: templates/import_app/fragments/profiles/list.html:62 +#: templates/includes/navbar.html:124 +msgid "Import" +msgstr "" + +#: apps/import_app/models.py:12 +#, python-brace-format +msgid "Version {number}" +msgstr "" + +#: apps/import_app/models.py:15 +msgid "YAML Configuration" +msgstr "" + +#: apps/import_app/models.py:19 +#: templates/import_app/fragments/profiles/list.html:37 +msgid "Version" +msgstr "" + +#: apps/import_app/models.py:35 +msgid "Invalid YAML Configuration: " +msgstr "" + +#: apps/import_app/models.py:41 +msgid "Queued" +msgstr "" + +#: apps/import_app/models.py:42 +msgid "Processing" +msgstr "" + +#: apps/import_app/models.py:43 +msgid "Failed" +msgstr "" + +#: apps/import_app/models.py:44 +#: templates/installment_plans/fragments/list.html:24 +#: templates/recurring_transactions/fragments/list.html:27 +msgid "Finished" +msgstr "" + +#: apps/import_app/models.py:50 +msgid "Status" +msgstr "" + +#: apps/import_app/models.py:58 +msgid "File name" +msgstr "" + +#: apps/import_app/views.py:75 +msgid "Import Profile added successfully" +msgstr "" + +#: apps/import_app/views.py:110 +msgid "Import Profile update successfully" +msgstr "" + +#: apps/import_app/views.py:136 +msgid "Import Profile deleted successfully" +msgstr "" + +#: apps/import_app/views.py:194 +msgid "Import Run queued successfully" +msgstr "" + +#: apps/import_app/views.py:220 +msgid "Run deleted successfully" +msgstr "" + #: apps/rules/forms.py:20 msgid "Run on creation" msgstr "" @@ -528,8 +600,8 @@ msgid "A value for this field already exists in the rule." msgstr "" #: apps/rules/models.py:10 apps/rules/models.py:25 -#: apps/transactions/forms.py:248 apps/transactions/models.py:105 -#: apps/transactions/models.py:197 apps/transactions/models.py:406 +#: apps/transactions/forms.py:248 apps/transactions/models.py:153 +#: apps/transactions/models.py:278 apps/transactions/models.py:487 msgid "Description" msgstr "" @@ -537,33 +609,33 @@ msgstr "" msgid "Trigger" msgstr "" -#: apps/rules/models.py:20 apps/transactions/models.py:91 -#: apps/transactions/models.py:195 apps/transactions/models.py:398 +#: apps/rules/models.py:20 apps/transactions/models.py:139 +#: apps/transactions/models.py:276 apps/transactions/models.py:479 msgid "Type" msgstr "" #: apps/rules/models.py:21 apps/transactions/filters.py:23 -#: apps/transactions/models.py:93 +#: apps/transactions/models.py:141 msgid "Paid" msgstr "" #: apps/rules/models.py:23 apps/transactions/forms.py:66 #: apps/transactions/forms.py:245 apps/transactions/forms.py:415 -#: apps/transactions/models.py:95 apps/transactions/models.py:213 -#: apps/transactions/models.py:422 +#: apps/transactions/models.py:143 apps/transactions/models.py:294 +#: apps/transactions/models.py:503 msgid "Reference Date" msgstr "" -#: apps/rules/models.py:24 apps/transactions/models.py:100 -#: apps/transactions/models.py:403 +#: apps/rules/models.py:24 apps/transactions/models.py:148 +#: apps/transactions/models.py:484 msgid "Amount" msgstr "" #: apps/rules/models.py:29 apps/transactions/filters.py:81 #: apps/transactions/forms.py:55 apps/transactions/forms.py:409 -#: apps/transactions/forms.py:656 apps/transactions/models.py:69 -#: apps/transactions/models.py:122 apps/transactions/models.py:235 -#: apps/transactions/models.py:417 templates/entities/fragments/list.html:5 +#: apps/transactions/forms.py:656 apps/transactions/models.py:117 +#: apps/transactions/models.py:170 apps/transactions/models.py:316 +#: apps/transactions/models.py:498 templates/entities/fragments/list.html:5 #: templates/entities/pages/index.html:4 templates/includes/navbar.html:100 msgid "Entities" msgstr "" @@ -580,31 +652,31 @@ msgstr "" msgid "Value" msgstr "" -#: apps/rules/views.py:45 +#: apps/rules/views.py:44 msgid "Rule deactivated successfully" msgstr "" -#: apps/rules/views.py:47 +#: apps/rules/views.py:46 msgid "Rule activated successfully" msgstr "" -#: apps/rules/views.py:65 +#: apps/rules/views.py:64 msgid "Rule added successfully" msgstr "" -#: apps/rules/views.py:88 +#: apps/rules/views.py:87 msgid "Rule updated successfully" msgstr "" -#: apps/rules/views.py:128 +#: apps/rules/views.py:126 msgid "Rule deleted successfully" msgstr "" -#: apps/rules/views.py:182 +#: apps/rules/views.py:180 msgid "Action updated successfully" msgstr "" -#: apps/rules/views.py:213 +#: apps/rules/views.py:210 msgid "Action deleted successfully" msgstr "" @@ -693,52 +765,52 @@ msgstr "" msgid "End date should be after the start date" msgstr "" -#: apps/transactions/models.py:20 +#: apps/transactions/models.py:68 msgid "Mute" msgstr "" -#: apps/transactions/models.py:23 apps/transactions/models.py:42 -#: apps/transactions/models.py:61 templates/categories/fragments/list.html:21 +#: apps/transactions/models.py:71 apps/transactions/models.py:90 +#: apps/transactions/models.py:109 templates/categories/fragments/list.html:21 #: templates/entities/fragments/list.html:21 #: templates/recurring_transactions/fragments/list.html:21 #: templates/tags/fragments/list.html:21 msgid "Active" msgstr "" -#: apps/transactions/models.py:25 +#: apps/transactions/models.py:73 msgid "" "Deactivated categories won't be able to be selected when creating new " "transactions" msgstr "" -#: apps/transactions/models.py:30 +#: apps/transactions/models.py:78 msgid "Transaction Category" msgstr "" -#: apps/transactions/models.py:31 +#: apps/transactions/models.py:79 msgid "Transaction Categories" msgstr "" -#: apps/transactions/models.py:44 +#: apps/transactions/models.py:92 msgid "" "Deactivated tags won't be able to be selected when creating new transactions" msgstr "" -#: apps/transactions/models.py:49 apps/transactions/models.py:50 +#: apps/transactions/models.py:97 apps/transactions/models.py:98 msgid "Transaction Tags" msgstr "" -#: apps/transactions/models.py:63 +#: apps/transactions/models.py:111 msgid "" "Deactivated entities won't be able to be selected when creating new " "transactions" msgstr "" -#: apps/transactions/models.py:68 +#: apps/transactions/models.py:116 msgid "Entity" msgstr "" -#: apps/transactions/models.py:78 +#: apps/transactions/models.py:126 #: templates/calendar_view/pages/calendar.html:54 #: templates/monthly_overview/fragments/monthly_summary.html:39 #: templates/monthly_overview/pages/overview.html:54 @@ -748,7 +820,7 @@ msgstr "" msgid "Income" msgstr "" -#: apps/transactions/models.py:79 +#: apps/transactions/models.py:127 #: templates/calendar_view/pages/calendar.html:62 #: templates/monthly_overview/pages/overview.html:62 #: templates/yearly_overview/pages/overview_by_account.html:57 @@ -756,19 +828,35 @@ msgstr "" msgid "Expense" msgstr "" -#: apps/transactions/models.py:133 apps/transactions/models.py:242 +#: apps/transactions/models.py:181 apps/transactions/models.py:323 msgid "Installment Plan" msgstr "" -#: apps/transactions/models.py:142 apps/transactions/models.py:443 +#: apps/transactions/models.py:190 apps/transactions/models.py:524 msgid "Recurring Transaction" msgstr "" -#: apps/transactions/models.py:146 +#: apps/transactions/models.py:192 +msgid "Internal Note" +msgstr "" + +#: apps/transactions/models.py:194 +msgid "Internal ID" +msgstr "" + +#: apps/transactions/models.py:198 +msgid "Deleted" +msgstr "" + +#: apps/transactions/models.py:203 +msgid "Deleted At" +msgstr "" + +#: apps/transactions/models.py:211 msgid "Transaction" msgstr "" -#: apps/transactions/models.py:147 templates/includes/navbar.html:53 +#: apps/transactions/models.py:212 templates/includes/navbar.html:53 #: templates/includes/navbar.html:94 #: templates/recurring_transactions/fragments/list_transactions.html:5 #: templates/recurring_transactions/fragments/table.html:37 @@ -776,95 +864,95 @@ msgstr "" msgid "Transactions" msgstr "" -#: apps/transactions/models.py:184 +#: apps/transactions/models.py:265 msgid "Yearly" msgstr "" -#: apps/transactions/models.py:185 apps/users/models.py:26 +#: apps/transactions/models.py:266 apps/users/models.py:26 #: templates/includes/navbar.html:25 msgid "Monthly" msgstr "" -#: apps/transactions/models.py:186 +#: apps/transactions/models.py:267 msgid "Weekly" msgstr "" -#: apps/transactions/models.py:187 +#: apps/transactions/models.py:268 msgid "Daily" msgstr "" -#: apps/transactions/models.py:200 +#: apps/transactions/models.py:281 msgid "Number of Installments" msgstr "" -#: apps/transactions/models.py:205 +#: apps/transactions/models.py:286 msgid "Installment Start" msgstr "" -#: apps/transactions/models.py:206 +#: apps/transactions/models.py:287 msgid "The installment number to start counting from" msgstr "" -#: apps/transactions/models.py:211 apps/transactions/models.py:426 +#: apps/transactions/models.py:292 apps/transactions/models.py:507 msgid "Start Date" msgstr "" -#: apps/transactions/models.py:215 apps/transactions/models.py:427 +#: apps/transactions/models.py:296 apps/transactions/models.py:508 msgid "End Date" msgstr "" -#: apps/transactions/models.py:220 +#: apps/transactions/models.py:301 msgid "Recurrence" msgstr "" -#: apps/transactions/models.py:223 +#: apps/transactions/models.py:304 msgid "Installment Amount" msgstr "" -#: apps/transactions/models.py:243 templates/includes/navbar.html:62 +#: apps/transactions/models.py:324 templates/includes/navbar.html:62 #: templates/installment_plans/fragments/list.html:5 #: templates/installment_plans/pages/index.html:4 msgid "Installment Plans" msgstr "" -#: apps/transactions/models.py:385 +#: apps/transactions/models.py:466 msgid "day(s)" msgstr "" -#: apps/transactions/models.py:386 +#: apps/transactions/models.py:467 msgid "week(s)" msgstr "" -#: apps/transactions/models.py:387 +#: apps/transactions/models.py:468 msgid "month(s)" msgstr "" -#: apps/transactions/models.py:388 +#: apps/transactions/models.py:469 msgid "year(s)" msgstr "" -#: apps/transactions/models.py:390 +#: apps/transactions/models.py:471 #: templates/recurring_transactions/fragments/list.html:24 msgid "Paused" msgstr "" -#: apps/transactions/models.py:429 +#: apps/transactions/models.py:510 msgid "Recurrence Type" msgstr "" -#: apps/transactions/models.py:432 +#: apps/transactions/models.py:513 msgid "Recurrence Interval" msgstr "" -#: apps/transactions/models.py:436 +#: apps/transactions/models.py:517 msgid "Last Generated Date" msgstr "" -#: apps/transactions/models.py:439 +#: apps/transactions/models.py:520 msgid "Last Generated Reference Date" msgstr "" -#: apps/transactions/models.py:444 templates/includes/navbar.html:64 +#: apps/transactions/models.py:525 templates/includes/navbar.html:64 #: templates/recurring_transactions/fragments/list.html:5 #: templates/recurring_transactions/pages/index.html:4 msgid "Recurring Transactions" @@ -880,99 +968,99 @@ msgstr "" msgid "%(value)s is not a non-negative number" msgstr "" -#: apps/transactions/views/categories.py:66 +#: apps/transactions/views/categories.py:64 msgid "Category added successfully" msgstr "" -#: apps/transactions/views/categories.py:94 +#: apps/transactions/views/categories.py:92 msgid "Category updated successfully" msgstr "" -#: apps/transactions/views/categories.py:121 +#: apps/transactions/views/categories.py:118 msgid "Category deleted successfully" msgstr "" -#: apps/transactions/views/entities.py:65 +#: apps/transactions/views/entities.py:64 msgid "Entity added successfully" msgstr "" -#: apps/transactions/views/entities.py:93 +#: apps/transactions/views/entities.py:92 msgid "Entity updated successfully" msgstr "" -#: apps/transactions/views/entities.py:120 +#: apps/transactions/views/entities.py:118 msgid "Entity deleted successfully" msgstr "" -#: apps/transactions/views/installment_plans.py:88 +#: apps/transactions/views/installment_plans.py:87 msgid "Installment Plan added successfully" msgstr "" -#: apps/transactions/views/installment_plans.py:118 +#: apps/transactions/views/installment_plans.py:117 msgid "Installment Plan updated successfully" msgstr "" -#: apps/transactions/views/installment_plans.py:143 +#: apps/transactions/views/installment_plans.py:142 msgid "Installment Plan refreshed successfully" msgstr "" -#: apps/transactions/views/installment_plans.py:162 +#: apps/transactions/views/installment_plans.py:160 msgid "Installment Plan deleted successfully" msgstr "" -#: apps/transactions/views/recurring_transactions.py:114 +#: apps/transactions/views/recurring_transactions.py:112 msgid "Recurring Transaction added successfully" msgstr "" -#: apps/transactions/views/recurring_transactions.py:146 +#: apps/transactions/views/recurring_transactions.py:144 msgid "Recurring Transaction updated successfully" msgstr "" -#: apps/transactions/views/recurring_transactions.py:192 +#: apps/transactions/views/recurring_transactions.py:190 msgid "Recurring transaction unpaused successfully" msgstr "" -#: apps/transactions/views/recurring_transactions.py:195 +#: apps/transactions/views/recurring_transactions.py:193 msgid "Recurring transaction paused successfully" msgstr "" -#: apps/transactions/views/recurring_transactions.py:221 +#: apps/transactions/views/recurring_transactions.py:219 msgid "Recurring transaction finished successfully" msgstr "" -#: apps/transactions/views/recurring_transactions.py:242 +#: apps/transactions/views/recurring_transactions.py:239 msgid "Recurring Transaction deleted successfully" msgstr "" -#: apps/transactions/views/tags.py:65 +#: apps/transactions/views/tags.py:64 msgid "Tag added successfully" msgstr "" -#: apps/transactions/views/tags.py:93 +#: apps/transactions/views/tags.py:92 msgid "Tag updated successfully" msgstr "" -#: apps/transactions/views/tags.py:120 +#: apps/transactions/views/tags.py:118 msgid "Tag deleted successfully" msgstr "" -#: apps/transactions/views/transactions.py:47 +#: apps/transactions/views/transactions.py:46 msgid "Transaction added successfully" msgstr "" -#: apps/transactions/views/transactions.py:79 +#: apps/transactions/views/transactions.py:78 msgid "Transaction updated successfully" msgstr "" -#: apps/transactions/views/transactions.py:110 +#: apps/transactions/views/transactions.py:109 msgid "Transaction duplicated successfully" msgstr "" -#: apps/transactions/views/transactions.py:153 +#: apps/transactions/views/transactions.py:151 msgid "Transaction deleted successfully" msgstr "" -#: apps/transactions/views/transactions.py:179 +#: apps/transactions/views/transactions.py:177 msgid "Transfer added successfully" msgstr "" @@ -1101,7 +1189,7 @@ msgstr "" #: templates/dca/fragments/strategy/details.html:64 #: templates/entities/fragments/table.html:23 #: templates/exchange_rates/fragments/table.html:20 -#: templates/import_app/fragments/list.html:37 +#: templates/import_app/fragments/profiles/list.html:44 #: templates/installment_plans/fragments/table.html:23 #: templates/recurring_transactions/fragments/table.html:25 #: templates/rules/fragments/list.html:33 @@ -1118,7 +1206,7 @@ msgstr "" #: templates/dca/fragments/strategy/list.html:34 #: templates/entities/fragments/table.html:28 #: templates/exchange_rates/fragments/table.html:24 -#: templates/import_app/fragments/list.html:41 +#: templates/import_app/fragments/profiles/list.html:48 #: templates/installment_plans/fragments/table.html:27 #: templates/recurring_transactions/fragments/table.html:29 #: templates/rules/fragments/transaction_rule/view.html:22 @@ -1137,6 +1225,8 @@ msgstr "" #: templates/dca/fragments/strategy/list.html:42 #: templates/entities/fragments/table.html:36 #: templates/exchange_rates/fragments/table.html:32 +#: templates/import_app/fragments/profiles/list.html:69 +#: templates/import_app/fragments/runs/list.html:102 #: templates/installment_plans/fragments/table.html:56 #: templates/mini_tools/unit_price_calculator.html:18 #: templates/recurring_transactions/fragments/table.html:91 @@ -1156,6 +1246,8 @@ msgstr "" #: templates/dca/fragments/strategy/list.html:46 #: templates/entities/fragments/table.html:40 #: templates/exchange_rates/fragments/table.html:37 +#: templates/import_app/fragments/profiles/list.html:73 +#: templates/import_app/fragments/runs/list.html:106 #: templates/installment_plans/fragments/table.html:48 #: templates/installment_plans/fragments/table.html:60 #: templates/recurring_transactions/fragments/table.html:53 @@ -1178,6 +1270,7 @@ msgstr "" #: templates/dca/fragments/strategy/list.html:47 #: templates/entities/fragments/table.html:41 #: templates/exchange_rates/fragments/table.html:38 +#: templates/import_app/fragments/profiles/list.html:74 #: templates/rules/fragments/list.html:49 #: templates/rules/fragments/transaction_rule/view.html:61 #: templates/tags/fragments/table.html:41 @@ -1193,6 +1286,8 @@ msgstr "" #: templates/dca/fragments/strategy/list.html:48 #: templates/entities/fragments/table.html:42 #: templates/exchange_rates/fragments/table.html:39 +#: templates/import_app/fragments/profiles/list.html:75 +#: templates/import_app/fragments/runs/list.html:108 #: templates/installment_plans/fragments/table.html:62 #: templates/recurring_transactions/fragments/table.html:98 #: templates/rules/fragments/list.html:50 @@ -1206,22 +1301,18 @@ msgid "No account groups" msgstr "" #: templates/accounts/fragments/account_reconciliation.html:6 -#: templates/import_app/fragments/account_reconciliation.html:6 msgid "Account Reconciliation" msgstr "" #: templates/accounts/fragments/account_reconciliation.html:26 -#: templates/import_app/fragments/account_reconciliation.html:26 msgid "Current balance" msgstr "" #: templates/accounts/fragments/account_reconciliation.html:39 -#: templates/import_app/fragments/account_reconciliation.html:39 msgid "Difference" msgstr "" #: templates/accounts/fragments/account_reconciliation.html:70 -#: templates/import_app/fragments/account_reconciliation.html:70 msgid "Reconcile balances" msgstr "" @@ -1234,12 +1325,10 @@ msgid "Edit account" msgstr "" #: templates/accounts/fragments/list.html:29 -#: templates/import_app/fragments/list.html:29 msgid "Is Asset" msgstr "" #: templates/accounts/fragments/list.html:70 -#: templates/import_app/fragments/list.html:70 msgid "No accounts" msgstr "" @@ -1330,6 +1419,7 @@ msgid "Close" msgstr "" #: templates/cotton/config/search.html:6 +#: templates/import_app/fragments/profiles/list_presets.html:13 msgid "Search" msgstr "" @@ -1593,6 +1683,91 @@ msgstr "" msgid "Page navigation" msgstr "" +#: templates/import_app/fragments/profiles/add.html:6 +msgid "Add new import profile" +msgstr "" + +#: templates/import_app/fragments/profiles/add.html:11 +msgid "A message from the author" +msgstr "" + +#: templates/import_app/fragments/profiles/edit.html:5 +msgid "Edit import profile" +msgstr "" + +#: templates/import_app/fragments/profiles/list.html:5 +#: templates/import_app/pages/profiles_index.html:4 +msgid "Import Profiles" +msgstr "" + +#: templates/import_app/fragments/profiles/list.html:17 +msgid "New" +msgstr "" + +#: templates/import_app/fragments/profiles/list.html:21 +msgid "From preset" +msgstr "" + +#: templates/import_app/fragments/profiles/list.html:55 +msgid "Runs" +msgstr "" + +#: templates/import_app/fragments/profiles/list.html:86 +msgid "No import profiles" +msgstr "" + +#: templates/import_app/fragments/profiles/list_presets.html:5 +msgid "Import Presets" +msgstr "" + +#: templates/import_app/fragments/profiles/list_presets.html:33 +msgid "By" +msgstr "" + +#: templates/import_app/fragments/profiles/list_presets.html:40 +msgid "No presets yet" +msgstr "" + +#: templates/import_app/fragments/runs/add.html:5 +msgid "Import file with profile" +msgstr "" + +#: templates/import_app/fragments/runs/list.html:5 +msgid "Runs for" +msgstr "" + +#: templates/import_app/fragments/runs/list.html:29 +msgid "Total Items" +msgstr "" + +#: templates/import_app/fragments/runs/list.html:42 +msgid "Processed Items" +msgstr "" + +#: templates/import_app/fragments/runs/list.html:55 +msgid "Skipped Items" +msgstr "" + +#: templates/import_app/fragments/runs/list.html:68 +msgid "Failed Items" +msgstr "" + +#: templates/import_app/fragments/runs/list.html:81 +msgid "Successful Items" +msgstr "" + +#: templates/import_app/fragments/runs/list.html:96 +msgid "Logs" +msgstr "" + +#: templates/import_app/fragments/runs/list.html:107 +msgid "You won't be able to revert this! All imported items will be kept." +msgstr "" + +#: templates/import_app/fragments/runs/list.html:116 +msgid "No runs yet" +msgstr "" + #: templates/import_app/fragments/runs/log.html:5 msgid "Logs for" msgstr "" @@ -1642,15 +1817,15 @@ msgstr "" msgid "Rules" msgstr "" -#: templates/includes/navbar.html:132 +#: templates/includes/navbar.html:134 msgid "Only use this if you know what you're doing" msgstr "" -#: templates/includes/navbar.html:133 +#: templates/includes/navbar.html:135 msgid "Django Admin" msgstr "" -#: templates/includes/navbar.html:142 +#: templates/includes/navbar.html:144 msgid "Calculator" msgstr "" @@ -1686,11 +1861,6 @@ msgstr "" msgid "Edit installment plan" msgstr "" -#: templates/installment_plans/fragments/list.html:24 -#: templates/recurring_transactions/fragments/list.html:27 -msgid "Finished" -msgstr "" - #: templates/installment_plans/fragments/list_transactions.html:5 #: templates/installment_plans/fragments/table.html:35 msgid "Installments" diff --git a/app/locale/pt_BR/LC_MESSAGES/django.po b/app/locale/pt_BR/LC_MESSAGES/django.po index 5455619..45c4b55 100644 --- a/app/locale/pt_BR/LC_MESSAGES/django.po +++ b/app/locale/pt_BR/LC_MESSAGES/django.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-01-21 01:12+0000\n" -"PO-Revision-Date: 2025-01-20 22:12-0300\n" +"POT-Creation-Date: 2025-01-24 19:24+0000\n" +"PO-Revision-Date: 2025-01-24 16:25-0300\n" "Last-Translator: \n" "Language-Team: \n" "Language: pt_BR\n" @@ -25,20 +25,21 @@ msgstr "Nome do grupo" #: apps/accounts/forms.py:40 apps/accounts/forms.py:96 #: apps/currencies/forms.py:52 apps/currencies/forms.py:92 apps/dca/forms.py:41 -#: apps/dca/forms.py:93 apps/rules/forms.py:45 apps/rules/forms.py:87 -#: apps/transactions/forms.py:150 apps/transactions/forms.py:506 -#: apps/transactions/forms.py:549 apps/transactions/forms.py:581 -#: apps/transactions/forms.py:616 apps/transactions/forms.py:754 +#: apps/dca/forms.py:93 apps/import_app/forms.py:34 apps/rules/forms.py:45 +#: apps/rules/forms.py:87 apps/transactions/forms.py:150 +#: apps/transactions/forms.py:506 apps/transactions/forms.py:549 +#: apps/transactions/forms.py:581 apps/transactions/forms.py:616 +#: apps/transactions/forms.py:754 msgid "Update" msgstr "Atualizar" #: apps/accounts/forms.py:48 apps/accounts/forms.py:104 #: apps/common/widgets/tom_select.py:12 apps/currencies/forms.py:60 #: apps/currencies/forms.py:100 apps/dca/forms.py:49 apps/dca/forms.py:102 -#: apps/rules/forms.py:53 apps/rules/forms.py:95 apps/transactions/forms.py:159 -#: apps/transactions/forms.py:514 apps/transactions/forms.py:557 -#: apps/transactions/forms.py:589 apps/transactions/forms.py:624 -#: apps/transactions/forms.py:762 +#: apps/import_app/forms.py:42 apps/rules/forms.py:53 apps/rules/forms.py:95 +#: apps/transactions/forms.py:159 apps/transactions/forms.py:514 +#: apps/transactions/forms.py:557 apps/transactions/forms.py:589 +#: apps/transactions/forms.py:624 apps/transactions/forms.py:762 #: templates/account_groups/fragments/list.html:9 #: templates/accounts/fragments/list.html:9 #: templates/categories/fragments/list.html:9 @@ -47,7 +48,8 @@ msgstr "Atualizar" #: templates/dca/fragments/strategy/list.html:9 #: templates/entities/fragments/list.html:9 #: templates/exchange_rates/fragments/list.html:10 -#: templates/import_app/fragments/list.html:9 +#: templates/import_app/fragments/profiles/list.html:7 +#: templates/import_app/fragments/profiles/list.html:10 #: templates/installment_plans/fragments/list.html:9 #: templates/mini_tools/unit_price_calculator.html:162 #: templates/recurring_transactions/fragments/list.html:9 @@ -56,7 +58,6 @@ msgid "Add" msgstr "Adicionar" #: apps/accounts/forms.py:57 templates/accounts/fragments/list.html:26 -#: templates/import_app/fragments/list.html:26 msgid "Group" msgstr "Grupo da Conta" @@ -67,8 +68,8 @@ msgstr "Novo saldo" #: apps/accounts/forms.py:119 apps/rules/models.py:27 #: apps/transactions/forms.py:39 apps/transactions/forms.py:214 #: apps/transactions/forms.py:221 apps/transactions/forms.py:401 -#: apps/transactions/forms.py:648 apps/transactions/models.py:111 -#: apps/transactions/models.py:230 apps/transactions/models.py:410 +#: apps/transactions/forms.py:648 apps/transactions/models.py:159 +#: apps/transactions/models.py:311 apps/transactions/models.py:491 msgid "Category" msgstr "Categoria" @@ -76,21 +77,22 @@ msgstr "Categoria" #: apps/transactions/filters.py:74 apps/transactions/forms.py:47 #: apps/transactions/forms.py:230 apps/transactions/forms.py:238 #: apps/transactions/forms.py:394 apps/transactions/forms.py:641 -#: apps/transactions/models.py:117 apps/transactions/models.py:232 -#: apps/transactions/models.py:414 templates/includes/navbar.html:98 +#: apps/transactions/models.py:165 apps/transactions/models.py:313 +#: apps/transactions/models.py:495 templates/includes/navbar.html:98 #: templates/tags/fragments/list.html:5 templates/tags/pages/index.html:4 msgid "Tags" msgstr "Tags" #: apps/accounts/models.py:9 apps/accounts/models.py:21 apps/dca/models.py:14 -#: apps/rules/models.py:9 apps/transactions/models.py:19 -#: apps/transactions/models.py:39 apps/transactions/models.py:58 +#: apps/import_app/models.py:14 apps/rules/models.py:9 +#: apps/transactions/models.py:67 apps/transactions/models.py:87 +#: apps/transactions/models.py:106 #: templates/account_groups/fragments/list.html:25 #: templates/accounts/fragments/list.html:25 #: templates/categories/fragments/table.html:16 #: templates/currencies/fragments/list.html:26 #: templates/entities/fragments/table.html:16 -#: templates/import_app/fragments/list.html:25 +#: templates/import_app/fragments/profiles/list.html:36 #: templates/installment_plans/fragments/table.html:16 #: templates/recurring_transactions/fragments/table.html:18 #: templates/rules/fragments/list.html:26 @@ -110,13 +112,11 @@ msgstr "Grupos da Conta" #: apps/accounts/models.py:31 apps/currencies/models.py:32 #: templates/accounts/fragments/list.html:27 -#: templates/import_app/fragments/list.html:27 msgid "Currency" msgstr "Moeda" #: apps/accounts/models.py:37 apps/currencies/models.py:20 #: templates/accounts/fragments/list.html:28 -#: templates/import_app/fragments/list.html:28 msgid "Exchange Currency" msgstr "Moeda de Câmbio" @@ -138,7 +138,6 @@ msgstr "" #: apps/accounts/models.py:54 templates/accounts/fragments/list.html:30 #: templates/categories/fragments/list.html:24 #: templates/entities/fragments/list.html:24 -#: templates/import_app/fragments/list.html:30 #: templates/tags/fragments/list.html:24 msgid "Archived" msgstr "Arquivada" @@ -150,16 +149,15 @@ msgstr "" #: apps/accounts/models.py:59 apps/rules/models.py:19 #: apps/transactions/forms.py:59 apps/transactions/forms.py:386 -#: apps/transactions/forms.py:633 apps/transactions/models.py:84 -#: apps/transactions/models.py:190 apps/transactions/models.py:392 +#: apps/transactions/forms.py:633 apps/transactions/models.py:132 +#: apps/transactions/models.py:271 apps/transactions/models.py:473 msgid "Account" msgstr "Conta" #: apps/accounts/models.py:60 apps/transactions/filters.py:53 #: templates/accounts/fragments/list.html:5 -#: templates/accounts/pages/index.html:4 -#: templates/import_app/fragments/list.html:5 -#: templates/includes/navbar.html:104 templates/includes/navbar.html:106 +#: templates/accounts/pages/index.html:4 templates/includes/navbar.html:104 +#: templates/includes/navbar.html:106 #: templates/transactions/fragments/summary.html:9 msgid "Accounts" msgstr "Contas" @@ -168,27 +166,27 @@ msgstr "Contas" msgid "Exchange currency cannot be the same as the account's main currency." msgstr "A moeda de câmbio não pode ser a mesma que a moeda principal da conta." -#: apps/accounts/views/account_groups.py:44 +#: apps/accounts/views/account_groups.py:42 msgid "Account Group added successfully" msgstr "Grupo de Conta adicionado com sucesso" -#: apps/accounts/views/account_groups.py:72 +#: apps/accounts/views/account_groups.py:70 msgid "Account Group updated successfully" msgstr "Grupo de Conta atualizado com sucesso" -#: apps/accounts/views/account_groups.py:99 +#: apps/accounts/views/account_groups.py:96 msgid "Account Group deleted successfully" msgstr "Grupo de Conta apagado com sucesso" -#: apps/accounts/views/accounts.py:44 +#: apps/accounts/views/accounts.py:42 msgid "Account added successfully" msgstr "Conta adicionado com sucesso" -#: apps/accounts/views/accounts.py:72 +#: apps/accounts/views/accounts.py:70 msgid "Account updated successfully" msgstr "Conta atualizada com sucesso" -#: apps/accounts/views/accounts.py:99 +#: apps/accounts/views/accounts.py:96 msgid "Account deleted successfully" msgstr "Conta apagada com sucesso" @@ -353,7 +351,7 @@ msgstr "Sufixo" #: apps/currencies/forms.py:68 apps/dca/models.py:156 apps/rules/models.py:22 #: apps/transactions/forms.py:63 apps/transactions/forms.py:242 -#: apps/transactions/models.py:94 +#: apps/transactions/models.py:142 #: templates/dca/fragments/strategy/details.html:53 #: templates/exchange_rates/fragments/table.html:11 msgid "Date" @@ -409,27 +407,27 @@ msgstr "Taxas de Câmbio" msgid "From and To currencies cannot be the same." msgstr "As moedas De e Para não podem ser as mesmas." -#: apps/currencies/views/currencies.py:44 +#: apps/currencies/views/currencies.py:42 msgid "Currency added successfully" msgstr "Moeda adicionada com sucesso" -#: apps/currencies/views/currencies.py:72 +#: apps/currencies/views/currencies.py:70 msgid "Currency updated successfully" msgstr "Moeda atualizada com sucesso" -#: apps/currencies/views/currencies.py:99 +#: apps/currencies/views/currencies.py:96 msgid "Currency deleted successfully" msgstr "Moeda apagada com sucesso" -#: apps/currencies/views/exchange_rates.py:90 +#: apps/currencies/views/exchange_rates.py:89 msgid "Exchange rate added successfully" msgstr "Taxa de câmbio adicionada com sucesso" -#: apps/currencies/views/exchange_rates.py:118 +#: apps/currencies/views/exchange_rates.py:117 msgid "Exchange rate updated successfully" msgstr "Taxa de câmbio atualizada com sucesso" -#: apps/currencies/views/exchange_rates.py:145 +#: apps/currencies/views/exchange_rates.py:143 msgid "Exchange rate deleted successfully" msgstr "Taxa de câmbio apagada com sucesso" @@ -442,8 +440,8 @@ msgid "Payment Currency" msgstr "Moeda de pagamento" #: apps/dca/models.py:27 apps/dca/models.py:179 apps/rules/models.py:26 -#: apps/transactions/forms.py:256 apps/transactions/models.py:107 -#: apps/transactions/models.py:239 apps/transactions/models.py:420 +#: apps/transactions/forms.py:256 apps/transactions/models.py:155 +#: apps/transactions/models.py:320 apps/transactions/models.py:501 msgid "Notes" msgstr "Notas" @@ -483,30 +481,104 @@ msgstr "Entrada CMP" msgid "DCA Entries" msgstr "Entradas CMP" -#: apps/dca/views.py:38 +#: apps/dca/views.py:37 msgid "DCA Strategy added successfully" msgstr "Estratégia CMP adicionada com sucesso" -#: apps/dca/views.py:65 +#: apps/dca/views.py:64 msgid "DCA Strategy updated successfully" msgstr "Estratégia CMP atualizada com sucesso" -#: apps/dca/views.py:92 +#: apps/dca/views.py:90 msgid "DCA strategy deleted successfully" msgstr "Estratégia CMP apagada com sucesso" -#: apps/dca/views.py:165 +#: apps/dca/views.py:163 msgid "Entry added successfully" msgstr "Entrada adicionada com sucesso" -#: apps/dca/views.py:192 +#: apps/dca/views.py:190 msgid "Entry updated successfully" msgstr "Entrada atualizada com sucesso" -#: apps/dca/views.py:219 +#: apps/dca/views.py:216 msgid "Entry deleted successfully" msgstr "Entrada apagada com sucesso" +#: apps/import_app/forms.py:49 +msgid "Select a file" +msgstr "Selecione um arquivo" + +#: apps/import_app/forms.py:61 +#: templates/import_app/fragments/profiles/list.html:62 +#: templates/includes/navbar.html:124 +msgid "Import" +msgstr "Importar" + +#: apps/import_app/models.py:12 +#, python-brace-format +msgid "Version {number}" +msgstr "Versão {number}" + +#: apps/import_app/models.py:15 +msgid "YAML Configuration" +msgstr "Configuração YAML" + +#: apps/import_app/models.py:19 +#: templates/import_app/fragments/profiles/list.html:37 +msgid "Version" +msgstr "Versão" + +#: apps/import_app/models.py:35 +msgid "Invalid YAML Configuration: " +msgstr "Configuração YAML inválida: " + +#: apps/import_app/models.py:41 +msgid "Queued" +msgstr "Na fila" + +#: apps/import_app/models.py:42 +msgid "Processing" +msgstr "Processando" + +#: apps/import_app/models.py:43 +msgid "Failed" +msgstr "Falhou" + +#: apps/import_app/models.py:44 +#: templates/installment_plans/fragments/list.html:24 +#: templates/recurring_transactions/fragments/list.html:27 +msgid "Finished" +msgstr "Finalizado" + +#: apps/import_app/models.py:50 +msgid "Status" +msgstr "Status" + +#: apps/import_app/models.py:58 +msgid "File name" +msgstr "Nome do Arquivo" + +#: apps/import_app/views.py:75 +msgid "Import Profile added successfully" +msgstr "Perfil de Importação adicionado com sucesso" + +#: apps/import_app/views.py:110 +msgid "Import Profile update successfully" +msgstr "Importação atualizada com sucesso" + +#: apps/import_app/views.py:136 +msgid "Import Profile deleted successfully" +msgstr "Importação apagada com sucesso" + +#: apps/import_app/views.py:194 +msgid "Import Run queued successfully" +msgstr "Importação adicionada à fila com sucesso" + +#: apps/import_app/views.py:220 +msgid "Run deleted successfully" +msgstr "Importação apagada com sucesso" + #: apps/rules/forms.py:20 msgid "Run on creation" msgstr "Rodar na criação" @@ -532,8 +604,8 @@ msgid "A value for this field already exists in the rule." msgstr "Já existe um valor para esse campo na regra." #: apps/rules/models.py:10 apps/rules/models.py:25 -#: apps/transactions/forms.py:248 apps/transactions/models.py:105 -#: apps/transactions/models.py:197 apps/transactions/models.py:406 +#: apps/transactions/forms.py:248 apps/transactions/models.py:153 +#: apps/transactions/models.py:278 apps/transactions/models.py:487 msgid "Description" msgstr "Descrição" @@ -541,33 +613,33 @@ msgstr "Descrição" msgid "Trigger" msgstr "Gatilho" -#: apps/rules/models.py:20 apps/transactions/models.py:91 -#: apps/transactions/models.py:195 apps/transactions/models.py:398 +#: apps/rules/models.py:20 apps/transactions/models.py:139 +#: apps/transactions/models.py:276 apps/transactions/models.py:479 msgid "Type" msgstr "Tipo" #: apps/rules/models.py:21 apps/transactions/filters.py:23 -#: apps/transactions/models.py:93 +#: apps/transactions/models.py:141 msgid "Paid" msgstr "Pago" #: apps/rules/models.py:23 apps/transactions/forms.py:66 #: apps/transactions/forms.py:245 apps/transactions/forms.py:415 -#: apps/transactions/models.py:95 apps/transactions/models.py:213 -#: apps/transactions/models.py:422 +#: apps/transactions/models.py:143 apps/transactions/models.py:294 +#: apps/transactions/models.py:503 msgid "Reference Date" msgstr "Data de Referência" -#: apps/rules/models.py:24 apps/transactions/models.py:100 -#: apps/transactions/models.py:403 +#: apps/rules/models.py:24 apps/transactions/models.py:148 +#: apps/transactions/models.py:484 msgid "Amount" msgstr "Quantia" #: apps/rules/models.py:29 apps/transactions/filters.py:81 #: apps/transactions/forms.py:55 apps/transactions/forms.py:409 -#: apps/transactions/forms.py:656 apps/transactions/models.py:69 -#: apps/transactions/models.py:122 apps/transactions/models.py:235 -#: apps/transactions/models.py:417 templates/entities/fragments/list.html:5 +#: apps/transactions/forms.py:656 apps/transactions/models.py:117 +#: apps/transactions/models.py:170 apps/transactions/models.py:316 +#: apps/transactions/models.py:498 templates/entities/fragments/list.html:5 #: templates/entities/pages/index.html:4 templates/includes/navbar.html:100 msgid "Entities" msgstr "Entidades" @@ -584,31 +656,31 @@ msgstr "Campo" msgid "Value" msgstr "Valor" -#: apps/rules/views.py:45 +#: apps/rules/views.py:44 msgid "Rule deactivated successfully" msgstr "Regra desativada com sucesso" -#: apps/rules/views.py:47 +#: apps/rules/views.py:46 msgid "Rule activated successfully" msgstr "Regra ativada com sucesso" -#: apps/rules/views.py:65 +#: apps/rules/views.py:64 msgid "Rule added successfully" msgstr "Regra adicionada com sucesso" -#: apps/rules/views.py:88 +#: apps/rules/views.py:87 msgid "Rule updated successfully" msgstr "Regra atualizada com sucesso" -#: apps/rules/views.py:128 +#: apps/rules/views.py:126 msgid "Rule deleted successfully" msgstr "Regra apagada com sucesso" -#: apps/rules/views.py:182 +#: apps/rules/views.py:180 msgid "Action updated successfully" msgstr "Ação atualizada com sucesso" -#: apps/rules/views.py:213 +#: apps/rules/views.py:210 msgid "Action deleted successfully" msgstr "Ação apagada com sucesso" @@ -697,19 +769,19 @@ msgstr "As categorias silenciadas não serão contabilizadas em seu total mensal msgid "End date should be after the start date" msgstr "Data final deve ser após data inicial" -#: apps/transactions/models.py:20 +#: apps/transactions/models.py:68 msgid "Mute" msgstr "Silenciada" -#: apps/transactions/models.py:23 apps/transactions/models.py:42 -#: apps/transactions/models.py:61 templates/categories/fragments/list.html:21 +#: apps/transactions/models.py:71 apps/transactions/models.py:90 +#: apps/transactions/models.py:109 templates/categories/fragments/list.html:21 #: templates/entities/fragments/list.html:21 #: templates/recurring_transactions/fragments/list.html:21 #: templates/tags/fragments/list.html:21 msgid "Active" msgstr "Ativo" -#: apps/transactions/models.py:25 +#: apps/transactions/models.py:73 msgid "" "Deactivated categories won't be able to be selected when creating new " "transactions" @@ -717,25 +789,25 @@ msgstr "" "As categorias desativadas não poderão ser selecionadas ao criar novas " "transações" -#: apps/transactions/models.py:30 +#: apps/transactions/models.py:78 msgid "Transaction Category" msgstr "Categoria da Transação" -#: apps/transactions/models.py:31 +#: apps/transactions/models.py:79 msgid "Transaction Categories" msgstr "Categorias da Trasanção" -#: apps/transactions/models.py:44 +#: apps/transactions/models.py:92 msgid "" "Deactivated tags won't be able to be selected when creating new transactions" msgstr "" "As tags desativadas não poderão ser selecionadas ao criar novas transações" -#: apps/transactions/models.py:49 apps/transactions/models.py:50 +#: apps/transactions/models.py:97 apps/transactions/models.py:98 msgid "Transaction Tags" msgstr "Tags da Transação" -#: apps/transactions/models.py:63 +#: apps/transactions/models.py:111 msgid "" "Deactivated entities won't be able to be selected when creating new " "transactions" @@ -743,11 +815,11 @@ msgstr "" "As entidades desativadas não poderão ser selecionadas ao criar novas " "transações" -#: apps/transactions/models.py:68 +#: apps/transactions/models.py:116 msgid "Entity" msgstr "Entidade" -#: apps/transactions/models.py:78 +#: apps/transactions/models.py:126 #: templates/calendar_view/pages/calendar.html:54 #: templates/monthly_overview/fragments/monthly_summary.html:39 #: templates/monthly_overview/pages/overview.html:54 @@ -757,7 +829,7 @@ msgstr "Entidade" msgid "Income" msgstr "Renda" -#: apps/transactions/models.py:79 +#: apps/transactions/models.py:127 #: templates/calendar_view/pages/calendar.html:62 #: templates/monthly_overview/pages/overview.html:62 #: templates/yearly_overview/pages/overview_by_account.html:57 @@ -765,19 +837,35 @@ msgstr "Renda" msgid "Expense" msgstr "Despesa" -#: apps/transactions/models.py:133 apps/transactions/models.py:242 +#: apps/transactions/models.py:181 apps/transactions/models.py:323 msgid "Installment Plan" msgstr "Parcelamento" -#: apps/transactions/models.py:142 apps/transactions/models.py:443 +#: apps/transactions/models.py:190 apps/transactions/models.py:524 msgid "Recurring Transaction" msgstr "Transação Recorrente" -#: apps/transactions/models.py:146 +#: apps/transactions/models.py:192 +msgid "Internal Note" +msgstr "Nota Interna" + +#: apps/transactions/models.py:194 +msgid "Internal ID" +msgstr "ID Interna" + +#: apps/transactions/models.py:198 +msgid "Deleted" +msgstr "Apagado" + +#: apps/transactions/models.py:203 +msgid "Deleted At" +msgstr "Apagado Em" + +#: apps/transactions/models.py:211 msgid "Transaction" msgstr "Transação" -#: apps/transactions/models.py:147 templates/includes/navbar.html:53 +#: apps/transactions/models.py:212 templates/includes/navbar.html:53 #: templates/includes/navbar.html:94 #: templates/recurring_transactions/fragments/list_transactions.html:5 #: templates/recurring_transactions/fragments/table.html:37 @@ -785,95 +873,95 @@ msgstr "Transação" msgid "Transactions" msgstr "Transações" -#: apps/transactions/models.py:184 +#: apps/transactions/models.py:265 msgid "Yearly" msgstr "Anual" -#: apps/transactions/models.py:185 apps/users/models.py:26 +#: apps/transactions/models.py:266 apps/users/models.py:26 #: templates/includes/navbar.html:25 msgid "Monthly" msgstr "Mensal" -#: apps/transactions/models.py:186 +#: apps/transactions/models.py:267 msgid "Weekly" msgstr "Semanal" -#: apps/transactions/models.py:187 +#: apps/transactions/models.py:268 msgid "Daily" msgstr "Diária" -#: apps/transactions/models.py:200 +#: apps/transactions/models.py:281 msgid "Number of Installments" msgstr "Número de Parcelas" -#: apps/transactions/models.py:205 +#: apps/transactions/models.py:286 msgid "Installment Start" msgstr "Parcela inicial" -#: apps/transactions/models.py:206 +#: apps/transactions/models.py:287 msgid "The installment number to start counting from" msgstr "O número da parcela a partir do qual se inicia a contagem" -#: apps/transactions/models.py:211 apps/transactions/models.py:426 +#: apps/transactions/models.py:292 apps/transactions/models.py:507 msgid "Start Date" msgstr "Data de Início" -#: apps/transactions/models.py:215 apps/transactions/models.py:427 +#: apps/transactions/models.py:296 apps/transactions/models.py:508 msgid "End Date" msgstr "Data Final" -#: apps/transactions/models.py:220 +#: apps/transactions/models.py:301 msgid "Recurrence" msgstr "Recorrência" -#: apps/transactions/models.py:223 +#: apps/transactions/models.py:304 msgid "Installment Amount" msgstr "Valor da Parcela" -#: apps/transactions/models.py:243 templates/includes/navbar.html:62 +#: apps/transactions/models.py:324 templates/includes/navbar.html:62 #: templates/installment_plans/fragments/list.html:5 #: templates/installment_plans/pages/index.html:4 msgid "Installment Plans" msgstr "Parcelamentos" -#: apps/transactions/models.py:385 +#: apps/transactions/models.py:466 msgid "day(s)" msgstr "dia(s)" -#: apps/transactions/models.py:386 +#: apps/transactions/models.py:467 msgid "week(s)" msgstr "semana(s)" -#: apps/transactions/models.py:387 +#: apps/transactions/models.py:468 msgid "month(s)" msgstr "mês(es)" -#: apps/transactions/models.py:388 +#: apps/transactions/models.py:469 msgid "year(s)" msgstr "ano(s)" -#: apps/transactions/models.py:390 +#: apps/transactions/models.py:471 #: templates/recurring_transactions/fragments/list.html:24 msgid "Paused" msgstr "Pausado" -#: apps/transactions/models.py:429 +#: apps/transactions/models.py:510 msgid "Recurrence Type" msgstr "Tipo de recorrência" -#: apps/transactions/models.py:432 +#: apps/transactions/models.py:513 msgid "Recurrence Interval" msgstr "Intervalo de recorrência" -#: apps/transactions/models.py:436 +#: apps/transactions/models.py:517 msgid "Last Generated Date" msgstr "Última data gerada" -#: apps/transactions/models.py:439 +#: apps/transactions/models.py:520 msgid "Last Generated Reference Date" msgstr "Última data de referência gerada" -#: apps/transactions/models.py:444 templates/includes/navbar.html:64 +#: apps/transactions/models.py:525 templates/includes/navbar.html:64 #: templates/recurring_transactions/fragments/list.html:5 #: templates/recurring_transactions/pages/index.html:4 msgid "Recurring Transactions" @@ -889,99 +977,99 @@ msgstr "%(value)s tem muitas casas decimais. O máximo é 30." msgid "%(value)s is not a non-negative number" msgstr "%(value)s não é um número positivo" -#: apps/transactions/views/categories.py:66 +#: apps/transactions/views/categories.py:64 msgid "Category added successfully" msgstr "Categoria adicionada com sucesso" -#: apps/transactions/views/categories.py:94 +#: apps/transactions/views/categories.py:92 msgid "Category updated successfully" msgstr "Categoria atualizada com sucesso" -#: apps/transactions/views/categories.py:121 +#: apps/transactions/views/categories.py:118 msgid "Category deleted successfully" msgstr "Categoria apagada com sucesso" -#: apps/transactions/views/entities.py:65 +#: apps/transactions/views/entities.py:64 msgid "Entity added successfully" msgstr "Entidade adicionada com sucesso" -#: apps/transactions/views/entities.py:93 +#: apps/transactions/views/entities.py:92 msgid "Entity updated successfully" msgstr "Entidade atualizada com sucesso" -#: apps/transactions/views/entities.py:120 +#: apps/transactions/views/entities.py:118 msgid "Entity deleted successfully" msgstr "Entidade apagada com sucesso" -#: apps/transactions/views/installment_plans.py:88 +#: apps/transactions/views/installment_plans.py:87 msgid "Installment Plan added successfully" msgstr "Parcelamento adicionado com sucesso" -#: apps/transactions/views/installment_plans.py:118 +#: apps/transactions/views/installment_plans.py:117 msgid "Installment Plan updated successfully" msgstr "Parcelamento atualizado com sucesso" -#: apps/transactions/views/installment_plans.py:143 +#: apps/transactions/views/installment_plans.py:142 msgid "Installment Plan refreshed successfully" msgstr "Parcelamento atualizado com sucesso" -#: apps/transactions/views/installment_plans.py:162 +#: apps/transactions/views/installment_plans.py:160 msgid "Installment Plan deleted successfully" msgstr "Parcelamento apagado com sucesso" -#: apps/transactions/views/recurring_transactions.py:114 +#: apps/transactions/views/recurring_transactions.py:112 msgid "Recurring Transaction added successfully" msgstr "Transação Recorrente adicionada com sucesso" -#: apps/transactions/views/recurring_transactions.py:146 +#: apps/transactions/views/recurring_transactions.py:144 msgid "Recurring Transaction updated successfully" msgstr "Transação Recorrente atualizada com sucesso" -#: apps/transactions/views/recurring_transactions.py:192 +#: apps/transactions/views/recurring_transactions.py:190 msgid "Recurring transaction unpaused successfully" msgstr "Transação Recorrente despausada com sucesso" -#: apps/transactions/views/recurring_transactions.py:195 +#: apps/transactions/views/recurring_transactions.py:193 msgid "Recurring transaction paused successfully" msgstr "Transação Recorrente pausada com sucesso" -#: apps/transactions/views/recurring_transactions.py:221 +#: apps/transactions/views/recurring_transactions.py:219 msgid "Recurring transaction finished successfully" msgstr "Transação Recorrente finalizada com sucesso" -#: apps/transactions/views/recurring_transactions.py:242 +#: apps/transactions/views/recurring_transactions.py:239 msgid "Recurring Transaction deleted successfully" msgstr "Transação Recorrente apagada com sucesso" -#: apps/transactions/views/tags.py:65 +#: apps/transactions/views/tags.py:64 msgid "Tag added successfully" msgstr "Tag adicionada com sucesso" -#: apps/transactions/views/tags.py:93 +#: apps/transactions/views/tags.py:92 msgid "Tag updated successfully" msgstr "Tag atualizada com sucesso" -#: apps/transactions/views/tags.py:120 +#: apps/transactions/views/tags.py:118 msgid "Tag deleted successfully" msgstr "Tag apagada com sucesso" -#: apps/transactions/views/transactions.py:47 +#: apps/transactions/views/transactions.py:46 msgid "Transaction added successfully" msgstr "Transação adicionada com sucesso" -#: apps/transactions/views/transactions.py:79 +#: apps/transactions/views/transactions.py:78 msgid "Transaction updated successfully" msgstr "Transação atualizada com sucesso" -#: apps/transactions/views/transactions.py:110 +#: apps/transactions/views/transactions.py:109 msgid "Transaction duplicated successfully" msgstr "Transação duplicada com sucesso" -#: apps/transactions/views/transactions.py:153 +#: apps/transactions/views/transactions.py:151 msgid "Transaction deleted successfully" msgstr "Transação apagada com sucesso" -#: apps/transactions/views/transactions.py:179 +#: apps/transactions/views/transactions.py:177 msgid "Transfer added successfully" msgstr "Transferência adicionada com sucesso" @@ -1110,7 +1198,7 @@ msgstr "Editar grupo de conta" #: templates/dca/fragments/strategy/details.html:64 #: templates/entities/fragments/table.html:23 #: templates/exchange_rates/fragments/table.html:20 -#: templates/import_app/fragments/list.html:37 +#: templates/import_app/fragments/profiles/list.html:44 #: templates/installment_plans/fragments/table.html:23 #: templates/recurring_transactions/fragments/table.html:25 #: templates/rules/fragments/list.html:33 @@ -1127,7 +1215,7 @@ msgstr "Ações" #: templates/dca/fragments/strategy/list.html:34 #: templates/entities/fragments/table.html:28 #: templates/exchange_rates/fragments/table.html:24 -#: templates/import_app/fragments/list.html:41 +#: templates/import_app/fragments/profiles/list.html:48 #: templates/installment_plans/fragments/table.html:27 #: templates/recurring_transactions/fragments/table.html:29 #: templates/rules/fragments/transaction_rule/view.html:22 @@ -1146,7 +1234,8 @@ msgstr "Editar" #: templates/dca/fragments/strategy/list.html:42 #: templates/entities/fragments/table.html:36 #: templates/exchange_rates/fragments/table.html:32 -#: templates/import_app/fragments/list.html:48 +#: templates/import_app/fragments/profiles/list.html:69 +#: templates/import_app/fragments/runs/list.html:102 #: templates/installment_plans/fragments/table.html:56 #: templates/mini_tools/unit_price_calculator.html:18 #: templates/recurring_transactions/fragments/table.html:91 @@ -1166,7 +1255,8 @@ msgstr "Apagar" #: templates/dca/fragments/strategy/list.html:46 #: templates/entities/fragments/table.html:40 #: templates/exchange_rates/fragments/table.html:37 -#: templates/import_app/fragments/list.html:52 +#: templates/import_app/fragments/profiles/list.html:73 +#: templates/import_app/fragments/runs/list.html:106 #: templates/installment_plans/fragments/table.html:48 #: templates/installment_plans/fragments/table.html:60 #: templates/recurring_transactions/fragments/table.html:53 @@ -1189,7 +1279,7 @@ msgstr "Tem certeza?" #: templates/dca/fragments/strategy/list.html:47 #: templates/entities/fragments/table.html:41 #: templates/exchange_rates/fragments/table.html:38 -#: templates/import_app/fragments/list.html:53 +#: templates/import_app/fragments/profiles/list.html:74 #: templates/rules/fragments/list.html:49 #: templates/rules/fragments/transaction_rule/view.html:61 #: templates/tags/fragments/table.html:41 @@ -1205,7 +1295,8 @@ msgstr "Você não será capaz de reverter isso!" #: templates/dca/fragments/strategy/list.html:48 #: templates/entities/fragments/table.html:42 #: templates/exchange_rates/fragments/table.html:39 -#: templates/import_app/fragments/list.html:54 +#: templates/import_app/fragments/profiles/list.html:75 +#: templates/import_app/fragments/runs/list.html:108 #: templates/installment_plans/fragments/table.html:62 #: templates/recurring_transactions/fragments/table.html:98 #: templates/rules/fragments/list.html:50 @@ -1219,22 +1310,18 @@ msgid "No account groups" msgstr "Nenhum grupo de conta" #: templates/accounts/fragments/account_reconciliation.html:6 -#: templates/import_app/fragments/account_reconciliation.html:6 msgid "Account Reconciliation" msgstr "Reconciliação do saldo" #: templates/accounts/fragments/account_reconciliation.html:26 -#: templates/import_app/fragments/account_reconciliation.html:26 msgid "Current balance" msgstr "Saldo atual" #: templates/accounts/fragments/account_reconciliation.html:39 -#: templates/import_app/fragments/account_reconciliation.html:39 msgid "Difference" msgstr "Diferença" #: templates/accounts/fragments/account_reconciliation.html:70 -#: templates/import_app/fragments/account_reconciliation.html:70 msgid "Reconcile balances" msgstr "Reconciliar saldos" @@ -1247,12 +1334,10 @@ msgid "Edit account" msgstr "Editar conta" #: templates/accounts/fragments/list.html:29 -#: templates/import_app/fragments/list.html:29 msgid "Is Asset" msgstr "É ativo" #: templates/accounts/fragments/list.html:70 -#: templates/import_app/fragments/list.html:70 msgid "No accounts" msgstr "Nenhuma conta" @@ -1343,6 +1428,7 @@ msgid "Close" msgstr "Fechar" #: templates/cotton/config/search.html:6 +#: templates/import_app/fragments/profiles/list_presets.html:13 msgid "Search" msgstr "Buscar" @@ -1607,6 +1693,97 @@ msgstr "Nenhuma taxa de câmbio" msgid "Page navigation" msgstr "Navegação por página" +#: templates/import_app/fragments/profiles/add.html:6 +msgid "Add new import profile" +msgstr "Adicionar novo perfil de importação" + +#: templates/import_app/fragments/profiles/add.html:11 +msgid "A message from the author" +msgstr "Uma mensagem do autor" + +#: templates/import_app/fragments/profiles/edit.html:5 +msgid "Edit import profile" +msgstr "Editar perfil de importação" + +#: templates/import_app/fragments/profiles/list.html:5 +#: templates/import_app/pages/profiles_index.html:4 +msgid "Import Profiles" +msgstr "Perfis de Importação" + +#: templates/import_app/fragments/profiles/list.html:17 +msgid "New" +msgstr "Novo" + +#: templates/import_app/fragments/profiles/list.html:21 +msgid "From preset" +msgstr "A partir de uma predefinição" + +#: templates/import_app/fragments/profiles/list.html:55 +msgid "Runs" +msgstr "Importações" + +#: templates/import_app/fragments/profiles/list.html:86 +msgid "No import profiles" +msgstr "Nenhum perfil de importação" + +#: templates/import_app/fragments/profiles/list_presets.html:5 +msgid "Import Presets" +msgstr "Predefinições de Importação" + +#: templates/import_app/fragments/profiles/list_presets.html:33 +msgid "By" +msgstr "Por" + +#: templates/import_app/fragments/profiles/list_presets.html:40 +msgid "No presets yet" +msgstr "Nenhuma predefinição de importação ainda" + +#: templates/import_app/fragments/runs/add.html:5 +msgid "Import file with profile" +msgstr "Importar aqui com Perfil" + +#: templates/import_app/fragments/runs/list.html:5 +msgid "Runs for" +msgstr "Importações para" + +#: templates/import_app/fragments/runs/list.html:29 +msgid "Total Items" +msgstr "Itens Totais" + +#: templates/import_app/fragments/runs/list.html:42 +msgid "Processed Items" +msgstr "Itens Processados" + +#: templates/import_app/fragments/runs/list.html:55 +msgid "Skipped Items" +msgstr "Itens Pulados" + +#: templates/import_app/fragments/runs/list.html:68 +msgid "Failed Items" +msgstr "Itens Falhados" + +#: templates/import_app/fragments/runs/list.html:81 +msgid "Successful Items" +msgstr "Itens Bem-sucedidos" + +#: templates/import_app/fragments/runs/list.html:96 +msgid "Logs" +msgstr "Logs" + +#: templates/import_app/fragments/runs/list.html:107 +msgid "You won't be able to revert this! All imported items will be kept." +msgstr "" +"Você não será capaz de reverter isso! Todos os itens importados serão " +"mantidos." + +#: templates/import_app/fragments/runs/list.html:116 +msgid "No runs yet" +msgstr "Nenhuma importação ainda" + +#: templates/import_app/fragments/runs/log.html:5 +msgid "Logs for" +msgstr "Logs para" + #: templates/includes/navbar.html:10 msgid "Toggle navigation" msgstr "Alternar navegação" @@ -1652,15 +1829,15 @@ msgstr "Automação" msgid "Rules" msgstr "Regras" -#: templates/includes/navbar.html:132 +#: templates/includes/navbar.html:134 msgid "Only use this if you know what you're doing" msgstr "Só use isso se você souber o que está fazendo" -#: templates/includes/navbar.html:133 +#: templates/includes/navbar.html:135 msgid "Django Admin" msgstr "Django Admin" -#: templates/includes/navbar.html:142 +#: templates/includes/navbar.html:144 msgid "Calculator" msgstr "Calculadora" @@ -1697,11 +1874,6 @@ msgstr "Adicionar parcelamento" msgid "Edit installment plan" msgstr "Editar parcelamento" -#: templates/installment_plans/fragments/list.html:24 -#: templates/recurring_transactions/fragments/list.html:27 -msgid "Finished" -msgstr "Finalizado" - #: templates/installment_plans/fragments/list_transactions.html:5 #: templates/installment_plans/fragments/table.html:35 msgid "Installments" @@ -2077,6 +2249,11 @@ msgstr "Visão Anual" msgid "Year" msgstr "Ano" +#, fuzzy +#~| msgid "Important dates" +#~ msgid "Import Runs" +#~ msgstr "Datas importantes" + #~ msgid "This will stop the creation of new transactions" #~ msgstr "Isso interromperá a criação de novas transações" diff --git a/app/templates/import_app/fragments/runs/list.html b/app/templates/import_app/fragments/runs/list.html index f67054c..16cd054 100644 --- a/app/templates/import_app/fragments/runs/list.html +++ b/app/templates/import_app/fragments/runs/list.html @@ -2,7 +2,7 @@ {% load i18n %} {% load crispy_forms_tags %} -{% block title %}{% translate 'Runs for ' %}{{ profile.name }}{% endblock %} +{% block title %}{% translate 'Runs for' %} {{ profile.name }}{% endblock %} {% block body %}
-{% endblock %} From e72d6cd1eacde58ea99383c7b3b4450cc26be60b Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Fri, 24 Jan 2025 22:42:01 -0300 Subject: [PATCH 03/17] fix(transactions:filter): unaligned filter buttons --- .../transactions/widgets/transaction_type_filter_buttons.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/transactions/widgets/transaction_type_filter_buttons.html b/app/templates/transactions/widgets/transaction_type_filter_buttons.html index a96ac2c..5824325 100644 --- a/app/templates/transactions/widgets/transaction_type_filter_buttons.html +++ b/app/templates/transactions/widgets/transaction_type_filter_buttons.html @@ -15,7 +15,7 @@ id="{{ field.html_name }}_{{ forloop.counter }}" value="{{ choice.0 }}" {% if choice.0 in field.value %}checked{% endif %}> - From 6c60c3659c7379f75b6c3ed0141e20fd7c2239c9 Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Fri, 24 Jan 2025 22:47:00 -0300 Subject: [PATCH 04/17] feat(transactions): new is_paid switch --- app/apps/transactions/forms.py | 2 +- .../widgets/paid_toggle_button.html | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 app/templates/transactions/widgets/paid_toggle_button.html diff --git a/app/apps/transactions/forms.py b/app/apps/transactions/forms.py index 83de81d..6fbdcff 100644 --- a/app/apps/transactions/forms.py +++ b/app/apps/transactions/forms.py @@ -115,7 +115,7 @@ class TransactionForm(forms.ModelForm): "type", template="transactions/widgets/income_expense_toggle_buttons.html", ), - Switch("is_paid"), + Field("is_paid", template="transactions/widgets/paid_toggle_button.html"), Row( Column("account", css_class="form-group col-md-6 mb-0"), Column("entities", css_class="form-group col-md-6 mb-0"), diff --git a/app/templates/transactions/widgets/paid_toggle_button.html b/app/templates/transactions/widgets/paid_toggle_button.html new file mode 100644 index 0000000..bcd8877 --- /dev/null +++ b/app/templates/transactions/widgets/paid_toggle_button.html @@ -0,0 +1,18 @@ +{% load i18n %} +{% load crispy_forms_field %} + +
+
+ + + + + +
+ + {% if field.help_text %} +
{{ field.help_text|safe }}
+ {% endif %} +
\ No newline at end of file From 9c4ba3a6deecdbf4b6fbc4c0f6a12b6dc67b36b5 Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Fri, 24 Jan 2025 22:48:24 -0300 Subject: [PATCH 05/17] fix(transactions): unaligned type button --- .../transactions/widgets/income_expense_toggle_buttons.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/transactions/widgets/income_expense_toggle_buttons.html b/app/templates/transactions/widgets/income_expense_toggle_buttons.html index bb75d80..6630eb8 100644 --- a/app/templates/transactions/widgets/income_expense_toggle_buttons.html +++ b/app/templates/transactions/widgets/income_expense_toggle_buttons.html @@ -9,7 +9,7 @@ id="{{ field.html_name }}_{{ forloop.counter }}_tr" value="{{ choice.0 }}" {% if choice.0 == field.value %}checked{% endif %}> - From 0857b44fc33c74aabacce00e9143f8bbdf1fa68c Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Fri, 24 Jan 2025 22:50:39 -0300 Subject: [PATCH 06/17] feat: add new /add/ endpoint for quickly adding new transactions --- app/WYGIWYH/settings.py | 8 +++- app/apps/transactions/forms.py | 44 ++++++++++++++++++++- app/apps/transactions/urls.py | 5 +++ app/apps/transactions/views/transactions.py | 44 +++++++++++++++++++++ app/templates/transactions/pages/add.html | 15 +++++++ 5 files changed, 113 insertions(+), 3 deletions(-) create mode 100644 app/templates/transactions/pages/add.html diff --git a/app/WYGIWYH/settings.py b/app/WYGIWYH/settings.py index 6875bc0..bb5ddf1 100644 --- a/app/WYGIWYH/settings.py +++ b/app/WYGIWYH/settings.py @@ -363,7 +363,13 @@ PWA_APP_SPLASH_SCREEN = [ ] PWA_APP_DIR = "ltr" PWA_APP_LANG = "en-US" -PWA_APP_SHORTCUTS = [] +PWA_APP_SHORTCUTS = [ + { + "name": "New Transaction", + "url": "/add/", + "description": "Add new transaction", + } +] PWA_APP_SCREENSHOTS = [ { "src": "/static/img/pwa/splash-750x1334.png", diff --git a/app/apps/transactions/forms.py b/app/apps/transactions/forms.py index 6fbdcff..50ba2f1 100644 --- a/app/apps/transactions/forms.py +++ b/app/apps/transactions/forms.py @@ -1,5 +1,5 @@ -from crispy_bootstrap5.bootstrap5 import Switch -from crispy_forms.bootstrap import FormActions +from crispy_bootstrap5.bootstrap5 import Switch, BS5Accordion +from crispy_forms.bootstrap import FormActions, AccordionGroup from crispy_forms.helper import FormHelper from crispy_forms.layout import ( Layout, @@ -136,6 +136,46 @@ class TransactionForm(forms.ModelForm): "notes", ) + self.helper_simple = FormHelper() + self.helper_simple.form_tag = False + self.helper_simple.form_method = "post" + self.helper_simple.layout = Layout( + Field( + "type", + template="transactions/widgets/income_expense_toggle_buttons.html", + ), + Field("is_paid", template="transactions/widgets/paid_toggle_button.html"), + "account", + Row( + Column(Field("date"), css_class="form-group col-md-6 mb-0"), + Column(Field("reference_date"), css_class="form-group col-md-6 mb-0"), + css_class="form-row", + ), + "description", + Field("amount", inputmode="decimal"), + BS5Accordion( + AccordionGroup( + _("More"), + "entities", + Row( + Column("category", css_class="form-group col-md-6 mb-0"), + Column("tags", css_class="form-group col-md-6 mb-0"), + css_class="form-row", + ), + "notes", + active=False, + ), + flush=False, + always_open=False, + css_class="mb-3", + ), + FormActions( + NoClassSubmit( + "submit", _("Add"), css_class="btn btn-outline-primary w-100" + ), + ), + ) + self.fields["reference_date"].required = False self.fields["date"].widget = AirDatePickerInput(clear_button=False, user=user) diff --git a/app/apps/transactions/urls.py b/app/apps/transactions/urls.py index 44a6884..d9a524c 100644 --- a/app/apps/transactions/urls.py +++ b/app/apps/transactions/urls.py @@ -51,6 +51,11 @@ urlpatterns = [ views.transaction_add, name="transaction_add", ), + path( + "add/", + views.transaction_simple_add, + name="transaction_simple_add", + ), path( "transactions/transfer", views.transactions_transfer, diff --git a/app/apps/transactions/views/transactions.py b/app/apps/transactions/views/transactions.py index d6c3b83..f07442e 100644 --- a/app/apps/transactions/views/transactions.py +++ b/app/apps/transactions/views/transactions.py @@ -65,6 +65,50 @@ def transaction_add(request): ) +@login_required +@require_http_methods(["GET", "POST"]) +def transaction_simple_add(request): + month = int(request.GET.get("month", timezone.localdate(timezone.now()).month)) + year = int(request.GET.get("year", timezone.localdate(timezone.now()).year)) + transaction_type = Transaction.Type(request.GET.get("type", "IN")) + + now = timezone.localdate(timezone.now()) + expected_date = datetime.datetime( + day=now.day if month == now.month and year == now.year else 1, + month=month, + year=year, + ).date() + + if request.method == "POST": + form = TransactionForm(request.POST, user=request.user) + if form.is_valid(): + form.save() + messages.success(request, _("Transaction added successfully")) + + form = TransactionForm( + user=request.user, + initial={ + "date": expected_date, + "type": transaction_type, + }, + ) + + else: + form = TransactionForm( + user=request.user, + initial={ + "date": expected_date, + "type": transaction_type, + }, + ) + + return render( + request, + "transactions/pages/add.html", + {"form": form}, + ) + + @only_htmx @login_required @require_http_methods(["GET", "POST"]) diff --git a/app/templates/transactions/pages/add.html b/app/templates/transactions/pages/add.html new file mode 100644 index 0000000..011ea04 --- /dev/null +++ b/app/templates/transactions/pages/add.html @@ -0,0 +1,15 @@ +{% extends 'layouts/base.html' %} +{% load crispy_forms_tags %} +{% load i18n %} + +{% block title %}{% translate 'New transaction' %}{% endblock %} + +{% block content %} +
+
+ {% crispy form form.helper_simple %} +
+
+{% endblock %} From d030f9686b2d73cac4d4891121b5c6afffeb14e8 Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Fri, 24 Jan 2025 22:55:36 -0300 Subject: [PATCH 07/17] refactor: add end slashes for some urls without --- app/apps/rules/urls.py | 15 --------------- app/apps/transactions/urls.py | 14 +++++++------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/app/apps/rules/urls.py b/app/apps/rules/urls.py index 7dc9a1c..13b7e5f 100644 --- a/app/apps/rules/urls.py +++ b/app/apps/rules/urls.py @@ -52,19 +52,4 @@ urlpatterns = [ views.transaction_rule_action_delete, name="transaction_rule_action_delete", ), - # path( - # "rules//transactions/", - # views.installment_plan_transactions, - # name="rule_view", - # ), - # path( - # "rules//edit/", - # views.installment_plan_edit, - # name="rule_edit", - # ), - # path( - # "rules//delete/", - # views.installment_plan_delete, - # name="rule_delete", - # ), ] diff --git a/app/apps/transactions/urls.py b/app/apps/transactions/urls.py index d9a524c..cefe36c 100644 --- a/app/apps/transactions/urls.py +++ b/app/apps/transactions/urls.py @@ -12,7 +12,7 @@ urlpatterns = [ name="transactions_all_summary", ), path( - "transactions/actions/pay", + "transactions/actions/pay/", views.bulk_pay_transactions, name="transactions_bulk_pay", ), @@ -27,27 +27,27 @@ urlpatterns = [ name="transactions_bulk_delete", ), path( - "transaction//pay", + "transaction//pay/", views.transaction_pay, name="transaction_pay", ), path( - "transaction//delete", + "transaction//delete/", views.transaction_delete, name="transaction_delete", ), path( - "transaction//edit", + "transaction//edit/", views.transaction_edit, name="transaction_edit", ), path( - "transaction//clone", + "transaction//clone/", views.transaction_clone, name="transaction_clone", ), path( - "transaction/add", + "transaction/add/", views.transaction_add, name="transaction_add", ), @@ -57,7 +57,7 @@ urlpatterns = [ name="transaction_simple_add", ), path( - "transactions/transfer", + "transactions/transfer/", views.transactions_transfer, name="transactions_transfer", ), From e71775292a2e10d241942be2b7751130d07f6d68 Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Sat, 25 Jan 2025 01:30:24 -0300 Subject: [PATCH 08/17] feat(transactions): proper clear button for filters --- .../includes/scripts/hyperscript/init_tom_select.html | 6 ++++++ app/templates/monthly_overview/pages/overview.html | 1 + app/templates/transactions/pages/transactions.html | 3 +-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/templates/includes/scripts/hyperscript/init_tom_select.html b/app/templates/includes/scripts/hyperscript/init_tom_select.html index 381d764..7a860b5 100644 --- a/app/templates/includes/scripts/hyperscript/init_tom_select.html +++ b/app/templates/includes/scripts/hyperscript/init_tom_select.html @@ -9,4 +9,10 @@ end end end + + on reset + for elm in + {% endfor %} +
+
+ {% crispy form %} +
+{% endblock %} diff --git a/app/templates/transactions/widgets/paid_toggle_button.html b/app/templates/transactions/widgets/paid_toggle_button.html index bcd8877..9b27b3a 100644 --- a/app/templates/transactions/widgets/paid_toggle_button.html +++ b/app/templates/transactions/widgets/paid_toggle_button.html @@ -15,4 +15,4 @@ {% if field.help_text %}
{{ field.help_text|safe }}
{% endif %} -
\ No newline at end of file + diff --git a/app/templates/transactions/widgets/unselectable_income_expense_toggle_buttons.html b/app/templates/transactions/widgets/unselectable_income_expense_toggle_buttons.html new file mode 100644 index 0000000..cec779c --- /dev/null +++ b/app/templates/transactions/widgets/unselectable_income_expense_toggle_buttons.html @@ -0,0 +1,40 @@ +{% load i18n %} +{% load crispy_forms_field %} + +
+
+ + + + {% for choice in field.field.choices %} + + + {% endfor %} +
+ {% if field.errors %} +
+ {% for error in field.errors %} + {{ error }} + {% endfor %} +
+ {% endif %} + {% if field.help_text %} + {{ field.help_text }} + {% endif %} +
diff --git a/app/templates/transactions/widgets/unselectable_paid_toggle_button.html b/app/templates/transactions/widgets/unselectable_paid_toggle_button.html new file mode 100644 index 0000000..847a147 --- /dev/null +++ b/app/templates/transactions/widgets/unselectable_paid_toggle_button.html @@ -0,0 +1,22 @@ +{% load i18n %} +{% load crispy_forms_field %} + +
+
+ + + + + + + + +
+ + {% if field.help_text %} +
{{ field.help_text|safe }}
+ {% endif %} +
From 2b6be8c6ac89898e230586aedecd6373e0450043 Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Sat, 25 Jan 2025 12:43:53 -0300 Subject: [PATCH 12/17] feat: tidy up transactions action bar --- app/apps/transactions/views/transactions.py | 3 - .../cotton/ui/transactions_action_bar.html | 78 ++++++++++++------- 2 files changed, 49 insertions(+), 32 deletions(-) diff --git a/app/apps/transactions/views/transactions.py b/app/apps/transactions/views/transactions.py index 80ac759..bde35b7 100644 --- a/app/apps/transactions/views/transactions.py +++ b/app/apps/transactions/views/transactions.py @@ -147,14 +147,12 @@ def transactions_bulk_edit(request): transaction_ids = request.GET.getlist("transactions") or request.POST.getlist( "transactions" ) - print(transaction_ids) # Load the selected transactions transactions = Transaction.objects.filter(id__in=transaction_ids) if request.method == "POST": form = BulkEditTransactionForm(request.POST, user=request.user) if form.is_valid(): - print(form.cleaned_data) # Apply changes from the form to all selected transactions for transaction in transactions: for field_name, value in form.cleaned_data.items(): @@ -168,7 +166,6 @@ def transactions_bulk_edit(request): else: setattr(transaction, field_name, value) - print(transaction.is_paid) transaction.save() transaction_updated.send(sender=transaction) diff --git a/app/templates/cotton/ui/transactions_action_bar.html b/app/templates/cotton/ui/transactions_action_bar.html index 50fed1d..6fd5e60 100644 --- a/app/templates/cotton/ui/transactions_action_bar.html +++ b/app/templates/cotton/ui/transactions_action_bar.html @@ -13,36 +13,57 @@
{% spaceless %} -
- - +
-
-
+
+
- + +
-
+
@@ -95,8 +116,7 @@ put Math.min.apply(Math, realAmountValues).toLocaleString(undefined, {minimumFractionDigits: 0, maximumFractionDigits: 40}) into #calc-menu-min's innerText put mean.toLocaleString(undefined, {minimumFractionDigits: 0, maximumFractionDigits: 40}) into #calc-menu-mean's innerText put flatAmountValues.length.toLocaleString(undefined, {minimumFractionDigits: 0, maximumFractionDigits: 40}) into #calc-menu-count's innerText - end" - > + end">
+