From e4169bd1c39be99871984f2b7ef59c37fa41bdfa Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Wed, 3 Jan 2024 15:52:36 +0100 Subject: [PATCH] Split columns for income and expenses --- .../locale/fr_FR/LC_MESSAGES/django.po | 4 +-- nummi/main/locale/fr_FR/LC_MESSAGES/django.po | 28 +++++++++--------- .../locale/fr_FR/LC_MESSAGES/django.po | 14 ++++----- .../locale/fr_FR/LC_MESSAGES/django.mo | Bin 1494 -> 1577 bytes .../locale/fr_FR/LC_MESSAGES/django.po | 27 ++++++++++------- .../transaction/transaction_table.html | 17 ++++++----- .../templatetags/transaction_extras.py | 10 +++++++ 7 files changed, 59 insertions(+), 41 deletions(-) diff --git a/nummi/history/locale/fr_FR/LC_MESSAGES/django.po b/nummi/history/locale/fr_FR/LC_MESSAGES/django.po index 50fde9f..c0e51e2 100644 --- a/nummi/history/locale/fr_FR/LC_MESSAGES/django.po +++ b/nummi/history/locale/fr_FR/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-02 15:52+0100\n" +"POT-Creation-Date: 2024-01-03 15:51+0100\n" "PO-Revision-Date: 2023-04-22 15:18+0200\n" "Last-Translator: Edgar P. Burkhart \n" "Language-Team: \n" @@ -29,6 +29,6 @@ msgstr "Dépenses" msgid "Income" msgstr "Revenus" -#: .\history\templates\history\plot.html:48 +#: .\history\templates\history\plot.html:55 msgid "Year" msgstr "Année" diff --git a/nummi/main/locale/fr_FR/LC_MESSAGES/django.po b/nummi/main/locale/fr_FR/LC_MESSAGES/django.po index 32068a8..1404f9b 100644 --- a/nummi/main/locale/fr_FR/LC_MESSAGES/django.po +++ b/nummi/main/locale/fr_FR/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-03 14:32+0100\n" +"POT-Creation-Date: 2024-01-03 15:51+0100\n" "PO-Revision-Date: 2023-04-23 08:03+0200\n" "Last-Translator: Edgar P. Burkhart \n" "Language-Team: \n" @@ -29,15 +29,15 @@ msgstr "Aller au contenu principal" msgid "Home" msgstr "Accueil" -#: .\main\templates\main\base.html:39 .\main\templates\main\index.html:60 +#: .\main\templates\main\base.html:39 msgid "Statements" msgstr "Relevés" -#: .\main\templates\main\base.html:45 .\main\templates\main\index.html:40 +#: .\main\templates\main\base.html:45 msgid "Transactions" msgstr "Transactions" -#: .\main\templates\main\base.html:51 +#: .\main\templates\main\base.html:51 .\main\templates\main\index.html:39 msgid "Create account" msgstr "Créer un compte" @@ -54,7 +54,7 @@ msgid "Create transaction" msgstr "Créer une transaction" #: .\main\templates\main\base.html:71 .\main\templates\main\list.html:10 -#: .\main\templates\main\list.html:36 +#: .\main\templates\main\list.html:34 msgid "Search" msgstr "Rechercher" @@ -105,31 +105,31 @@ msgstr "Créer" msgid "Save" msgstr "Enregistrer" -#: .\main\templates\main\index.html:12 +#: .\main\templates\main\index.html:13 msgid "Accounts" msgstr "Comptes" #: .\main\templates\main\index.html:17 -msgid "No account" -msgstr "Aucun compte" - -#: .\main\templates\main\index.html:23 msgid "Account" msgstr "Compte" -#: .\main\templates\main\index.html:24 +#: .\main\templates\main\index.html:18 msgid "Balance" msgstr "Solde" -#: .\main\templates\main\index.html:46 +#: .\main\templates\main\index.html:32 +msgid "No account" +msgstr "Aucun compte" + +#: .\main\templates\main\index.html:47 msgid "Categories" msgstr "Catégories" -#: .\main\templates\main\index.html:52 +#: .\main\templates\main\index.html:53 msgid "No category" msgstr "Aucune catégorie" -#: .\main\templates\main\index.html:66 +#: .\main\templates\main\index.html:62 msgid "History" msgstr "Historique" diff --git a/nummi/statement/locale/fr_FR/LC_MESSAGES/django.po b/nummi/statement/locale/fr_FR/LC_MESSAGES/django.po index cd3180d..f969e8b 100644 --- a/nummi/statement/locale/fr_FR/LC_MESSAGES/django.po +++ b/nummi/statement/locale/fr_FR/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-03 14:32+0100\n" +"POT-Creation-Date: 2024-01-03 15:51+0100\n" "PO-Revision-Date: 2023-04-22 15:22+0200\n" "Last-Translator: Edgar P. Burkhart \n" "Language-Team: \n" @@ -38,7 +38,7 @@ msgid "Start value" msgstr "Valeur initiale" #: .\statement\models.py:29 -#: .\statement\templates\statement\statement_table.html:23 +#: .\statement\templates\statement\statement_table.html:30 msgid "Difference" msgstr "Différence" @@ -66,7 +66,7 @@ msgid "Statements" msgstr "Relevés" #: .\statement\templates\statement\statement_form.html:4 -#: .\statement\templates\statement\statement_table.html:29 +#: .\statement\templates\statement\statement_table.html:18 msgid "Create statement" msgstr "Créer un relevé" @@ -79,19 +79,19 @@ msgid "Categories" msgstr "Catégories" #: .\statement\templates\statement\statement_form.html:27 -#: .\statement\templates\statement\statement_table.html:24 +#: .\statement\templates\statement\statement_table.html:31 msgid "Transactions" msgstr "Transactions" -#: .\statement\templates\statement\statement_table.html:18 +#: .\statement\templates\statement\statement_table.html:25 msgid "Date" msgstr "Date" -#: .\statement\templates\statement\statement_table.html:20 +#: .\statement\templates\statement\statement_table.html:27 msgid "Account" msgstr "Compte" -#: .\statement\templates\statement\statement_table.html:22 +#: .\statement\templates\statement\statement_table.html:29 msgid "Value" msgstr "Valeur" diff --git a/nummi/transaction/locale/fr_FR/LC_MESSAGES/django.mo b/nummi/transaction/locale/fr_FR/LC_MESSAGES/django.mo index 6d872a83dba4ee847d3dc60f6792146778c8c726..cf6c6811b2a425ceddb1e39654b793780693ed22 100644 GIT binary patch delta 739 zcmYk)y)Q#i7{~GBYQ42ey}wi}L>i;PV6Y%Mk{BdRHzzcq)!ve_bg@~8h*-qhK_vVI zh(uyVNJN@go0ufh$@f<`;z>?F=id9A^PK12K8K3o!h2ib$PfdJ7$Z<)OdQLo*msPn z#{&%D2{z#=HeeAWc!_Ozjmmq(I()?tmQeX+|M?fPZ^2ZUDAB3?E!2ogjG{K`Lv1jK zEjWrgzyzxB4C;Uj*oe!%E2w=lsP%aa<1PmA06VE~j+uYDmyoe8zg7PjIJcHkbW!!uOj3)BWT zs7@YG1zu2vOTK0Q`8TSOAV2!FVboVuZj_-z75ezm<_f+IR`s71}`m5fxVS zFmz}gP>0o<_#f1+h8k-3=Q_MXpHXj&h*Uf1XV%Q+P q&TgAT%1y7^t9xhM8J@Z={-wC9Nt^Yvl9^3w=B;aUIqMxpgLgmOX-8!M delta 655 zcmX}py)Q#i7{~GB_LWv~sh46BxwA?C0BI}+lZAxTP22>HBGIWy6NAAZO$Uh$Lnp#S zECz#w!D2A5Sj5O?;QMP&o%Fe%dvEV^p68rXPd+EguWqe^7;@ zq2>f>Z0C8@>Y)lwpz^br#3_v6ET(Y|Jr=iyQByXiM!QNpLM0xf3Z9`>bdCM^i2Teu z7Zv_MegB18(Jv}5Mm0UVsD)*aT4oHp(ZfE>Vv71^h8q={M%Gw;tO6 zPf?9uppNbeb!s|F<@FG1l#TlzYNXRXX*U;oxeO61&>91+8`Ke~Yc-^youE!*D^;9D yH&(62H8O-&H%PeEJtv>c1*^W94mP(6#nNRwH0ijxAiom$Mf)\n" "Language-Team: \n" @@ -23,7 +23,7 @@ msgstr "Transaction" #: .\transaction\models.py:19 .\transaction\models.py:89 #: .\transaction\templates\transaction\invoice_table.html:10 -#: .\transaction\templates\transaction\transaction_table.html:24 +#: .\transaction\templates\transaction\transaction_table.html:32 msgid "Name" msgstr "Nom" @@ -32,12 +32,11 @@ msgid "Description" msgstr "Description" #: .\transaction\models.py:23 -#: .\transaction\templates\transaction\transaction_table.html:25 msgid "Value" msgstr "Valeur" #: .\transaction\models.py:25 -#: .\transaction\templates\transaction\transaction_table.html:23 +#: .\transaction\templates\transaction\transaction_table.html:31 msgid "Date" msgstr "Date" @@ -46,7 +45,7 @@ msgid "Real date" msgstr "Date réelle" #: .\transaction\models.py:28 -#: .\transaction\templates\transaction\transaction_table.html:26 +#: .\transaction\templates\transaction\transaction_table.html:35 msgid "Trader" msgstr "Commerçant" @@ -55,7 +54,7 @@ msgid "Payment" msgstr "Paiement" #: .\transaction\models.py:38 -#: .\transaction\templates\transaction\transaction_table.html:28 +#: .\transaction\templates\transaction\transaction_table.html:37 msgid "Category" msgstr "Catégorie" @@ -64,7 +63,7 @@ msgid "Statement" msgstr "Relevé" #: .\transaction\models.py:48 -#: .\transaction\templates\transaction\transaction_table.html:31 +#: .\transaction\templates\transaction\transaction_table.html:40 msgid "Account" msgstr "Compte" @@ -124,7 +123,7 @@ msgid "History" msgstr "Historique" #: .\transaction\templates\transaction\transaction_form.html:5 -#: .\transaction\templates\transaction\transaction_table.html:37 +#: .\transaction\templates\transaction\transaction_table.html:25 msgid "Create transaction" msgstr "Créer une transaction" @@ -132,10 +131,18 @@ msgstr "Créer une transaction" msgid "New transaction" msgstr "Nouvelle transaction" -#: .\transaction\templates\transaction\transaction_table.html:77 +#: .\transaction\templates\transaction\transaction_table.html:33 +msgid "Expenses" +msgstr "Dépenses" + +#: .\transaction\templates\transaction\transaction_table.html:34 +msgid "Income" +msgstr "Recettes" + +#: .\transaction\templates\transaction\transaction_table.html:87 msgid "No transaction" msgstr "Aucune transaction" -#: .\transaction\templates\transaction\transaction_table.html:86 +#: .\transaction\templates\transaction\transaction_table.html:95 msgid "View all transactions" msgstr "Voir toutes les transactions" diff --git a/nummi/transaction/templates/transaction/transaction_table.html b/nummi/transaction/templates/transaction/transaction_table.html index 4ae44a0..1654e6f 100644 --- a/nummi/transaction/templates/transaction/transaction_table.html +++ b/nummi/transaction/templates/transaction/transaction_table.html @@ -1,4 +1,4 @@ -{% load main_extras %} +{% load main_extras transaction_extras %} {% load i18n %}
@@ -7,6 +7,7 @@ + {% if not category %} @@ -20,7 +21,7 @@ {% if new_transaction_url %} - @@ -29,7 +30,8 @@ - + + {% if not category %} @@ -59,7 +61,9 @@ + {% if trans.value >= 0 %}{% endif %} + {% if trans.value < 0 %}{% endif %} {% if not category %} {% if trans.category %} @@ -80,17 +84,14 @@ {% empty %} - + {% endfor %} {% if transactions_url %} - diff --git a/nummi/transaction/templatetags/transaction_extras.py b/nummi/transaction/templatetags/transaction_extras.py index 30cba01..313fb15 100644 --- a/nummi/transaction/templatetags/transaction_extras.py +++ b/nummi/transaction/templatetags/transaction_extras.py @@ -34,3 +34,13 @@ def year_url(context, year, cls=""): f"""""" f"""""" ) + + +@register.simple_tag(takes_context=True) +def tr_colspan(context): + ncol = 10 + if context.get("category"): + ncol -= 2 + if context.get("account"): + ncol -= 2 + return ncol
+ {% translate "Create transaction" %}
{{ "attachment"|remix }} {% translate "Date" %} {% translate "Name" %}{% translate "Value" %}{% translate "Expenses" %}{% translate "Income" %} {% translate "Trader" %}{% translate "Category" %} {{ trans.name }} {{ trans.value|pmvalue }}{{ trans.trader|default_if_none:"" }}
- {% translate "No transaction" %} - {% translate "No transaction" %}
+ {% translate "View all transactions" %}