fix: simplified logic and increased verbosity

pull/149/head
mariusrklein 8 months ago
parent cd90387476
commit 4ad5b07475

@ -8,7 +8,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: 2025-04-06 18:46+0200\n" "POT-Creation-Date: 2025-04-15 21:12+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"
@ -301,27 +301,11 @@ msgstr "Übernachtungs- und Fahrtkosten für %(excu)s"
msgid "reduced by org fee" msgid "reduced by org fee"
msgstr "reduziert um Org-Beitrag" msgstr "reduziert um Org-Beitrag"
#: finance/models.py
#, fuzzy, python-format
#| msgid "Night and travel costs for %(excu)s"
msgid "Night and travel costs for %(excu)s, reduced by org fee"
msgstr "Übernachtungs- und Fahrtkosten für %(excu)s"
#: finance/models.py #: finance/models.py
#, python-format #, python-format
msgid "LJP-Contribution %(excu)s" msgid "LJP-Contribution %(excu)s"
msgstr "LJP-Zuschuss %(excu)s" msgstr "LJP-Zuschuss %(excu)s"
#: finance/models.py
#: finance/models.py
msgid "reduced by org fee"
msgstr "reduziert um Org-Beitrag"
#: finance/models.py
#, python-format
msgid "Night and travel costs for %(excu)s, reduced by org fee"
msgstr "Übernachtungs- und Fahrtkosten für %(excu)s, reduziert um Org-Beitrag"
#: finance/models.py #: finance/models.py
msgid "Total" msgid "Total"
msgstr "Gesamtbetrag" msgstr "Gesamtbetrag"
@ -548,12 +532,11 @@ msgstr ""
#: finance/templates/admin/overview_submitted_statement.html #: finance/templates/admin/overview_submitted_statement.html
#, python-format #, python-format
msgid "" msgid ""
"The subsidies for night and transportation costs of " "The subsidies for night and transportation costs of %(total_subsidies)s€ "
"%(total_subsidies_theoretical)s€ should be paid to:" "should be paid to:"
msgstr "" msgstr ""
"Die Zuschüsse für Übernachtungs- und Fahrtkosten von " "Die Zuschüsse für Übernachtungs- und Fahrtkosten von %(total_subsidies)s€ "
"%(total_subsidies_theoretical)s€ für alle Jugendleiter*innen sollen " "für alle Jugendleiter*innen sollen ausgezahlt werden an:"
"ausgezahlt werden an:"
#: finance/templates/admin/overview_submitted_statement.html #: finance/templates/admin/overview_submitted_statement.html
msgid "" msgid ""
@ -562,6 +545,10 @@ msgstr ""
"Keine Empfänger*innen für Sektionszuschüsse angegeben. Es werden daher keine " "Keine Empfänger*innen für Sektionszuschüsse angegeben. Es werden daher keine "
"Sektionszuschüsse ausbezahlt." "Sektionszuschüsse ausbezahlt."
#: finance/templates/admin/overview_submitted_statement.html
msgid "Org fee"
msgstr "Organisationsbeitrag"
#: finance/templates/admin/overview_submitted_statement.html #: finance/templates/admin/overview_submitted_statement.html
#, python-format #, python-format
msgid "" msgid ""
@ -576,8 +563,8 @@ msgstr ""
"Aufwandsentschädigungen verrechnet." "Aufwandsentschädigungen verrechnet."
#: finance/templates/admin/overview_submitted_statement.html #: finance/templates/admin/overview_submitted_statement.html
msgid "Organisation fees" msgid "LJP contributions"
msgstr "Org-Beitrag" msgstr "LJP-Zuschüsse"
#: finance/templates/admin/overview_submitted_statement.html #: finance/templates/admin/overview_submitted_statement.html
#, python-format #, python-format

