Split columns for income and expenses

This commit is contained in:
Edgar P. Burkhart 2024-01-03 15:52:36 +01:00
parent e2f7a1dcc3
commit e4169bd1c3
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
7 changed files with 59 additions and 41 deletions

View file

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: 2023-04-22 15:18+0200\n"
"Last-Translator: Edgar P. Burkhart <traduction@edgarpierre.fr>\n" "Last-Translator: Edgar P. Burkhart <traduction@edgarpierre.fr>\n"
"Language-Team: \n" "Language-Team: \n"
@ -29,6 +29,6 @@ msgstr "Dépenses"
msgid "Income" msgid "Income"
msgstr "Revenus" msgstr "Revenus"
#: .\history\templates\history\plot.html:48 #: .\history\templates\history\plot.html:55
msgid "Year" msgid "Year"
msgstr "Année" msgstr "Année"

View file

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: 2023-04-23 08:03+0200\n"
"Last-Translator: Edgar P. Burkhart <traduction@edgarpierre.fr>\n" "Last-Translator: Edgar P. Burkhart <traduction@edgarpierre.fr>\n"
"Language-Team: \n" "Language-Team: \n"
@ -29,15 +29,15 @@ msgstr "Aller au contenu principal"
msgid "Home" msgid "Home"
msgstr "Accueil" msgstr "Accueil"
#: .\main\templates\main\base.html:39 .\main\templates\main\index.html:60 #: .\main\templates\main\base.html:39
msgid "Statements" msgid "Statements"
msgstr "Relevés" msgstr "Relevés"
#: .\main\templates\main\base.html:45 .\main\templates\main\index.html:40 #: .\main\templates\main\base.html:45
msgid "Transactions" msgid "Transactions"
msgstr "Transactions" msgstr "Transactions"
#: .\main\templates\main\base.html:51 #: .\main\templates\main\base.html:51 .\main\templates\main\index.html:39
msgid "Create account" msgid "Create account"
msgstr "Créer un compte" msgstr "Créer un compte"
@ -54,7 +54,7 @@ msgid "Create transaction"
msgstr "Créer une transaction" msgstr "Créer une transaction"
#: .\main\templates\main\base.html:71 .\main\templates\main\list.html:10 #: .\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" msgid "Search"
msgstr "Rechercher" msgstr "Rechercher"
@ -105,31 +105,31 @@ msgstr "Créer"
msgid "Save" msgid "Save"
msgstr "Enregistrer" msgstr "Enregistrer"
#: .\main\templates\main\index.html:12 #: .\main\templates\main\index.html:13
msgid "Accounts" msgid "Accounts"
msgstr "Comptes" msgstr "Comptes"
#: .\main\templates\main\index.html:17 #: .\main\templates\main\index.html:17
msgid "No account"
msgstr "Aucun compte"
#: .\main\templates\main\index.html:23
msgid "Account" msgid "Account"
msgstr "Compte" msgstr "Compte"
#: .\main\templates\main\index.html:24 #: .\main\templates\main\index.html:18
msgid "Balance" msgid "Balance"
msgstr "Solde" 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" msgid "Categories"
msgstr "Catégories" msgstr "Catégories"
#: .\main\templates\main\index.html:52 #: .\main\templates\main\index.html:53
msgid "No category" msgid "No category"
msgstr "Aucune catégorie" msgstr "Aucune catégorie"
#: .\main\templates\main\index.html:66 #: .\main\templates\main\index.html:62
msgid "History" msgid "History"
msgstr "Historique" msgstr "Historique"

