#26 Annual conservation report

* adds new templatetag default_if_zero in ksp_filters.py
* adds/updates translations
This commit is contained in:
mpeltriaux 2021-10-19 09:13:20 +02:00
parent 92155fb742
commit 33de71d554
7 changed files with 148 additions and 92 deletions

View File

@ -1,4 +1,4 @@
{% load i18n fontawesome_5 %} {% load i18n fontawesome_5 ksp_filters %}
<h3>{% trans 'Amount' %}</h3> <h3>{% trans 'Amount' %}</h3>
<strong> <strong>
@ -21,9 +21,9 @@
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>{{report.intervention_report.queryset.count}}</td> <td>{{report.intervention_report.queryset.count|default_if_zero:"-"}}</td>
<td>{{report.intervention_report.queryset_checked.count}}</td> <td>{{report.intervention_report.queryset_checked.count|default_if_zero:"-"}}</td>
<td>{{report.intervention_report.queryset_recorded.count}}</td> <td>{{report.intervention_report.queryset_recorded.count|default_if_zero:"-"}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -16,9 +16,9 @@
<div class="card-body"> <div class="card-body">
{% include 'analysis/reports/includes/intervention/amount.html' %} {% include 'analysis/reports/includes/intervention/amount.html' %}
<hr> <hr>
{% include 'analysis/reports/includes/intervention/laws.html' %}
<hr>
{% include 'analysis/reports/includes/intervention/compensated_by.html' %} {% include 'analysis/reports/includes/intervention/compensated_by.html' %}
<hr>
{% include 'analysis/reports/includes/intervention/laws.html' %}
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,4 +1,4 @@
{% load i18n fontawesome_5 %} {% load i18n fontawesome_5 ksp_filters %}
<h3>{% trans 'Compensated by' %}</h3> <h3>{% trans 'Compensated by' %}</h3>
<div class="table-container scroll-300"> <div class="table-container scroll-300">
<table class="table table-hover"> <table class="table table-hover">
@ -13,21 +13,21 @@
<tbody> <tbody>
<tr> <tr>
<th>{% trans 'Compensation' %}</th> <th>{% trans 'Compensation' %}</th>
<td>{{report.intervention_report.compensation_sum}}</td> <td>{{report.intervention_report.compensation_sum|default_if_zero:"-"}}</td>
<td>{{report.intervention_report.compensation_sum_checked}}</td> <td>{{report.intervention_report.compensation_sum_checked|default_if_zero:"-"}}</td>
<td>{{report.intervention_report.compensation_sum_recorded}}</td> <td>{{report.intervention_report.compensation_sum_recorded|default_if_zero:"-"}}</td>
</tr> </tr>
<tr> <tr>
<th>{% trans 'Payment' %}</th> <th>{% trans 'Payment' %}</th>
<td>{{report.intervention_report.payment_sum}}</td> <td>{{report.intervention_report.payment_sum|default_if_zero:"-"}}</td>
<td>{{report.intervention_report.payment_sum_checked}}</td> <td>{{report.intervention_report.payment_sum_checked|default_if_zero:"-"}}</td>
<td>{{report.intervention_report.payment_sum_recorded}}</td> <td>{{report.intervention_report.payment_sum_recorded|default_if_zero:"-"}}</td>
</tr> </tr>
<tr> <tr>
<th>{% trans 'Deductions' %}</th> <th>{% trans 'Deductions' %}</th>
<td>{{report.intervention_report.deduction_sum}}</td> <td>{{report.intervention_report.deduction_sum|default_if_zero:"-"}}</td>
<td>{{report.intervention_report.deduction_sum_checked}}</td> <td>{{report.intervention_report.deduction_sum_checked|default_if_zero:"-"}}</td>
<td>{{report.intervention_report.deduction_sum_recorded}}</td> <td>{{report.intervention_report.deduction_sum_recorded|default_if_zero:"-"}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -1,4 +1,4 @@
{% load i18n fontawesome_5 %} {% load i18n fontawesome_5 ksp_filters %}
<h3>{% trans 'Law usage' %}</h3> <h3>{% trans 'Law usage' %}</h3>
<strong> <strong>
{% blocktrans %} {% blocktrans %}
@ -34,16 +34,16 @@
{{law.long_name}} {{law.long_name}}
</small> </small>
</td> </td>
<td>{{law.num_checked}}</td> <td>{{law.num_checked|default_if_zero:"-"}}</td>
<td>{{law.num_recorded}}</td> <td>{{law.num_recorded|default_if_zero:"-"}}</td>
<td>{{law.num}}</td> <td>{{law.num|default_if_zero:"-"}}</td>
</tr> </tr>
{% endfor %} {% endfor %}
<tr> <tr>
<td><strong>{% trans 'Total' %}</strong></td> <td><strong>{% trans 'Total' %}</strong></td>
<td><strong>{{report.intervention_report.law_sum_checked}}</strong></td> <td><strong>{{report.intervention_report.law_sum_checked|default_if_zero:"-"}}</strong></td>
<td><strong>{{report.intervention_report.law_sum_recorded}}</strong></td> <td><strong>{{report.intervention_report.law_sum_recorded|default_if_zero:"-"}}</strong></td>
<td><strong>{{report.intervention_report.law_sum}}</strong></td> <td><strong>{{report.intervention_report.law_sum|default_if_zero:"-"}}</strong></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -34,3 +34,19 @@ def bootstrap_cls(value):
""" """
return SVI_BOOTSTRAP_CLS_MAP.get(value, "") return SVI_BOOTSTRAP_CLS_MAP.get(value, "")
@register.filter("default_if_zero")
def default_if_zero(val1, val2):
""" Returns val2 if val1 is 0
Similar to default_if_none
Args:
val1 (int): The numerical value
val2 (str): The alternative
Returns:
"""
return val1 if val1 > 0 else val2

Binary file not shown.

View File

@ -19,7 +19,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-18 14:59+0200\n" "POT-Creation-Date: 2021-10-19 08:40+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -48,39 +48,54 @@ msgstr "Kompensationen"
msgid "Eco-Accounts" msgid "Eco-Accounts"
msgstr "Ökokonten" msgstr "Ökokonten"
#: analysis/templates/analysis/reports/includes/card_intervention.html:10 #: analysis/templates/analysis/reports/includes/card_old_interventions.html:11
#: intervention/tables.py:66 msgid "Old interventions"
msgid "Interventions" msgstr "Altfälle"
msgstr "Eingriffe"
#: analysis/templates/analysis/reports/includes/card_intervention.html:17 #: analysis/templates/analysis/reports/includes/card_old_interventions.html:13
msgid "Total interventions" msgid "Before"
msgstr "Vor"
#: analysis/templates/analysis/reports/includes/intervention/amount.html:3
#: compensation/forms/modalForms.py:351
#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:34
#: intervention/templates/intervention/detail/includes/deductions.html:31
msgid "Amount"
msgstr "Menge"
#: analysis/templates/analysis/reports/includes/intervention/amount.html:5
msgid ""
"\n"
" Checked = Has been checked by the registration office according to "
"LKompVzVo\n"
" "
msgstr ""
"\n"
" Geprüft = Wurde von der zuständigen Zulassungsbehörde überprüft\n"
" "
#: analysis/templates/analysis/reports/includes/intervention/amount.html:9
msgid ""
"\n"
" Recorded = Has been checked and published by the conservation office\n"
" "
msgstr ""
"\n"
" Verzeichnet = Wurde von der Eintragungsstelle überprüft und veröffentlicht\n"
" "
#: analysis/templates/analysis/reports/includes/intervention/amount.html:17
#: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:8
#: analysis/templates/analysis/reports/includes/intervention/laws.html:23
#: analysis/templates/analysis/reports/includes/intervention/laws.html:43
#: konova/templates/konova/home.html:23 konova/templates/konova/home.html:61
#: konova/templates/konova/home.html:100
msgid "Total"
msgstr "Insgesamt" msgstr "Insgesamt"
#: analysis/templates/analysis/reports/includes/card_intervention.html:22 #: analysis/templates/analysis/reports/includes/intervention/amount.html:18
msgid "Amount total" #: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:9
msgstr "Anzahl insgesamt" #: analysis/templates/analysis/reports/includes/intervention/laws.html:17
#: analysis/templates/analysis/reports/includes/card_intervention.html:26
msgid "Amount checked"
msgstr "Anzahl geprüft"
#: analysis/templates/analysis/reports/includes/card_intervention.html:30
msgid "Amount recorded"
msgstr "Anzahl verzeichnet"
#: analysis/templates/analysis/reports/includes/card_intervention.html:37
msgid "Law usage"
msgstr "Gesetzesanwendungen"
#: analysis/templates/analysis/reports/includes/card_intervention.html:43
#: intervention/forms/forms.py:68
#: intervention/templates/intervention/detail/view.html:39
#: intervention/templates/intervention/report/report.html:20
msgid "Law"
msgstr "Gesetz"
#: analysis/templates/analysis/reports/includes/card_intervention.html:46
#: compensation/tables.py:35 #: compensation/tables.py:35
#: compensation/templates/compensation/detail/compensation/view.html:43 #: compensation/templates/compensation/detail/compensation/view.html:43
#: intervention/tables.py:33 #: intervention/tables.py:33
@ -88,7 +103,9 @@ msgstr "Gesetz"
msgid "Checked" msgid "Checked"
msgstr "Geprüft" msgstr "Geprüft"
#: analysis/templates/analysis/reports/includes/card_intervention.html:49 #: analysis/templates/analysis/reports/includes/intervention/amount.html:19
#: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:10
#: analysis/templates/analysis/reports/includes/intervention/laws.html:20
#: compensation/tables.py:41 compensation/tables.py:181 #: compensation/tables.py:41 compensation/tables.py:181
#: compensation/templates/compensation/detail/compensation/view.html:57 #: compensation/templates/compensation/detail/compensation/view.html:57
#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:31 #: compensation/templates/compensation/detail/eco_account/includes/deductions.html:31
@ -99,29 +116,58 @@ msgstr "Geprüft"
msgid "Recorded" msgid "Recorded"
msgstr "Verzeichnet" msgstr "Verzeichnet"
#: analysis/templates/analysis/reports/includes/card_intervention.html:52 #: analysis/templates/analysis/reports/includes/intervention/card_intervention.html:10
#: analysis/templates/analysis/reports/includes/card_intervention.html:72 #: intervention/tables.py:66
#: konova/templates/konova/home.html:23 konova/templates/konova/home.html:61 msgid "Interventions"
#: konova/templates/konova/home.html:100 msgstr "Eingriffe"
msgid "Total"
msgstr "Insgesamt"
#: analysis/templates/analysis/reports/includes/card_intervention.html:81 #: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:2
msgid "Compensated by"
msgstr "Kompensiert durch"
#: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:7
msgid "Compensation type"
msgstr "Kompensationsart"
#: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:15
#: compensation/tables.py:84
#: compensation/templates/compensation/detail/compensation/view.html:19
#: konova/templates/konova/home.html:49 templates/navbars/navbar.html:28
msgid "Compensation"
msgstr "Kompensation"
#: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:21
#: compensation/forms/modalForms.py:75
msgid "Payment"
msgstr "Zahlung"
#: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:27
msgid "Deductions"
msgstr "Abbuchungen"
#: analysis/templates/analysis/reports/includes/intervention/laws.html:2
msgid "Law usage"
msgstr "Gesetzesanwendungen"
#: analysis/templates/analysis/reports/includes/intervention/laws.html:4
msgid "" msgid ""
"\n" "\n"
" Please note: One intervention can be based on " " Please note: One intervention can be based on multiple laws. This table "
"multiple laws. This table therefore does not\n" "therefore does not\n"
" count\n" " count\n"
" " " "
msgstr "" msgstr ""
"\n"
" Beachten Sie: Ein Eingriff kann mehreren Gesetzen zugeordnet worden sein. Diese Tabelle zählt daher nicht die Eingriffe selbst "
", sondern wie oft ein Gesetz Anwendung fand.\n"
" "
#: analysis/templates/analysis/reports/includes/card_old_interventions.html:11 #: analysis/templates/analysis/reports/includes/intervention/laws.html:14
msgid "Old interventions" #: intervention/forms/forms.py:68
msgstr "Altfälle" #: intervention/templates/intervention/detail/view.html:39
#: intervention/templates/intervention/report/report.html:20
#: analysis/templates/analysis/reports/includes/card_old_interventions.html:13 msgid "Law"
msgid "Before" msgstr "Gesetz"
msgstr "Vor"
#: analysis/templates/analysis/reports/index.html:6 #: analysis/templates/analysis/reports/index.html:6
#: templates/navbars/navbar.html:46 #: templates/navbars/navbar.html:46
@ -306,10 +352,6 @@ msgstr "Zahlung wird an diesem Datum erwartet"
msgid "Additional comment, maximum {} letters" msgid "Additional comment, maximum {} letters"
msgstr "Zusätzlicher Kommentar, maximal {} Zeichen" msgstr "Zusätzlicher Kommentar, maximal {} Zeichen"
#: compensation/forms/modalForms.py:75
msgid "Payment"
msgstr "Zahlung"
#: compensation/forms/modalForms.py:76 #: compensation/forms/modalForms.py:76
msgid "Add a payment for intervention '{}'" msgid "Add a payment for intervention '{}'"
msgstr "Neue Ersatzzahlung zu Eingriff '{}' hinzufügen" msgstr "Neue Ersatzzahlung zu Eingriff '{}' hinzufügen"
@ -435,12 +477,6 @@ msgstr "Einheit"
msgid "Select the unit" msgid "Select the unit"
msgstr "Einheit wählen" msgstr "Einheit wählen"
#: compensation/forms/modalForms.py:351
#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:34
#: intervention/templates/intervention/detail/includes/deductions.html:31
msgid "Amount"
msgstr "Menge"
#: compensation/forms/modalForms.py:354 #: compensation/forms/modalForms.py:354
msgid "Insert the amount" msgid "Insert the amount"
msgstr "Menge eingeben" msgstr "Menge eingeben"
@ -511,12 +547,6 @@ msgstr "Zuletzt bearbeitet"
msgid "Open {}" msgid "Open {}"
msgstr "Öffne {}" msgstr "Öffne {}"
#: compensation/tables.py:84
#: compensation/templates/compensation/detail/compensation/view.html:19
#: konova/templates/konova/home.html:49 templates/navbars/navbar.html:28
msgid "Compensation"
msgstr "Kompensation"
#: compensation/tables.py:105 intervention/tables.py:107 #: compensation/tables.py:105 intervention/tables.py:107
msgid "Not checked yet" msgid "Not checked yet"
msgstr "Noch nicht geprüft" msgstr "Noch nicht geprüft"
@ -781,7 +811,7 @@ msgstr "Gefördert mit"
#: intervention/templates/intervention/report/report.html:57 #: intervention/templates/intervention/report/report.html:57
#: intervention/templates/intervention/report/report.html:78 #: intervention/templates/intervention/report/report.html:78
msgid "None" msgid "None"
msgstr "" msgstr "-"
#: compensation/templates/compensation/detail/compensation/view.html:84 #: compensation/templates/compensation/detail/compensation/view.html:84
#: compensation/templates/compensation/detail/eco_account/view.html:83 #: compensation/templates/compensation/detail/eco_account/view.html:83
@ -834,8 +864,6 @@ msgid "Created"
msgstr "Erstellt" msgstr "Erstellt"
#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:54 #: compensation/templates/compensation/detail/eco_account/includes/deductions.html:54
#, fuzzy
#| msgid "Recorded on "
msgid "Recorded on" msgid "Recorded on"
msgstr "Verzeichnet am" msgstr "Verzeichnet am"
@ -3001,6 +3029,18 @@ msgstr ""
msgid "A fontawesome icon field" msgid "A fontawesome icon field"
msgstr "" msgstr ""
#~ msgid "Total interventions"
#~ msgstr "Insgesamt"
#~ msgid "Amount total"
#~ msgstr "Anzahl insgesamt"
#~ msgid "Amount checked"
#~ msgstr "Anzahl geprüft"
#~ msgid "Amount recorded"
#~ msgstr "Anzahl verzeichnet"
#~ msgid "Funding by..." #~ msgid "Funding by..."
#~ msgstr "Gefördert mit..." #~ msgstr "Gefördert mit..."