feat(excursion/ljp): added check for proof on bills, fixed finance overview

MK/finance_workflow
mariusrklein 8 months ago
parent 4041f491a8
commit c0af4a6bb8

@ -289,6 +289,11 @@ class Statement(CommonModel):
"""Returns the bills that are marked for reimbursement by the finance officer"""
return [bill for bill in self.bill_set.all() if bill.costs_covered]
@property
def bills_without_proof(self):
"""Returns the bills that lack a proof file"""
return [bill for bill in self.bill_set.all() if not bill.proof]
@property
def total_bills_theoretic(self):
return sum([bill.amount for bill in self.bill_set.all()])

@ -134,6 +134,7 @@ Once their proposal was approved, the ljp contributions of should be paid to:{%
{% endif %}
<h2>{% trans "Summary" %}</h2>

@ -1230,6 +1230,12 @@ class FreizeitAdmin(CommonAdminMixin, nested_admin.NestedModelAdmin):
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,)))
if memberlist.statement.ljp_to and len(memberlist.statement.bills_without_proof) > 0:
messages.error(request,
_("The excursion is configured to claim LJP contributions. In that case, for all bills, a proof must be uploaded. 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-04-06 14:02+0200\n"
"POT-Creation-Date: 2025-04-06 17:30+0200\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"
@ -417,6 +417,14 @@ 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 ""
"The excursion is configured to claim LJP contributions. In that case, for "
"all bills, a proof must be uploaded. Please correct this and try again."
msgstr ""
"Für die Ausfahrt werden LJP-Zuschüsse beantragt. Dafür müssen für alle Ausgaben Belege hochgeladen werden. "
"Bitte lade für alle Ausgaben einen Beleg hoch und versuche es erneut. "
#: members/admin.py
msgid ""
"Successfully submited statement. The finance department will notify you as "
@ -1365,6 +1373,10 @@ msgstr ""
"innerhalb von 3 Wochen nach de Ausfahrt beim Jugendreferat einreichen und "
"formal genehmigt bekommen."
#: members/templates/admin/freizeit_finance_overview.html
msgid "The LJP contributions are configured to be paid to:"
msgstr "Die LJP-Zuschüsse werden ausgezahlt an:"
#: members/templates/admin/freizeit_finance_overview.html
#, python-format
msgid ""
@ -1381,8 +1393,8 @@ msgstr ""
"Tage für %(participant_count)s Teilnehmende, aber nicht mehr als 90%% der "
"Gesamtausgaben erhalten. Das resultiert in einem Gesamtzuschuss von "
"%(ljp_contributions)s€. Wenn du schon einen Seminarbericht erstellt hast, "
"musst du im Tab 'Abrechnungen' noch angeben, an wen die LJP-Zuschüsse ausgezahlt "
"werden sollen."
"musst du im Tab 'Abrechnungen' noch angeben, an wen die LJP-Zuschüsse "
"ausgezahlt werden sollen."
#: members/templates/admin/freizeit_finance_overview.html
msgid "Summary"

@ -130,9 +130,9 @@ cost plan!
</p>
{% endif %}
<h3>{% trans "LJP contributions" %}</h3>
{% if memberlist.statement.ljp_to %}
<h3>{% trans "LJP contributions" %}</h3>
<p>
{% blocktrans %}By submitting the given seminar report, you will receive LJP contributions. You have
@ -141,6 +141,19 @@ cost plan!
submit the LJP-Proposal within 3 weeks after your excursion and have it approved by the finance office. {% endblocktrans %}
</p>
<p>
{% blocktrans %}The LJP contributions are configured to be paid to:{% endblocktrans %}
<table>
<th>
<td>{% trans "IBAN valid" %}</td>
</th>
<tr>
<td>{{ memberlist.statement.ljp_to.name }}</td>
<td>{{ memberlist.statement.ljp_to.iban_valid|render_bool }}</td>
</tr>
</table>
</p>
{% else %}
<p>
{% blocktrans %}By submitting a seminar report, you may apply for LJP contributions. In this case,

Loading…
Cancel
Save