diff --git a/jdav_web/finance/admin.py b/jdav_web/finance/admin.py
index e6fddc1..0f5237d 100644
--- a/jdav_web/finance/admin.py
+++ b/jdav_web/finance/admin.py
@@ -89,12 +89,25 @@ class StatementUnSubmittedAdmin(CommonAdminMixin, admin.ModelAdmin):
messages.success(request,
_("Successfully submited %(name)s. The finance department will notify the requestors as soon as possible.") % {'name': str(statement)})
return HttpResponseRedirect(reverse('admin:%s_%s_changelist' % (self.opts.app_label, self.opts.model_name)))
- context = dict(self.admin_site.each_context(request),
- title=_('Submit statement'),
+
+ if statement.excursion:
+ memberlist = statement.excursion
+ context = dict(self.admin_site.each_context(request),
+ title=_('Finance overview'),
opts=self.opts,
- statement=statement)
-
- return render(request, 'admin/submit_statement.html', context=context)
+ memberlist=memberlist,
+ object=memberlist,
+ participant_count=memberlist.participant_count,
+ ljp_contributions=memberlist.potential_ljp_contributions,
+ total_relative_costs=memberlist.total_relative_costs,
+ **memberlist.statement.template_context())
+ return render(request, 'admin/freizeit_finance_overview.html', context=context)
+ else:
+ context = dict(self.admin_site.each_context(request),
+ title=_('Submit statement'),
+ opts=self.opts,
+ statement=statement)
+ return render(request, 'admin/submit_statement.html', context=context)
class TransactionOnSubmittedStatementInline(admin.TabularInline):
diff --git a/jdav_web/finance/locale/de/LC_MESSAGES/django.po b/jdav_web/finance/locale/de/LC_MESSAGES/django.po
index 491c098..9f6d9e3 100644
--- a/jdav_web/finance/locale/de/LC_MESSAGES/django.po
+++ b/jdav_web/finance/locale/de/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2025-01-19 11:40+0100\n"
+"POT-Creation-Date: 2025-01-19 14:26+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME {% translate "Please check if all expenses are documented correctly and if all payers have a valid account code." %}
{% trans "Do you want to submit the statement for further processing by the finance department? If you proceed, no further changes to the statement are possible." %}
- {{ bill.costs_covered }}
+ {{ bill.costs_covered|render_bool }}
{% endfor %}
diff --git a/jdav_web/finance/templates/admin/submit_statement.html b/jdav_web/finance/templates/admin/submit_statement.html
index 838c410..01bfe8a 100644
--- a/jdav_web/finance/templates/admin/submit_statement.html
+++ b/jdav_web/finance/templates/admin/submit_statement.html
@@ -1,5 +1,6 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_urls static %}
+{% load overview_extras %}
{% block extrahead %}
{{ block.super }}
@@ -24,6 +25,35 @@
{% block content %}
{% translate "Submit to the finance department" %}
+
+
+
+ {% trans "Explanation" %}
+ {% trans "Amount" %}
+ {% trans "Paid by" %}
+ {% trans "IBAN valid" %}
+
+ {% for bill in statement.bill_set.all %}
+
+
+ {% endfor %}
+
+ {{bill.short_description}}
+
+
+ {{bill.explanation}}
+
+
+ {{ bill.amount }}€
+
+
+ {{ bill.paid_by.name }}
+
+
+ {{ bill.paid_by.iban_valid|render_bool }}
+
+
{% trans "Explanation" %}
{% trans "Amount" %}
+ {% trans "Paid by" %}
+ {% trans "IBAN valid" %}
{% for bill in memberlist.statement.bill_set.all %}
@@ -50,6 +53,12 @@ cost plan!
{% endfor %}
@@ -78,21 +87,29 @@ cost plan!
{{ bill.amount }}€
+
+ {{ bill.paid_by.name }}
+
+
+ {{ bill.paid_by.iban_valid|render_bool }}
+
{% blocktrans %}The allowance of {{ allowance_per_yl }}€ per person is configured to be paid to:{% endblocktrans %} -
| + | {% trans "IBAN valid" %} | + {% for member in memberlist.statement.allowance_to.all %} -
|---|---|
| {{ member.name }} | +{{ member.iban_valid|render_bool }} | +
{% blocktrans %}The subsidies for night and transportation costs of {{ total_subsidies }}€ is configured to be paid to:{% endblocktrans %} -
| + | {% trans "IBAN valid" %} | + +
|---|---|
| {{ memberlist.statement.subsidy_to.name }} | +{{ memberlist.statement.subsidy_to.iban_valid|render_bool }} | +
@@ -128,7 +145,7 @@ you may obtain up to 25€ times {{ duration }} days for {{ participant_count }} {% trans "Contributions by the association" %}
{% blocktrans %}Did you already complete this excursion? If yes, please check if all listed expenses are correct -and then submit the statement for processing by the finance department. If you proceed, +and people who want their money back have valid bank account numbers. Then submit the statement for processing by the finance department. If you proceed, no further changes to the statement are possible.{% endblocktrans %}
diff --git a/jdav_web/members/templatetags/overview_extras.py b/jdav_web/members/templatetags/overview_extras.py index 5127167..95d11a4 100644 --- a/jdav_web/members/templatetags/overview_extras.py +++ b/jdav_web/members/templatetags/overview_extras.py @@ -1,4 +1,5 @@ from django import template +from django.utils.html import format_html register = template.Library() @@ -15,3 +16,19 @@ def has_attendee_wrapper(klettertreff, member): @register.simple_tag def has_jugendleiter_wrapper(klettertreff, jugendleiter): return blToColor(klettertreff.has_jugendleiter(jugendleiter)) + +@register.filter +def render_bool(boolean_value): + + if not isinstance(boolean_value, bool): + raise ValueError(f"""Custom Filter 'render_bool': Supplied value '{boolean_value}' is not bool, but {type(boolean_value)}.""") + + if boolean_value: # True is a green tick + color = "#bcd386" + htmlclass = "icon-tick" + else: # False is a red cross + color = "#dba4a4" + htmlclass = "icon-cross" + + return format_html(f"""""") \ No newline at end of file