@ -135,9 +135,10 @@ class Statement(CommonModel):
needed_paiments.extend([(yl, self.allowance_per_yl) for yl in self.allowance_to.all()]) needed_paiments.extend([(yl, self.allowance_per_yl) for yl in self.allowance_to.all()])
if self.subsidy_to: if self.subsidy_to:
needed_paiments.append((self.subsidy_to, self.total_subsidies)) needed_paiments.append((self.subsidy_to, self.total_subsidies))
# only include org fee if either allowance or subsidy is claimed (part of the property) # only include org fee if either allowance or subsidy is claimed (part of the property)
elif self.total_org_fee: if self.total_org_fee:
needed_paiments.append((self.allowance_to.all()[0], self.total_subsidies)) needed_paiments.append((self.org_fee_payant, -self.total_org_fee))
if self.ljp_to: if self.ljp_to:
needed_paiments.append((self.ljp_to, self.paid_ljp_contributions)) needed_paiments.append((self.ljp_to, self.paid_ljp_contributions))
@ -251,18 +252,14 @@ class Statement(CommonModel):
Transaction(statement=self, member=yl, amount=self.allowance_per_yl, confirmed=False, reference=ref).save() Transaction(statement=self, member=yl, amount=self.allowance_per_yl, confirmed=False, reference=ref).save()
# subsidies (i.e. night and transportation costs) # subsidies (i.e. night and transportation costs)
if self.subsidy_to or self.total_org_fee: if self.subsidy_to:
if self.total_org_fee == 0: ref = _("Night and travel costs for %(excu)s") % {'excu': self.excursion.name}
ref = _("Night and travel costs for %(excu)s") % {'excu': self.excursion.name} Transaction(statement=self, member=self.subsidy_to, amount=self.total_subsidies, confirmed=False, reference=ref).save()
elif not self.subsidy_to:
ref = _("reduced by org fee") if self.total_org_fee:
else:
ref = _("Night and travel costs for %(excu)s, reduced by org fee") % {'excu': self.excursion.name}
# if no subsidy receiver is given but org fees have to be paid. Just pick on of allowance receivers # if no subsidy receiver is given but org fees have to be paid. Just pick on of allowance receivers
member = self.subsidy_to if self.subsidy_to else self.allowance_to.all()[0] ref = _("reduced by org fee")
Transaction(statement=self, member=self.org_fee_payant, amount=-self.total_org_fee, confirmed=False, reference=ref).save()
Transaction(statement=self, member=member, amount=self.total_subsidies, confirmed=False, reference=ref).save()
if self.ljp_to: if self.ljp_to:
ref = _("LJP-Contribution %(excu)s") % {'excu': self.excursion.name} ref = _("LJP-Contribution %(excu)s") % {'excu': self.excursion.name}
@ -396,7 +393,11 @@ class Statement(CommonModel):
return cvt_to_decimal(0) return cvt_to_decimal(0)
@property @property
def total_subsidies_theoretical(self): def org_fee_payant(self):
return self.subsidy_to if self.subsidy_to else self.allowance_to.all()[0]
@property
def total_subsidies(self):
""" """
The total amount of subsidies excluding the allowance, i.e. the transportation The total amount of subsidies excluding the allowance, i.e. the transportation
and night costs per youth leader multiplied with the real number of youth leaders. and night costs per youth leader multiplied with the real number of youth leaders.
@ -407,8 +408,8 @@ class Statement(CommonModel):
return cvt_to_decimal(0) return cvt_to_decimal(0)
@property @property
def total_subsidies(self): def subsidies_paid(self):
return self.total_subsidies_theoretical - self.total_org_fee return self.total_subsidies - self.total_org_fee
@property @property
def theoretical_total_staff(self): def theoretical_total_staff(self):
@ -423,6 +424,11 @@ class Statement(CommonModel):
the sum of subsidies and allowances that youth leaders are actually collecting the sum of subsidies and allowances that youth leaders are actually collecting
""" """
return self.total_allowance + self.total_subsidies return self.total_allowance + self.total_subsidies
@property
def total_staff_paid(self):
return self.total_staff - self.total_org_fee
@property @property
def real_staff_count(self): def real_staff_count(self):
@ -455,7 +461,7 @@ class Statement(CommonModel):
@property @property
def total(self): def total(self):
return self.total_bills + self.total_staff + self.paid_ljp_contributions return self.total_bills + self.total_staff_paid + self.paid_ljp_contributions
@property @property
def total_theoretic(self): def total_theoretic(self):
@ -507,10 +513,10 @@ class Statement(CommonModel):
'participant_count': self.excursion.participant_count, 'participant_count': self.excursion.participant_count,
'total_seminar_days': self.excursion.total_seminar_days, 'total_seminar_days': self.excursion.total_seminar_days,
'ljp_tax': settings.LJP_TAX * 100, 'ljp_tax': settings.LJP_TAX * 100,
'total_subsidies_theoretical': self.total_subsidies_theoretical,
'total_org_fee_theoretical': self.total_org_fee_theoretical, 'total_org_fee_theoretical': self.total_org_fee_theoretical,
'total_org_fee': self.total_org_fee, 'total_org_fee': self.total_org_fee,
'old_participant_count': self.excursion.old_participant_count, 'old_participant_count': self.excursion.old_participant_count,
'total_staff_paid': self.total_staff_paid,
} }
return dict(context, **excursion_context) return dict(context, **excursion_context)
else: else:

