Compare commits

..

19 Commits

Author SHA1 Message Date
Herculino Trotta
91904e959b Merge pull request #194
locale(de): update translation - thanks to @CocaCola2701
2025-02-25 10:53:25 -03:00
Herculino Trotta
a6a85ae3a2 locale(de): update translation - thanks to @CocaCola2701 2025-02-25 10:53:08 -03:00
Herculino Trotta
b0f53f45f9 Merge pull request #193
fix(rules): Update or Create Transaction rule unable to match againt dates and other types
2025-02-25 10:49:01 -03:00
Herculino Trotta
0f60f8d486 fix(rules): Update or Create Transaction rule unable to match againt dates and other types 2025-02-25 10:48:43 -03:00
Herculino Trotta
efb207a109 Merge pull request #191 from eitchtee/dev
locale: add en
2025-02-24 23:07:14 -03:00
Herculino Trotta
95b1481dd5 locale: add en 2025-02-24 23:06:15 -03:00
Herculino Trotta
8de340b68b Merge pull request #190
locale(de): enable Deutsch
2025-02-24 16:34:50 -03:00
Herculino Trotta
ef15b85386 fix(locale): transactions quick search placeholder is not translatable 2025-02-24 16:34:05 -03:00
Herculino Trotta
45d939237d locale(de): enable Deutsch 2025-02-24 16:33:14 -03:00
Herculino Trotta
6bf262e514 Merge pull request #189
style(transactions): improve look on wider columns
2025-02-22 23:21:45 -03:00
Herculino Trotta
f9d9137336 style(transactions): improve look on wider columns 2025-02-22 23:21:28 -03:00
Herculino Trotta
b532521f27 Merge pull request #188 from DragonHeart69/main
update dutch to V0.11.3
2025-02-22 23:17:11 -03:00
Dimitri Decrock
1e06e2d34d update dutch to V0.11.3 2025-02-22 15:04:47 +01:00
Herculino Trotta
a33fa5e184 Merge pull request #187 from eitchtee/dev
style(transactions): improve look on wider columns
2025-02-22 01:41:27 -03:00
Herculino Trotta
a2453695d8 style(transactions): improve look on wider columns 2025-02-22 01:41:02 -03:00
Herculino Trotta
3e929d0433 Merge pull request #186
style(transactions): improve look on wider columns
2025-02-22 01:18:35 -03:00
Herculino Trotta
185fc464a5 style(transactions): improve look on wider columns 2025-02-22 01:18:20 -03:00
Herculino Trotta
647c009525 Merge pull request #185
fix(insights:latest-transactions): order transactions from newest to oldest
2025-02-22 01:02:56 -03:00
Herculino Trotta
ba75492dcc fix(insights:latest-transactions): order transactions from newest to oldest 2025-02-22 01:02:35 -03:00
12 changed files with 3587 additions and 683 deletions

View File

