members/admin: add check for valid allowance_to in finance overview

pull/103/head
Christian Merten 11 months ago
parent 2e6bfc9b75
commit e2bff68471
Signed by: christian.merten
GPG Key ID: D953D69721B948B3

@ -1094,6 +1094,10 @@ class FreizeitAdmin(CommonAdminMixin, nested_admin.NestedModelAdmin):
if not memberlist.statement:
messages.error(request, _("No statement found. Please add a statement and then retry."))
if "apply" in request.POST:
if not memberlist.statement.allowance_to_valid:
messages.error(request,
_("The configured recipients of the allowance don't match the regulations. Please correct this and try again."))
return HttpResponseRedirect(reverse('admin:%s_%s_change' % (self.opts.app_label, self.opts.model_name), args=(memberlist.pk,)))
memberlist.statement.submit(get_member(request))
messages.success(request,
_("Successfully submited statement. The finance department will notify you as soon as possible."))

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-18 20:19+0100\n"
"POT-Creation-Date: 2025-01-18 23:22+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -390,6 +390,14 @@ msgstr ""
"Keine Abrechnung angelegt. Bitte lege eine Abrechnung and und versuche es "
"erneut."
#: members/admin.py
msgid ""
"The configured recipients of the allowance don't match the regulations. "
"Please correct this and try again."
msgstr ""
"Die ausgewählten Empfänger*innen der Aufwandsentschädigung stimmen nicht mit "
"den Richtlinien überein. Bitte korrigiere das und versuche es erneut. "
#: members/admin.py
msgid ""
"Successfully submited statement. The finance department will notify you as "
@ -1121,11 +1129,31 @@ msgstr ""
#: members/templates/admin/freizeit_finance_overview.html
#, python-format
msgid ""
"In total these are contributions of %(total_per_yl)s€ times %(staff_count)s, "
"giving %(total_staff)s€."
"The allowance of %(allowance_per_yl)s€ per person is configured to be paid "
"to:"
msgstr ""
"Die Aufwandsentschädigung von %(allowance_per_yl)s€ pro Person wird "
"ausgezahlt an:"
#: members/templates/admin/freizeit_finance_overview.html
#, python-format
msgid ""
"The subsidies for night and transportation costs of %(total_subsidies)s€ is "
"configured to be paid to:"
msgstr ""
"Insgesamt sind das Kosten von %(total_per_yl)s€ mal %(staff_count)s, "
"insgesamt also %(total_staff)s€."
"Die Zuschüsse für Übernachtungs- und Fahrtkosten von %(total_subsidies)s€ "
"werden ausgezahlt an:"
#: members/templates/admin/freizeit_finance_overview.html
msgid ""
"Warning: The configured recipients of the allowance don't match the "
"regulations. This might be because the number of recipients is bigger then "
"the number of admissable youth leaders for this excursion."
msgstr ""
"Warnung: Die ausgewählten Empfänger*innen der Aufwandsentschädigung stimmen "
"nicht mit den Richtlinien überein. Das kann daran liegen, dass die Anzahl "
"der ausgewählten Empfänger*innen die Anzahl genehmigter Jugendleiter*innen "
"übersteigt."
#: members/templates/admin/freizeit_finance_overview.html
msgid "LJP contributions"
@ -1824,6 +1852,14 @@ msgstr "abgelaufen"
msgid "Invalid emergency contacts"
msgstr "Ungültige Notfallkontakte"
#, python-format
#~ msgid ""
#~ "In total these are contributions of %(total_per_yl)s€ times "
#~ "%(staff_count)s, giving %(total_staff)s€."
#~ msgstr ""
#~ "Insgesamt sind das Kosten von %(total_per_yl)s€ mal %(staff_count)s, "
#~ "insgesamt also %(total_staff)s€."
#~ msgid "Your registration succeeded."
#~ msgstr "Deine Registrierung war erfolgreich."

@ -77,8 +77,28 @@ cost plan!
</ul>
</p>
<p>
{% blocktrans %}In total these are contributions of {{ total_per_yl }}€ times {{ staff_count }}, giving {{ total_staff }}€.{% endblocktrans %}
{% blocktrans %}The allowance of {{ allowance_per_yl }}€ per person is configured to be paid to:{% endblocktrans %}
<ul>
{% for member in memberlist.statement.allowance_to.all %}
<li>
{{ member.name }}
</li>
{% endfor %}
</ul>
</p>
<p>
{% blocktrans %}The subsidies for night and transportation costs of {{ total_subsidies }}€ is configured to be paid to:{% endblocktrans %}
<ul>
<li>
{{ memberlist.statement.subsidy_to.name }}
</li>
</ul>
</p>
{% if not memberlist.statement.allowance_to_valid %}
<p>
{% blocktrans %}Warning: The configured recipients of the allowance don't match the regulations. This might be because the number of recipients is bigger then the number of admissable youth leaders for this excursion.{% endblocktrans %}
</p>
{% endif %}
<h3>{% trans "LJP contributions" %}</h3>

Loading…
Cancel
Save