mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-02-25 08:54:52 +01:00
Compare commits
47 Commits
feat/bette
...
0.17.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2abeff31a | ||
|
|
666eaff167 | ||
|
|
d72454f854 | ||
|
|
333aa81923 | ||
|
|
41b8cfd1e7 | ||
|
|
1fa7985b01 | ||
|
|
38392a6322 | ||
|
|
637c62319b | ||
|
|
f91fe67629 | ||
|
|
9eb1818a20 | ||
|
|
50ac679e33 | ||
|
|
2a463c63b8 | ||
|
|
dce65f2faf | ||
|
|
a053cb3947 | ||
|
|
2d43072120 | ||
|
|
70bdee065e | ||
|
|
95db27a32f | ||
|
|
d6d4e6a102 | ||
|
|
bc0f30fead | ||
|
|
a9a86fc491 | ||
|
|
c3b5f2bf39 | ||
|
|
19128e5aed | ||
|
|
9b5c6d3413 | ||
|
|
73c873a2ad | ||
|
|
9d2be22a77 | ||
|
|
6a3d31f37d | ||
|
|
3be3a3c14b | ||
|
|
a5b0f4efb7 | ||
|
|
6da50db417 | ||
|
|
a6c1daf902 | ||
|
|
6a271fb3d7 | ||
|
|
2cf9a9dd0f | ||
|
|
0deaabe719 | ||
|
|
b14342af2e | ||
|
|
2c14ce6366 | ||
|
|
2dd887b0d9 | ||
|
|
8be7758dc0 | ||
|
|
05dd782df5 | ||
|
|
187fe43283 | ||
|
|
cae73376db | ||
|
|
7225454a6e | ||
|
|
70c8c1e07c | ||
|
|
c392a2c988 | ||
|
|
17ea859fd2 | ||
|
|
8aae6f928f | ||
|
|
7c43b06b9f | ||
|
|
e16e279911 |
@@ -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'))",
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -95,9 +95,9 @@ class DryRunResults:
|
||||
return
|
||||
|
||||
if isinstance(end_instance, Transaction):
|
||||
start_instance = end_instance.deepcopy()
|
||||
end_instance = end_instance.deepcopy()
|
||||
elif isinstance(end_instance, dict):
|
||||
start_instance = deepcopy(end_instance)
|
||||
end_instance = deepcopy(end_instance)
|
||||
|
||||
result = {
|
||||
"type": "update_or_create_transaction",
|
||||
@@ -213,6 +213,16 @@ def check_for_transaction_rules(
|
||||
f"{prefix}internal_id": transaction.internal_id,
|
||||
f"{prefix}is_deleted": transaction.deleted,
|
||||
f"{prefix}is_muted": transaction.mute,
|
||||
f"{prefix}is_recurring": transaction.recurring_transaction is not None,
|
||||
f"{prefix}is_installment": transaction.installment_plan is not None,
|
||||
f"{prefix}installment_number": (
|
||||
transaction.installment_id if transaction.installment_plan else None
|
||||
),
|
||||
f"{prefix}installment_total": (
|
||||
transaction.installment_plan.number_of_installments
|
||||
if transaction.installment_plan
|
||||
else None
|
||||
),
|
||||
}
|
||||
else:
|
||||
return {
|
||||
@@ -256,6 +266,12 @@ def check_for_transaction_rules(
|
||||
f"{prefix}internal_id": transaction.get("internal_id", ""),
|
||||
f"{prefix}is_deleted": transaction.get("deleted", True),
|
||||
f"{prefix}is_muted": transaction.get("mute", False),
|
||||
f"{prefix}is_recurring": transaction.get(
|
||||
"recurring_transaction", False
|
||||
),
|
||||
f"{prefix}is_installment": transaction.get("installment", False),
|
||||
f"{prefix}installment_number": transaction.get("installment_id"),
|
||||
f"{prefix}installment_total": transaction.get("installment_total"),
|
||||
}
|
||||
|
||||
def _process_update_or_create_transaction_action(processed_action):
|
||||
@@ -520,7 +536,8 @@ def check_for_transaction_rules(
|
||||
return transaction
|
||||
|
||||
user = get_user_model().objects.get(id=user_id)
|
||||
write_current_user(user)
|
||||
if not dry_run:
|
||||
write_current_user(user)
|
||||
logs = [] if dry_run else None
|
||||
dry_run_results = DryRunResults(dry_run=dry_run)
|
||||
|
||||
@@ -745,11 +762,12 @@ def check_for_transaction_rules(
|
||||
"** Error while executing 'check_for_transaction_rules' task",
|
||||
level="error",
|
||||
)
|
||||
delete_current_user()
|
||||
if not dry_run:
|
||||
delete_current_user()
|
||||
raise e
|
||||
|
||||
delete_current_user()
|
||||
if not dry_run:
|
||||
delete_current_user()
|
||||
|
||||
return logs, dry_run_results.results
|
||||
|
||||
|
||||
@@ -90,4 +90,12 @@ def serialize_transaction(sender: Transaction, deleted: bool):
|
||||
"internal_note": sender.internal_note,
|
||||
"internal_id": sender.internal_id,
|
||||
"mute": sender.mute,
|
||||
"installment_id": sender.installment_id if sender.installment_plan else None,
|
||||
"installment_total": (
|
||||
sender.installment_plan.number_of_installments
|
||||
if sender.installment_plan is not None
|
||||
else None
|
||||
),
|
||||
"installment": sender.installment_plan is not None,
|
||||
"recurring_transaction": sender.recurring_transaction is not None,
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import decimal
|
||||
import logging
|
||||
from copy import deepcopy
|
||||
|
||||
@@ -381,6 +382,9 @@ class Transaction(OwnedObject):
|
||||
default_manager_name = "objects"
|
||||
|
||||
def clean_fields(self, *args, **kwargs):
|
||||
if isinstance(self.amount, (str, int, float)):
|
||||
self.amount = decimal.Decimal(str(self.amount))
|
||||
|
||||
self.amount = truncate_decimal(
|
||||
value=self.amount, decimal_places=self.account.currency.decimal_places
|
||||
)
|
||||
|
||||
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
3510
app/locale/it/LC_MESSAGES/django.po
Normal file
3510
app/locale/it/LC_MESSAGES/django.po
Normal file
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
@@ -12,6 +12,4 @@
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{% static 'img/favicon/favicon-32x32.png' %}">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="{% static 'img/favicon/favicon-96x96.png' %}">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{% static 'img/favicon/favicon-16x16.png' %}">
|
||||
<meta name="msapplication-TileColor" content="#ffffff">
|
||||
<meta name="msapplication-TileImage" content="{% static 'img/favicon/ms-icon-144x144.png' %}">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
@@ -10,18 +10,10 @@
|
||||
<nav
|
||||
id="sidebar"
|
||||
hx-boost="true"
|
||||
hx-swap="transition:true"
|
||||
data-bs-scroll="true"
|
||||
class="offcanvas-lg offcanvas-start d-lg-flex flex-column position-fixed top-0 start-0 h-100 bg-body-tertiary shadow-sm tw:z-1020">
|
||||
|
||||
{# <div>#}
|
||||
{# <a href="{% url 'index' %}" class="d-none d-lg-flex tw:justify-start p-3 text-decoration-none sidebar-title">#}
|
||||
{# <img src="{% static 'img/logo-icon.svg' %}" alt="WYGIWYH Logo" height="30" width="30" title="WYGIWYH"/>#}
|
||||
{# <span class="fs-4 fw-bold ms-3">WYGIWYH</span>#}
|
||||
{# </a>#}
|
||||
{##}
|
||||
{##}
|
||||
{# </div>#}
|
||||
|
||||
<div class="d-none d-lg-flex tw:justify-between tw:items-center tw:border-b tw:border-gray-600 tw:lg:flex">
|
||||
<a href="{% url 'index' %}" class="m-0 d-none d-lg-flex tw:justify-start p-3 text-decoration-none sidebar-title">
|
||||
<img src="{% static 'img/logo-icon.svg' %}" alt="WYGIWYH Logo" height="30" width="30" title="WYGIWYH"/>
|
||||
@@ -154,16 +146,16 @@
|
||||
aria-controls="collapsible-panel"
|
||||
class="sidebar-menu-item tw:text-wrap tw:lg:text-nowrap tw:lg:text-sm d-flex align-items-center text-decoration-none p-2 rounded-3 sidebar-item {% active_link views='tags_index||entities_index||categories_index||accounts_index||account_groups_index||currencies_index||exchange_rates_index||rules_index||import_profiles_index||automatic_exchange_rates_index||export_index||users_index' css_class="sidebar-active" %}">
|
||||
<i class="fa-solid fa-toolbox fa-fw"></i>
|
||||
<span
|
||||
class="ms-3 fw-medium tw:lg:group-hover:truncate tw:lg:group-focus:truncate tw:lg:group-hover:text-ellipsis tw:lg:group-focus:text-ellipsis">
|
||||
{% translate 'Management' %}
|
||||
</span>
|
||||
<span class="ms-3 fw-medium tw:lg:group-hover:truncate tw:lg:group-focus:truncate tw:lg:group-hover:text-ellipsis tw:lg:group-focus:text-ellipsis">
|
||||
{% translate 'Management' %}
|
||||
</span>
|
||||
<i class="fa-solid fa-chevron-right fa-fw ms-auto pe-2"></i>
|
||||
</div>
|
||||
</ul>
|
||||
|
||||
<div class="mt-auto p-2 w-100">
|
||||
<div id="collapsible-panel"
|
||||
class="p-0 collapse tw:absolute tw:bottom-0 tw:left-0 tw:w-full tw:z-30 tw:max-h-dvh">
|
||||
class="p-0 collapse tw:absolute tw:bottom-0 tw:left-0 tw:w-full tw:z-30 tw:max-h-dvh {% active_link views='tags_index||entities_index||categories_index||accounts_index||account_groups_index||currencies_index||exchange_rates_index||rules_index||import_profiles_index||automatic_exchange_rates_index||export_index||users_index' css_class="show" %}">
|
||||
<div class="tw:h-dvh tw:backdrop-blur-3xl tw:flex tw:flex-col">
|
||||
<div
|
||||
class="tw:justify-between tw:items-center tw:p-4 tw:border-b tw:border-gray-600 sidebar-submenu-header">
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block title %}{% translate 'Edit transaction rule' %}{% endblock %}
|
||||
{% block title %}{% trans 'Test' %} - {% trans 'Create' %}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form hx-post="{% url 'transaction_rule_dry_run_created' pk=rule.id %}" hx-target="#generic-offcanvas"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block title %}{% translate 'Edit transaction rule' %}{% endblock %}
|
||||
{% block title %}{% trans 'Test' %} - {% trans 'Delete' %}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form hx-post="{% url 'transaction_rule_dry_run_deleted' pk=rule.id %}" hx-target="#generic-offcanvas"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block title %}{% translate 'Edit transaction rule' %}{% endblock %}
|
||||
{% block title %}{% trans 'Test' %} - {% trans 'Update' %}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form hx-post="{% url 'transaction_rule_dry_run_updated' pk=rule.id %}" hx-target="#generic-offcanvas"
|
||||
|
||||
Reference in New Issue
Block a user