@@ -163,6 +163,7 @@ AUTH_USER_MODEL = "users.User"
LANGUAGE_CODE = "en"
LANGUAGES = (
("de", "Deutsch"),
("en", "English"),
("nl", "Nederlands"),
("pt-br", "Português (Brasil)"),

View File

@@ -164,7 +164,9 @@ def category_sum_by_currency(request):
@require_http_methods(["GET"])
def latest_transactions(request):
limit = timezone.now() - relativedelta(days=3)
transactions = Transaction.objects.filter(created_at__gte=limit)[:30]
transactions = Transaction.objects.filter(created_at__gte=limit).order_by("-id")[
:30
]
return render(
request,

View File

@@ -297,10 +297,8 @@ class UpdateOrCreateTransactionRuleAction(models.Model):
search_query = Q()
def add_to_query(field_name, value, operator):
if isinstance(value, (int, str)):
lookup = f"{field_name}__{operator}"
return Q(**{lookup: value})
return Q()
lookup = f"{field_name}__{operator}"
return Q(**{lookup: value})
if self.search_account:
value = simple.eval(self.search_account)

View File

@@ -131,14 +131,16 @@ def _process_update_or_create_transaction_action(action, simple_eval):
# Build search query using the helper method
search_query = action.build_search_query(simple_eval)
logger.info("Searching transactions using: %s", search_query)
# Find latest matching transaction or create new
if search_query:
transaction = (
Transaction.objects.filter(search_query).order_by("-date", "-id").first()
)
transactions = Transaction.objects.filter(search_query).order_by("-date", "-id")
transaction = transactions.first()
logger.info("Found at least one matching transaction, using latest")
else:
transaction = None
logger.info("No matching transaction found, creating a new transaction")
if not transaction:
transaction = Transaction()

View File

@@ -0,0 +1,18 @@
# Generated by Django 5.1.6 on 2025-02-24 19:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0018_alter_usersettings_start_page'),
]
operations = [
migrations.AlterField(
model_name='usersettings',
name='language',
field=models.CharField(choices=[('auto', 'Auto'), ('de', 'Deutsch'), ('en', 'English'), ('nl', 'Nederlands'), ('pt-br', 'Português (Brasil)')], default='auto', max_length=10, verbose_name='Language'),
),
]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-02-19 23:05-0300\n"
"PO-Revision-Date: 2025-02-12 06:58+0100\n"
"POT-Creation-Date: 2025-02-24 16:30-0300\n"
"PO-Revision-Date: 2025-02-22 15:03+0100\n"
"Last-Translator: Dimitri Decrock <dimitri@fam-decrock.eu>\n"
"Language-Team: \n"
"Language: nl\n"
@@ -582,10 +582,8 @@ msgid "Services queued successfully"
msgstr "Diensten succesvol in de wachtrij geplaatst"
#: apps/dca/forms.py:65 apps/dca/forms.py:164
#, fuzzy
#| msgid "Deleted transactions"
msgid "Create transaction"
msgstr "Verwijderde verrichtingen"
msgstr "Maak verrichtingen"
#: apps/dca/forms.py:70 apps/transactions/forms.py:267
msgid "From Account"
@@ -602,31 +600,29 @@ msgstr "Uitgave Transactie"
#: apps/dca/forms.py:120 apps/dca/forms.py:130
msgid "Type to search for a transaction to link to this entry"
msgstr ""
"Type om een transactie te zoeken die aan dit item moet worden gekoppeld"
#: apps/dca/forms.py:126 apps/dca/models.py:177
msgid "Income Transaction"
msgstr "Ontvangsten Transactie"
#: apps/dca/forms.py:210
#, fuzzy
#| msgid "Edit transaction"
msgid "Link transaction"
msgstr "Bewerk verrichting"
msgstr "Koppel verrichting"
#: apps/dca/forms.py:279 apps/dca/forms.py:280 apps/dca/forms.py:285
#: apps/dca/forms.py:289
msgid "You must provide an account."
msgstr ""
msgstr "Je moet een account opgeven."
#: apps/dca/forms.py:294 apps/transactions/forms.py:414
msgid "From and To accounts must be different."
msgstr "Van en Naar rekening moeten verschillend zijn."
#: apps/dca/forms.py:308
#, fuzzy, python-format
#| msgid "DCA Strategies"
#, python-format
msgid "DCA for %(strategy_name)s"
msgstr "DCA Strategieën"
msgstr "DCA voor %(strategy_name)s"
#: apps/dca/models.py:17
msgid "Target Currency"
@@ -749,7 +745,7 @@ msgstr "Regels"
#: apps/export_app/forms.py:80 templates/cotton/transaction/item.html:56
msgid "DCA"
msgstr ""
msgstr "DCA"
#: apps/export_app/forms.py:86 apps/export_app/forms.py:147
#: templates/import_app/fragments/profiles/list.html:5
@@ -759,18 +755,16 @@ msgstr "Profielen importeren"
#: apps/export_app/forms.py:112 templates/export_app/fragments/export.html:5
#: templates/export_app/pages/index.html:15
#, fuzzy
#| msgid "Import"
msgid "Export"
msgstr "Importeer"
msgstr "Exporteer"
#: apps/export_app/forms.py:121
msgid "Import a ZIP file exported from WYGIWYH"
msgstr ""
msgstr "Importeer een ZIP-bestand geëxporteerd vanuit WYGIWYH"
#: apps/export_app/forms.py:122
msgid "ZIP File"
msgstr ""
msgstr "ZIP-bestand"
#: apps/export_app/forms.py:138 apps/rules/models.py:16
msgid "Transaction rules"
@@ -793,22 +787,22 @@ msgstr "Herstel"
#: apps/export_app/forms.py:187
msgid "Please upload either a ZIP file or at least one CSV file"
msgstr ""
msgstr "Upload een ZIP-bestand of ten minste één CSV-bestand"
#: apps/export_app/views.py:168
msgid "You have to select at least one export"
msgstr ""
msgstr "U moet ten minste één export selecteren"
#: apps/export_app/views.py:186
#, fuzzy
#| msgid "Tag updated successfully"
msgid "Data restored successfully"
msgstr "Label succesvol bijgewerkt"
msgstr "Gegevens succesvol hersteld"
#: apps/export_app/views.py:198
msgid ""
"There was an error restoring your data. Check the logs for more details."
msgstr ""
"Er is een fout opgetreden bij het herstellen van uw gegevens. Controleer de "
"logboeken voor meer details."
#: apps/import_app/forms.py:49
msgid "Select a file"
@@ -886,10 +880,8 @@ msgstr "Run met succes verwijderd"
#: apps/insights/forms.py:119 apps/insights/utils/sankey.py:36
#: apps/insights/utils/sankey.py:167
#, fuzzy
#| msgid "Categories"
msgid "Uncategorized"
msgstr "Categorieën"
msgstr "Ongecategoriseerd"
#: apps/insights/utils/category_explorer.py:66
#: apps/insights/utils/category_explorer.py:145
@@ -929,10 +921,8 @@ msgstr "Verwachte uitgaven"
#: apps/insights/utils/sankey.py:133 apps/insights/utils/sankey.py:134
#: apps/insights/utils/sankey.py:263 apps/insights/utils/sankey.py:264
#, fuzzy
#| msgid "Save"
msgid "Saved"
msgstr "Opslaan"
msgstr "Opgeslagen"
#: apps/rules/forms.py:20
msgid "Run on creation"
@@ -1085,13 +1075,12 @@ msgid "Filter"
msgstr "Filter"
#: apps/rules/models.py:85
#, fuzzy
msgid ""
"Generic expression to enable or disable execution. Should evaluate to True "
"or False"
msgstr ""
"Generieke expressie om uitvoering in of uit te schakelen. Moet evalueren "
"naar True of False"
"naar Waar of Onwaar"
#: apps/rules/models.py:289
msgid "Update or create transaction action"
@@ -1296,16 +1285,12 @@ msgid "No tags"
msgstr "Geen labels"
#: apps/transactions/models.py:324
#, fuzzy
#| msgid "No categories"
msgid "No category"
msgstr "Geen categorieën"
msgstr "Geen categorie"
#: apps/transactions/models.py:326
#, fuzzy
#| msgid "Description"
msgid "No description"
msgstr "Beschrijving"
msgstr "Geen Beschrijving"
#: apps/transactions/models.py:332
msgid "Yearly"
@@ -1910,6 +1895,7 @@ msgstr "Sluiten"
#: templates/cotton/config/search.html:6
#: templates/import_app/fragments/profiles/list_presets.html:13
#: templates/monthly_overview/pages/overview.html:177
msgid "Search"
msgstr "Zoeken"
@@ -2255,7 +2241,7 @@ msgstr "Geen diensten ingesteld"
#: templates/export_app/pages/index.html:4 templates/includes/navbar.html:136
msgid "Export and Restore"
msgstr ""
msgstr "Exporteren en Herstellen"
#: templates/import_app/fragments/profiles/add.html:6
msgid "Add new import profile"
@@ -2360,7 +2346,7 @@ msgstr "Huidige"
#: templates/includes/navbar.html:50
msgid "Insights"
msgstr ""
msgstr "Inzichten"
#: templates/includes/navbar.html:66
msgid "Trash Can"
@@ -2451,43 +2437,35 @@ msgstr "Geen informatie om weer te geven"
#: templates/insights/fragments/category_explorer/index.html:14
msgid "Income/Expense by Account"
msgstr ""
msgstr "Inkomsten/uitgaven per rekening"
#: templates/insights/fragments/category_explorer/index.html:26
#, fuzzy
#| msgid "Exchange Currency"
msgid "Income/Expense by Currency"
msgstr "Eenheid Wisselgeld"
msgstr "Inkomsten/uitgaven per Munteenheid"
#: templates/insights/fragments/late_transactions.html:15
msgid "All good!"
msgstr ""
msgstr "Allemaal goed!"
#: templates/insights/fragments/late_transactions.html:16
#, fuzzy
#| msgid "Filter transactions"
msgid "No late transactions"
msgstr "Filter verrichtingen"
msgstr "Geen betalingsachterstanden"
#: templates/insights/fragments/latest_transactions.html:14
#, fuzzy
#| msgid "No recurring transactions"
msgid "No recent transactions"
msgstr "Geen terugkerende verrichtingen"
msgstr "Geen recente betalingen"
#: templates/insights/fragments/sankey.html:93
msgid "From"
msgstr ""
msgstr "Van"
#: templates/insights/fragments/sankey.html:96
msgid "Percentage"
msgstr ""
msgstr "Percentage"
#: templates/insights/pages/index.html:35
#, fuzzy
#| msgid "Monthly"
msgid "Month"
msgstr "Maandelijks"
msgstr "Maand"
#: templates/insights/pages/index.html:38
#: templates/yearly_overview/pages/overview_by_account.html:61
@@ -2496,50 +2474,36 @@ msgid "Year"
msgstr "Jaar"
#: templates/insights/pages/index.html:43
#, fuzzy
#| msgid "Unchanged"
msgid "Month Range"
msgstr "Ongewijzigd"
msgstr "Maand Bereik"
#: templates/insights/pages/index.html:48
msgid "Year Range"
msgstr ""
msgstr "Jaar Bereik"
#: templates/insights/pages/index.html:53
#, fuzzy
#| msgid "Date and Time"
msgid "Date Range"
msgstr "Datum en Tijd"
msgstr "Datum Bereik"
#: templates/insights/pages/index.html:81
#, fuzzy
#| msgid "Account"
msgid "Account Flow"
msgstr "Rekening"
msgstr "Rekeningstroom"
#: templates/insights/pages/index.html:88
#, fuzzy
#| msgid "Currency Code"
msgid "Currency Flow"
msgstr "Munteenheids Code"
msgstr "Geldstroom"
#: templates/insights/pages/index.html:95
#, fuzzy
#| msgid "Category name"
msgid "Category Explorer"
msgstr "Naam van categorie"
msgstr "Categorie Verkenner"
#: templates/insights/pages/index.html:102
#, fuzzy
#| msgid "Transactions"
msgid "Late Transactions"
msgstr "Verrichtingen"
msgstr "Betalingsachterstanden"
#: templates/insights/pages/index.html:108
#, fuzzy
#| msgid "Transactions"
msgid "Latest Transactions"
msgstr "Verrichtingen"
msgstr "Laatste Verrichtingen"
#: templates/installment_plans/fragments/add.html:5
msgid "Add installment plan"
@@ -2903,6 +2867,26 @@ msgstr "Bedragen tonen"
msgid "Yearly Overview"
msgstr "Jaaroverzicht"
#, fuzzy
#~| msgid "From Amount"
#~ msgid "Principal Amount"
#~ msgstr "Van Bedrag"
#, fuzzy
#~| msgid "Interval"
#~ msgid "Interest"
#~ msgstr "Interval"
#, fuzzy
#~| msgid "Management"
#~ msgid "Loan Payment"
#~ msgstr "Beheer"
#, fuzzy
#~| msgid "Management"
#~ msgid "Loan Payments"
#~ msgstr "Beheer"
#, fuzzy
#~| msgid "Installment Plans"
#~ msgid "Installment Planss"
@@ -2963,11 +2947,6 @@ msgstr "Jaaroverzicht"
#~ msgid "Reference Date Operator"
#~ msgstr "Referentiedatum vanaf"
#, fuzzy
#~| msgid "From Amount"
#~ msgid "Search Amount"
#~ msgstr "Van Bedrag"
#, fuzzy
#~| msgid "Amount max"
#~ msgid "Amount Operator"

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-02-19 23:05-0300\n"
"POT-Creation-Date: 2025-02-24 16:30-0300\n"
"PO-Revision-Date: 2025-02-19 23:06-0300\n"
"Last-Translator: Herculino Trotta\n"
"Language-Team: \n"
@@ -1892,6 +1892,7 @@ msgstr "Fechar"
#: templates/cotton/config/search.html:6
#: templates/import_app/fragments/profiles/list_presets.html:13
#: templates/monthly_overview/pages/overview.html:177
msgid "Search"
msgstr "Buscar"
@@ -2861,6 +2862,26 @@ msgstr "Mostrar valores"
msgid "Yearly Overview"
msgstr "Visão Anual"
#, fuzzy
#~| msgid "From Amount"
#~ msgid "Principal Amount"
#~ msgstr "Quantia de origem"
#, fuzzy
#~| msgid "Interval"
#~ msgid "Interest"
#~ msgstr "Intervalo"
#, fuzzy
#~| msgid "Management"
#~ msgid "Loan Payment"
#~ msgstr "Gerenciar"
#, fuzzy
#~| msgid "Management"
#~ msgid "Loan Payments"
#~ msgstr "Gerenciar"
#, fuzzy
#~| msgid "Installment Plans"
#~ msgid "Installment Planss"
@@ -2926,11 +2947,6 @@ msgstr "Visão Anual"
#~ msgid "Reference Date Operator"
#~ msgstr "Data de Referência de"
#, fuzzy
#~| msgid "From Amount"
#~ msgid "Search Amount"
#~ msgstr "Quantia de origem"
#, fuzzy
#~| msgid "Amount max"
#~ msgid "Amount Operator"

View File

@@ -15,9 +15,9 @@
_="on mouseover remove .tw-invisible from the first .transaction-actions in me end
on mouseout add .tw-invisible to the first .transaction-actions in me end">
<div class="row font-monospace tw-text-sm align-items-center">
<div class="col-lg-1 col-12 d-flex align-items-center tw-text-2xl lg:tw-text-xl text-lg-center text-center">
<div class="col-lg-auto col-12 d-flex align-items-center tw-text-2xl lg:tw-text-xl text-lg-center text-center p-0 ps-1">
{% if not transaction.deleted %}
<a class="text-decoration-none my-lg-3 mx-lg-3 mx-2 my-2 tw-text-gray-500"
<a class="text-decoration-none p-3 tw-text-gray-500"
title="{% if transaction.is_paid %}{% trans 'Paid' %}{% else %}{% trans 'Projected' %}{% endif %}"
role="button"
hx-get="{% url 'transaction_pay' transaction_id=transaction.id %}"
@@ -27,14 +27,14 @@
class="fa-regular fa-circle"></i>{% endif %}
</a>
{% else %}
<div class="text-decoration-none my-lg-3 mx-lg-3 mx-2 my-2 tw-text-gray-500"
<div class="text-decoration-none p-3 tw-text-gray-500"
title="{% if transaction.is_paid %}{% trans 'Paid' %}{% else %}{% trans 'Projected' %}{% endif %}">
{% if transaction.is_paid %}<i class="fa-regular fa-circle-check"></i>{% else %}<i
class="fa-regular fa-circle"></i>{% endif %}
</div>
{% endif %}
</div>
<div class="col-lg-8 col-12">
<div class="col-lg col-12">
{# Date#}
<div class="row mb-2 mb-lg-1 tw-text-gray-400">
<div class="col-auto pe-1"><i class="fa-solid fa-calendar fa-fw me-1 fa-xs"></i></div>
@@ -92,7 +92,7 @@
{% endwith %}
</div>
</div>
<div class="col-lg-3 col-12 text-lg-end align-self-end">
<div class="col-lg-auto col-12 text-lg-end align-self-end">
<div class="main-amount mb-2 mb-lg-0">
<c-amount.display
:amount="transaction.amount"

View File

@@ -174,7 +174,7 @@
</div>
<div id="search" class="my-3">
<label class="w-100">
<input type="search" class="form-control" placeholder="Buscar" hx-preserve id="quick-search"
<input type="search" class="form-control" placeholder="{% translate 'Search' %}" hx-preserve id="quick-search"
_="on input or search or htmx:afterSwap from window
if my value is empty
trigger toggle on <.transactions-divider-collapse/>

View File

@@ -2,12 +2,14 @@ import AirDatepicker from 'air-datepicker';
import en from 'air-datepicker/locale/en';
import ptBr from 'air-datepicker/locale/pt-BR';
import nl from 'air-datepicker/locale/nl';
import de from 'air-datepicker/locale/de';
import {createPopper} from '@popperjs/core';
const locales = {
'pt': ptBr,
'en': en,
'nl': nl
'nl': nl,
'de': de
};
function isMobileDevice() {
@@ -43,7 +45,7 @@ window.DatePicker = function createDynamicDatePicker(element) {
toggleSelected: element.dataset.toggleSelected === 'true',
autoClose: element.dataset.autoClose === 'true',
buttons: element.dataset.clearButton === 'true' ? ['clear', todayButton] : [todayButton],
locale: locales[element.dataset.language],
locale: locales[element.dataset.language] || locales['en'],
onSelect: ({date, formattedDate, datepicker}) => {
const _event = new CustomEvent("change", {
bubbles: true,
@@ -117,7 +119,7 @@ window.MonthYearPicker = function createDynamicDatePicker(element) {
toggleSelected: element.dataset.toggleSelected === 'true',
autoClose: element.dataset.autoClose === 'true',
buttons: element.dataset.clearButton === 'true' ? ['clear', todayButton] : [todayButton],
locale: locales[element.dataset.language],
locale: locales[element.dataset.language] || locales['en'],
onSelect: ({date, formattedDate, datepicker}) => {
const _event = new CustomEvent("change", {
bubbles: true,
@@ -190,7 +192,7 @@ window.YearPicker = function createDynamicDatePicker(element) {
toggleSelected: element.dataset.toggleSelected === 'true',
autoClose: element.dataset.autoClose === 'true',
buttons: element.dataset.clearButton === 'true' ? ['clear', todayButton] : [todayButton],
locale: locales[element.dataset.language],
locale: locales[element.dataset.language] || locales['en'],
onSelect: ({date, formattedDate, datepicker}) => {
const _event = new CustomEvent("change", {
bubbles: true,