Compare commits

..

10 Commits

Author SHA1 Message Date
Herculino Trotta
05dd782df5 locale(Portuguese (Brazil)): update translation
Currently translated at 100.0% (694 of 694 strings)

Translation: WYGIWYH/App
Translate-URL: https://translations.herculino.com/projects/wygiwyh/app/pt_BR/
2025-09-07 14:17:42 +00:00
eitchtee
187fe43283 chore(locale): update translation files
[skip ci] Automatically generated by Django makemessages workflow
2025-09-07 13:08:56 +00:00
Herculino Trotta
cae73376db Merge pull request #358
feat(rules): many improvements
2025-09-07 10:07:19 -03:00
Herculino Trotta
7225454a6e Merge pull request #357
fix(ui): unable to CTRL + A amount fields
2025-09-05 23:05:49 -03:00
Herculino Trotta
70c8c1e07c fix(ui): unable to CTRL + A amount fields 2025-09-05 23:04:12 -03:00
sorcierwax
c392a2c988 locale(French): update translation
Currently translated at 100.0% (686 of 686 strings)

Translation: WYGIWYH/App
Translate-URL: https://translations.herculino.com/projects/wygiwyh/app/fr/
2025-09-01 06:17:42 +00:00
Dimitri Decrock
17ea859fd2 locale(Dutch): update translation
Currently translated at 100.0% (686 of 686 strings)

Translation: WYGIWYH/App
Translate-URL: https://translations.herculino.com/projects/wygiwyh/app/nl/
2025-09-01 06:17:42 +00:00
eitchtee
8aae6f928f chore(locale): update translation files
[skip ci] Automatically generated by Django makemessages workflow
2025-08-31 12:07:49 +00:00
Herculino Trotta
7c43b06b9f Merge pull request #356
feat(rules): add optional rules ordering
2025-08-31 09:07:07 -03:00
Herculino Trotta
e16e279911 Merge pull request #355
feat(rules): add rule function to fetch transactions totals and balance
2025-08-30 15:45:45 -03:00
14 changed files with 3398 additions and 2785 deletions

View File

@@ -82,16 +82,22 @@ class AccountForm(forms.ModelForm):
self.fields["group"].queryset = AccountGroup.objects.all()
if self.instance.id:
qs = Currency.objects.filter(
self.fields["currency"].queryset = Currency.objects.filter(
Q(is_archived=False) | Q(accounts=self.instance.id),
)
self.fields["exchange_currency"].queryset = Currency.objects.filter(
Q(is_archived=False) | Q(accounts=self.instance.id)
).distinct()
self.fields["currency"].queryset = qs
self.fields["exchange_currency"].queryset = qs
)
else:
qs = Currency.objects.filter(Q(is_archived=False))
self.fields["currency"].queryset = qs
self.fields["exchange_currency"].queryset = qs
self.fields["currency"].queryset = Currency.objects.filter(
Q(is_archived=False),
)
self.fields["exchange_currency"].queryset = Currency.objects.filter(
Q(is_archived=False)
)
self.helper = FormHelper()
self.helper.form_tag = False

View File

@@ -36,7 +36,7 @@ class ArbitraryDecimalDisplayNumberInput(forms.TextInput):
{
"x-data": "",
"x-mask:dynamic": f"$money($input, '{get_format('DECIMAL_SEPARATOR')}', '{get_format('THOUSAND_SEPARATOR')}', '30')",
"x-on:keyup": "$el.dispatchEvent(new Event('input'))",
"x-on:keyup": "if (!['Control', 'Shift', 'Alt', 'Meta'].includes($event.key) && !(($event.ctrlKey || $event.metaKey) && $event.key.toLowerCase() === 'a')) $el.dispatchEvent(new Event('input'))",
}
)

View File

@@ -1,7 +1,6 @@
import decimal
import logging
import traceback
from copy import deepcopy
from datetime import datetime, date
from decimal import Decimal
from itertools import chain
@@ -34,25 +33,14 @@ logger = logging.getLogger(__name__)
class DryRunResults:
def __init__(self, dry_run: bool):
def __init__(self):
self.results = []
self.dry_run = dry_run
def header(self, header: str, action):
if not self.dry_run:
return
result = {"type": "header", "header_type": header, "action": action}
self.results.append(result)
def triggering_transaction(self, instance):
if not self.dry_run:
return
if isinstance(instance, Transaction):
instance = instance.deepcopy()
elif isinstance(instance, dict):
instance = deepcopy(instance)
result = {
"type": "triggering_transaction",
"transaction": instance,
@@ -62,16 +50,9 @@ class DryRunResults:
def edit_transaction(
self, instance, action, old_value, new_value, field, tags, entities
):
if not self.dry_run:
return
if isinstance(instance, Transaction):
instance = instance.deepcopy()
elif isinstance(instance, dict):
instance = deepcopy(instance)
result = {
"type": "edit_transaction",
"transaction": instance,
"transaction": instance.deepcopy(),
"action": action,
"old_value": old_value,
"new_value": new_value,
@@ -91,14 +72,6 @@ class DryRunResults:
start_instance=None,
end_instance=None,
):
if not self.dry_run:
return
if isinstance(end_instance, Transaction):
start_instance = end_instance.deepcopy()
elif isinstance(end_instance, dict):
start_instance = deepcopy(end_instance)
result = {
"type": "update_or_create_transaction",
"start_transaction": start_instance,
@@ -112,9 +85,6 @@ class DryRunResults:
self.results.append(result)
def error(self, error, level: Literal["error", "warning", "info"] = "error"):
if not self.dry_run:
return
result = {
"type": "error",
"error": error,
@@ -277,10 +247,7 @@ def check_for_transaction_rules(
if searched_transactions.exists():
transaction = searched_transactions.first()
existing = True
if dry_run:
starting_instance = transaction.deepcopy()
starting_instance = transaction.deepcopy()
_log("Found at least one matching transaction, using latest:")
_log("{}".format(pformat(model_to_dict(transaction))))
else:
@@ -409,7 +376,7 @@ def check_for_transaction_rules(
dry_run_results.update_or_create_transaction(
start_instance=starting_instance,
end_instance=transaction,
end_instance=transaction.deepcopy(),
updated=existing,
action=processed_action,
query=search_query,
@@ -506,7 +473,7 @@ def check_for_transaction_rules(
)
dry_run_results.edit_transaction(
instance=transaction,
instance=transaction.deepcopy(),
action=processed_action,
old_value=original_value,
new_value=new_value,
@@ -522,7 +489,7 @@ def check_for_transaction_rules(
user = get_user_model().objects.get(id=user_id)
write_current_user(user)
logs = [] if dry_run else None
dry_run_results = DryRunResults(dry_run=dry_run)
dry_run_results = DryRunResults()
if dry_run and not rule_id:
raise Exception("Cannot dry run without a rule id")
@@ -540,7 +507,7 @@ def check_for_transaction_rules(
# Regular transaction processing for creates and updates
instance = Transaction.objects.get(id=instance_id)
dry_run_results.triggering_transaction(instance)
dry_run_results.triggering_transaction(instance.deepcopy())
functions = {
"relativedelta": relativedelta,

View File

@@ -15,11 +15,6 @@ class TransactionsGetter:
def __init__(self, **filters):
self.__queryset = Transaction.objects.filter(**filters)
def exclude(self, **exclude_filters):
self.__queryset = self.__queryset.exclude(**exclude_filters)
return self
@property
def sum(self):
return self.__queryset.aggregate(

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff