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 ""
"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 <traduction@edgarpierre.fr>\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"

View file

@ -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 <traduction@edgarpierre.fr>\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"

View file

@ -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 <traduction@edgarpierre.fr>\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"

View file

@ -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 <traduction@edgarpierre.fr>\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"

View file

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

View file

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