@ -98,7 +98,7 @@
{% endif %} {% endif %}
{% if statement.subsidy_to %} {% if statement.subsidy_to %}
<p> <p>
{% blocktrans %}The subsidies for night and transportation costs of {{ total_subsidies_theoretical }}€ should be paid to:{% endblocktrans %} {% blocktrans %}The subsidies for night and transportation costs of {{ total_subsidies }}€ should be paid to:{% endblocktrans %}
<table> <table>
<th> <th>
<td>{% trans "IBAN valid" %}</td> <td>{% trans "IBAN valid" %}</td>
@ -115,12 +115,14 @@
{% endif %} {% endif %}
{% if total_org_fee %} {% if total_org_fee %}
<h3>{% trans "Org fee" %}</h3>
{% blocktrans %}Since overaged people where part of the excursion, an organisational fee of 10,00€ per person per day has to be paid. This totals to {{ total_org_fee_theoretical }}€. This organisational fee will be accounted against allowances and subsidies.{% endblocktrans %} {% blocktrans %}Since overaged people where part of the excursion, an organisational fee of 10,00€ per person per day has to be paid. This totals to {{ total_org_fee_theoretical }}€. This organisational fee will be accounted against allowances and subsidies.{% endblocktrans %}
{% endif %} {% endif %}
{% if statement.ljp_to %} {% if statement.ljp_to %}
<h3>{% trans "LJP contributions" %}</h3>
<p> <p>
{% blocktrans %} The youth leaders have documented interventions worth of {{ total_seminar_days }} seminar {% blocktrans %} The youth leaders have documented interventions worth of {{ total_seminar_days }} seminar
days for {{ participant_count }} eligible participants. Taking into account the maximum contribution quota days for {{ participant_count }} eligible participants. Taking into account the maximum contribution quota
@ -172,7 +174,7 @@ Once their proposal was approved, the ljp contributions of should be paid to:{%
</tr> </tr>
<tr> <tr>
<td> <td>
{% trans "Organisation fees" %} {% trans "Org fee" %}
</td> </td>
<td> <td>
-{{ total_org_fee }}€ -{{ total_org_fee }}€

@ -82,6 +82,12 @@ in der Ausgabenübersicht gesondert aufgeführt.
{% endif %} {% endif %}
{% if statement.total_org_fee %}
\noindent\textbf{Organisationsbeitrag}
\noindent An der Ausfahrt haben {{ statement.old_participant_count }} Personen teilgenommen, die 27 Jahre alt oder älter sind. Für sie wird pro Tag ein Organisationsbeitrag von 10,00 € erhoben und mit den bezahlten Zuschüssen und Aufwandsentschädigungen verrechnet.
{% endif %}
{% else %} {% else %}
\vspace{110pt} \vspace{110pt}
{% endif %} {% endif %}
@ -119,7 +125,7 @@ in der Ausgabenübersicht gesondert aufgeführt.
\multicolumn{2}{l}{abzüglich Organisationsbeitrag für {{ old_participant_count }} Teilnehmende über 27 } & & -{{ statement.total_org_fee }}\\ \multicolumn{2}{l}{abzüglich Organisationsbeitrag für {{ old_participant_count }} Teilnehmende über 27 } & & -{{ statement.total_org_fee }}\\
{% endif %} {% endif %}
\midrule \midrule
\multicolumn{3}{l}{\textbf{Summe Zuschüsse und Aufwandsentschädigung Jugendleitende}} & \textbf{ {{ statement.total_staff }} }\\ \multicolumn{3}{l}{\textbf{Summe Zuschüsse und Aufwandsentschädigung Jugendleitende}} & \textbf{ {{ statement.total_staff_paid }} }\\
{%endif %} {%endif %}
{% if statement.ljp_to %} {% if statement.ljp_to %}
\midrule \midrule

@ -1366,12 +1366,11 @@ msgstr ""
#: members/templates/admin/freizeit_finance_overview.html #: members/templates/admin/freizeit_finance_overview.html
#, python-format #, python-format
msgid "" msgid ""
"The subsidies for night and transportation costs of " "The subsidies for night and transportation costs of %(total_subsidies)s€ is "
"%(total_subsidies_theoretical)s€ is configured to be paid to:" "configured to be paid to:"
msgstr "" msgstr ""
"Die Zuschüsse für Übernachtungs- und Fahrtkosten von " "Die Zuschüsse für Übernachtungs- und Fahrtkosten von %(total_subsidies)s€ "
"%(total_subsidies_theoretical)s€ für alle Jugendleiter*innen werden " "für alle Jugendleiter*innen werden ausgezahlt an:"
"ausgezahlt an:"
#: members/templates/admin/freizeit_finance_overview.html #: members/templates/admin/freizeit_finance_overview.html
msgid "" msgid ""
@ -1394,9 +1393,9 @@ msgid ""
msgstr "" msgstr ""
"Achtung: %(old_participant_count)s Teilnehmende der Ausfahrt sind 27 oder " "Achtung: %(old_participant_count)s Teilnehmende der Ausfahrt sind 27 oder "
"älter. Für diese Teilnehmende(n) ist ein Org-Beitrag von 10,00 € pro Tag " "älter. Für diese Teilnehmende(n) ist ein Org-Beitrag von 10,00 € pro Tag "
"fällig. Durch die Länge der Ausfahrt von %(duration)s Tagen werden insgesamt %(total_org_fee_theoretical)s € mit den " "fällig. Durch die Länge der Ausfahrt von %(duration)s Tagen werden insgesamt "
"Zuschüssen und Aufwandsentschädigungen verrechnet, sofern diese in Anspruch " "%(total_org_fee_theoretical)s € mit den Zuschüssen und "
"genommen werden." "Aufwandsentschädigungen verrechnet, sofern diese in Anspruch genommen werden."
#: members/templates/admin/freizeit_finance_overview.html #: members/templates/admin/freizeit_finance_overview.html
msgid "" msgid ""

@ -109,7 +109,7 @@ cost plan!
{% endif %} {% endif %}
{% if memberlist.statement.subsidy_to %} {% if memberlist.statement.subsidy_to %}
<p> <p>
{% blocktrans %}The subsidies for night and transportation costs of {{ total_subsidies_theoretical }}€ is configured to be paid to:{% endblocktrans %} {% blocktrans %}The subsidies for night and transportation costs of {{ total_subsidies }}€ is configured to be paid to:{% endblocktrans %}
<table> <table>
<th> <th>
<td>{% trans "IBAN valid" %}</td> <td>{% trans "IBAN valid" %}</td>
@ -186,7 +186,7 @@ you may obtain up to 25€ times {{ duration }} days for {{ participant_count }}
{% trans "Contributions by the association" %} {% trans "Contributions by the association" %}
</td> </td>
<td> <td>
-{{ total_subsidies_theoretical }}€ -{{ total_subsidies }}€
</td> </td>
</tr> </tr>
<tr> <tr>

Loading…
Cancel
Save