View file

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: 2023-04-22 15:22+0200\n"
"Last-Translator: Edgar P. Burkhart <traduction@edgarpierre.fr>\n" "Last-Translator: Edgar P. Burkhart <traduction@edgarpierre.fr>\n"
"Language-Team: \n" "Language-Team: \n"
@ -38,7 +38,7 @@ msgid "Start value"
msgstr "Valeur initiale" msgstr "Valeur initiale"
#: .\statement\models.py:29 #: .\statement\models.py:29
#: .\statement\templates\statement\statement_table.html:23 #: .\statement\templates\statement\statement_table.html:30
msgid "Difference" msgid "Difference"
msgstr "Différence" msgstr "Différence"
@ -66,7 +66,7 @@ msgid "Statements"
msgstr "Relevés" msgstr "Relevés"
#: .\statement\templates\statement\statement_form.html:4 #: .\statement\templates\statement\statement_form.html:4
#: .\statement\templates\statement\statement_table.html:29 #: .\statement\templates\statement\statement_table.html:18
msgid "Create statement" msgid "Create statement"
msgstr "Créer un relevé" msgstr "Créer un relevé"
@ -79,19 +79,19 @@ msgid "Categories"
msgstr "Catégories" msgstr "Catégories"
#: .\statement\templates\statement\statement_form.html:27 #: .\statement\templates\statement\statement_form.html:27
#: .\statement\templates\statement\statement_table.html:24 #: .\statement\templates\statement\statement_table.html:31
msgid "Transactions" msgid "Transactions"
msgstr "Transactions" msgstr "Transactions"
#: .\statement\templates\statement\statement_table.html:18 #: .\statement\templates\statement\statement_table.html:25
msgid "Date" msgid "Date"
msgstr "Date" msgstr "Date"
#: .\statement\templates\statement\statement_table.html:20 #: .\statement\templates\statement\statement_table.html:27
msgid "Account" msgid "Account"
msgstr "Compte" msgstr "Compte"
#: .\statement\templates\statement\statement_table.html:22 #: .\statement\templates\statement\statement_table.html:29
msgid "Value" msgid "Value"
msgstr "Valeur" msgstr "Valeur"

View file

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: 2023-04-23 08:03+0200\n"
"Last-Translator: Edgar P. Burkhart <traduction@edgarpierre.fr>\n" "Last-Translator: Edgar P. Burkhart <traduction@edgarpierre.fr>\n"
"Language-Team: \n" "Language-Team: \n"
@ -23,7 +23,7 @@ msgstr "Transaction"
#: .\transaction\models.py:19 .\transaction\models.py:89 #: .\transaction\models.py:19 .\transaction\models.py:89
#: .\transaction\templates\transaction\invoice_table.html:10 #: .\transaction\templates\transaction\invoice_table.html:10
#: .\transaction\templates\transaction\transaction_table.html:24 #: .\transaction\templates\transaction\transaction_table.html:32
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
@ -32,12 +32,11 @@ msgid "Description"
msgstr "Description" msgstr "Description"
#: .\transaction\models.py:23 #: .\transaction\models.py:23
#: .\transaction\templates\transaction\transaction_table.html:25
msgid "Value" msgid "Value"
msgstr "Valeur" msgstr "Valeur"
#: .\transaction\models.py:25 #: .\transaction\models.py:25
#: .\transaction\templates\transaction\transaction_table.html:23 #: .\transaction\templates\transaction\transaction_table.html:31
msgid "Date" msgid "Date"
msgstr "Date" msgstr "Date"
@ -46,7 +45,7 @@ msgid "Real date"
msgstr "Date réelle" msgstr "Date réelle"
#: .\transaction\models.py:28 #: .\transaction\models.py:28
#: .\transaction\templates\transaction\transaction_table.html:26 #: .\transaction\templates\transaction\transaction_table.html:35
msgid "Trader" msgid "Trader"
msgstr "Commerçant" msgstr "Commerçant"
@ -55,7 +54,7 @@ msgid "Payment"
msgstr "Paiement" msgstr "Paiement"
#: .\transaction\models.py:38 #: .\transaction\models.py:38
#: .\transaction\templates\transaction\transaction_table.html:28 #: .\transaction\templates\transaction\transaction_table.html:37
msgid "Category" msgid "Category"
msgstr "Catégorie" msgstr "Catégorie"
@ -64,7 +63,7 @@ msgid "Statement"
msgstr "Relevé" msgstr "Relevé"
#: .\transaction\models.py:48 #: .\transaction\models.py:48
#: .\transaction\templates\transaction\transaction_table.html:31 #: .\transaction\templates\transaction\transaction_table.html:40
msgid "Account" msgid "Account"
msgstr "Compte" msgstr "Compte"
@ -124,7 +123,7 @@ msgid "History"
msgstr "Historique" msgstr "Historique"
#: .\transaction\templates\transaction\transaction_form.html:5 #: .\transaction\templates\transaction\transaction_form.html:5
#: .\transaction\templates\transaction\transaction_table.html:37 #: .\transaction\templates\transaction\transaction_table.html:25
msgid "Create transaction" msgid "Create transaction"
msgstr "Créer une transaction" msgstr "Créer une transaction"
@ -132,10 +131,18 @@ msgstr "Créer une transaction"
msgid "New transaction" msgid "New transaction"
msgstr "Nouvelle 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" msgid "No transaction"
msgstr "Aucune transaction" msgstr "Aucune transaction"
#: .\transaction\templates\transaction\transaction_table.html:86 #: .\transaction\templates\transaction\transaction_table.html:95
msgid "View all transactions" msgid "View all transactions"
msgstr "Voir toutes les transactions" msgstr "Voir toutes les transactions"

View file

@ -1,4 +1,4 @@
{% load main_extras %} {% load main_extras transaction_extras %}
{% load i18n %} {% load i18n %}
<div id="transactions" class="table"> <div id="transactions" class="table">
<table class="full-width"> <table class="full-width">
@ -7,6 +7,7 @@
<col class="date"> <col class="date">
<col class="desc"> <col class="desc">
<col class="value"> <col class="value">
<col class="value">
<col class="desc"> <col class="desc">
{% if not category %} {% if not category %}
<col class="icon"> <col class="icon">
@ -20,7 +21,7 @@
<thead> <thead>
{% if new_transaction_url %} {% if new_transaction_url %}
<tr class="new"> <tr class="new">
<td colspan="{% if category and account %}5{% elif category or account %}7{% else %}9{% endif %}"> <td colspan="{% tr_colspan %}">
<a href="{{ new_transaction_url }}">{% translate "Create transaction" %}</a> <a href="{{ new_transaction_url }}">{% translate "Create transaction" %}</a>
</td> </td>
</tr> </tr>
@ -29,7 +30,8 @@
<th>{{ "attachment"|remix }}</th> <th>{{ "attachment"|remix }}</th>
<th>{% translate "Date" %}</th> <th>{% translate "Date" %}</th>
<th>{% translate "Name" %}</th> <th>{% translate "Name" %}</th>
<th>{% translate "Value" %}</th> <th>{% translate "Expenses" %}</th>
<th>{% translate "Income" %}</th>
<th>{% translate "Trader" %}</th> <th>{% translate "Trader" %}</th>
{% if not category %} {% if not category %}
<th colspan="2">{% translate "Category" %}</th> <th colspan="2">{% translate "Category" %}</th>
@ -59,7 +61,9 @@
<th scope="row" class="l"> <th scope="row" class="l">
<a href="{{ trans.get_absolute_url }}">{{ trans.name }}</a> <a href="{{ trans.get_absolute_url }}">{{ trans.name }}</a>
</th> </th>
{% if trans.value >= 0 %}<td></td>{% endif %}
<td class="value">{{ trans.value|pmvalue }}</td> <td class="value">{{ trans.value|pmvalue }}</td>
{% if trans.value < 0 %}<td></td>{% endif %}
<td>{{ trans.trader|default_if_none:"" }}</td> <td>{{ trans.trader|default_if_none:"" }}</td>
{% if not category %} {% if not category %}
{% if trans.category %} {% if trans.category %}
@ -80,17 +84,14 @@
</tr> </tr>
{% empty %} {% empty %}
<tr> <tr>
<td class="empty" <td class="empty" colspan="{% tr_colspan %}">{% translate "No transaction" %}</td>
colspan="{% if category and account %}5{% elif category or account %}7{% else %}9{% endif %}">
{% translate "No transaction" %}
</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
{% if transactions_url %} {% if transactions_url %}
<tfoot> <tfoot>
<tr class="more"> <tr class="more">
<td colspan="{% if category and account %}5{% elif category or account %}7{% else %}9{% endif %}"> <td colspan="{% tr_colspan %}">
<a href="{{ transactions_url }}">{% translate "View all transactions" %}</a> <a href="{{ transactions_url }}">{% translate "View all transactions" %}</a>
</td> </td>
</tr> </tr>

View file

@ -34,3 +34,13 @@ def year_url(context, year, cls=""):
f"""<a class="{cls}" href="{url}">""" f"""<a class="{cls}" href="{url}">"""
f"""<time datetime="{year}">{year}</time></a>""" f"""<time datetime="{year}">{year}</time></a>"""
) )
@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