From 42b6f7590b4c97aaa8634363d94119e65673c939 Mon Sep 17 00:00:00 2001 From: mariusrklein <47218379+mariusrklein@users.noreply.github.com> Date: Thu, 27 Mar 2025 23:10:39 +0100 Subject: [PATCH 01/11] feat(finance/excursion): implement org. fee for people over 27 --- .../finance/locale/de/LC_MESSAGES/django.po | 36 +++++++++++++-- jdav_web/finance/models.py | 45 +++++++++++++++++-- .../admin/overview_submitted_statement.html | 17 ++++++- .../members/locale/de/LC_MESSAGES/django.po | 27 +++++++++-- jdav_web/members/models.py | 13 +++++- .../admin/freizeit_finance_overview.html | 18 +++++++- 6 files changed, 139 insertions(+), 17 deletions(-) diff --git a/jdav_web/finance/locale/de/LC_MESSAGES/django.po b/jdav_web/finance/locale/de/LC_MESSAGES/django.po index 5cadb5a..4df0ed4 100644 --- a/jdav_web/finance/locale/de/LC_MESSAGES/django.po +++ b/jdav_web/finance/locale/de/LC_MESSAGES/django.po @@ -302,6 +302,16 @@ msgstr "Übernachtungs- und Fahrtkosten für %(excu)s" msgid "LJP-Contribution %(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 msgid "Total" msgstr "Gesamtbetrag" @@ -528,11 +538,12 @@ msgstr "" #: finance/templates/admin/overview_submitted_statement.html #, python-format msgid "" -"The subsidies for night and transportation costs of %(total_subsidies)s€ " -"should be paid to:" +"The subsidies for night and transportation costs of " +"%(total_subsidies_theoretical)s€ should be paid to:" msgstr "" -"Die Zuschüsse für Übernachtungs- und Fahrtkosten von %(total_subsidies)s€ " -"für alle Jugendleiter*innen sollen ausgezahlt werden an:" +"Die Zuschüsse für Übernachtungs- und Fahrtkosten von " +"%(total_subsidies_theoretical)s€ für alle Jugendleiter*innen sollen " +"ausgezahlt werden an:" #: finance/templates/admin/overview_submitted_statement.html msgid "" @@ -541,6 +552,23 @@ msgstr "" "Keine Empfänger*innen für Sektionszuschüsse angegeben. Es werden daher keine " "Sektionszuschüsse ausbezahlt." +#: finance/templates/admin/overview_submitted_statement.html +#, python-format +msgid "" +"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)s€. This organisational fee will be accounted " +"against allowances and subsidies." +msgstr "" +"Da Personen über 27 an der Ausfahrt teilnehommen haben, wird ein " +"Organisationsbeitrag von 10,00€ pro Person und Tag fällig. Der Gesamtbetrag " +"von %(total_org_fee_theoretical)s€ wird mit Zuschüssen und " +"Aufwandsentschädigungen verrechnet." + +#: finance/templates/admin/overview_submitted_statement.html +msgid "Organisation fees" +msgstr "Org-Beitrag" + #: finance/templates/admin/overview_submitted_statement.html #, python-format msgid "" diff --git a/jdav_web/finance/models.py b/jdav_web/finance/models.py index 5765aef..11477d4 100644 --- a/jdav_web/finance/models.py +++ b/jdav_web/finance/models.py @@ -135,6 +135,10 @@ class Statement(CommonModel): needed_paiments.extend([(yl, self.allowance_per_yl) for yl in self.allowance_to.all()]) if self.subsidy_to: needed_paiments.append((self.subsidy_to, self.total_subsidies)) + # only include org fee if either allowance or subsidy is claimed (part of the property) + elif self.total_org_fee: + needed_paiments.append((self.allowance_to.all()[0], self.total_subsidies)) + if self.ljp_to: needed_paiments.append((self.ljp_to, self.paid_ljp_contributions)) @@ -247,13 +251,23 @@ class Statement(CommonModel): Transaction(statement=self, member=yl, amount=self.allowance_per_yl, confirmed=False, reference=ref).save() # subsidies (i.e. night and transportation costs) - if self.subsidy_to: - 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() + if self.subsidy_to or self.total_org_fee: + if self.total_org_fee == 0: + ref = _("Night and travel costs for %(excu)s") % {'excu': self.excursion.name} + elif not self.subsidy_to: + ref = _("reduced by 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 + member = self.subsidy_to if self.subsidy_to else self.allowance_to.all()[0] + + Transaction(statement=self, member=member, amount=self.total_subsidies, confirmed=False, reference=ref).save() if self.ljp_to: ref = _("LJP-Contribution %(excu)s") % {'excu': self.excursion.name} Transaction(statement=self, member=self.ljp_to, amount=self.paid_ljp_contributions, confirmed=False, reference=ref).save() + return True @@ -369,7 +383,21 @@ class Statement(CommonModel): return cvt_to_decimal(self.total_staff / self.excursion.staff_count) @property - def total_subsidies(self): + def total_org_fee_theoretical(self): + """participants older than 26.99 years need to pay a fee of 10€ per person per day.""" + if self.excursion is None: + return 0 + return cvt_to_decimal(10 * self.excursion.duration * self.excursion.old_participant_count) + + @property + def total_org_fee(self): + """only calculate org fee if subsidies or allowances are claimed.""" + if self.subsidy_to or self.allowances_paid > 0: + return self.total_org_fee_theoretical + return cvt_to_decimal(0) + + @property + def total_subsidies_theoretical(self): """ 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. @@ -378,6 +406,10 @@ class Statement(CommonModel): return (self.transportation_per_yl + self.nights_per_yl) * self.real_staff_count else: return cvt_to_decimal(0) + + @property + def total_subsidies(self): + return self.total_subsidies_theoretical - self.total_org_fee @property def theoretical_total_staff(self): @@ -460,6 +492,7 @@ class Statement(CommonModel): 'allowances_paid': self.allowances_paid, 'nights_per_yl': self.nights_per_yl, 'allowance_per_yl': self.allowance_per_yl, + 'total_allowance': self.total_allowance, 'transportation_per_yl': self.transportation_per_yl, 'total_per_yl': self.total_per_yl, 'total_staff': self.total_staff, @@ -475,6 +508,10 @@ class Statement(CommonModel): 'participant_count': self.excursion.participant_count, 'total_seminar_days': self.excursion.total_seminar_days, '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': self.total_org_fee, + 'old_participant_count': self.excursion.old_participant_count, } return dict(context, **excursion_context) else: diff --git a/jdav_web/finance/templates/admin/overview_submitted_statement.html b/jdav_web/finance/templates/admin/overview_submitted_statement.html index 0d97736..cdd4d09 100644 --- a/jdav_web/finance/templates/admin/overview_submitted_statement.html +++ b/jdav_web/finance/templates/admin/overview_submitted_statement.html @@ -98,7 +98,7 @@ {% endif %} {% if statement.subsidy_to %}

-{% blocktrans %}The subsidies for night and transportation costs of {{ total_subsidies }}€ should be paid to:{% endblocktrans %} +{% blocktrans %}The subsidies for night and transportation costs of {{ total_subsidies_theoretical }}€ should be paid to:{% endblocktrans %} @@ -109,10 +109,17 @@
{% trans "IBAN valid" %}

+ {% else %}

{% blocktrans %}No receivers of the subsidies were provided. Subsidies will not be used.{% endblocktrans %}

{% endif %} +{% if total_org_fee %} +{% 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 %} + + {% if statement.ljp_to %}

{% blocktrans %} The youth leaders have documented interventions worth of {{ total_seminar_days }} seminar @@ -163,6 +170,14 @@ Once their proposal was approved, the ljp contributions of should be paid to:{% {{ total_subsidies }}€ + + + {% trans "Organisation fees" %} + + + -{{ total_org_fee }}€ + + {% trans "ljp contributions" %} diff --git a/jdav_web/members/locale/de/LC_MESSAGES/django.po b/jdav_web/members/locale/de/LC_MESSAGES/django.po index 108b36f..ed43669 100644 --- a/jdav_web/members/locale/de/LC_MESSAGES/django.po +++ b/jdav_web/members/locale/de/LC_MESSAGES/django.po @@ -1366,11 +1366,12 @@ msgstr "" #: 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:" +"The subsidies for night and transportation costs of " +"%(total_subsidies_theoretical)s€ is configured to be paid to:" msgstr "" -"Die Zuschüsse für Übernachtungs- und Fahrtkosten von %(total_subsidies)s€ " -"für alle Jugendleiter*innen werden ausgezahlt an:" +"Die Zuschüsse für Übernachtungs- und Fahrtkosten von " +"%(total_subsidies_theoretical)s€ für alle Jugendleiter*innen werden " +"ausgezahlt an:" #: members/templates/admin/freizeit_finance_overview.html msgid "" @@ -1379,6 +1380,20 @@ msgstr "" "Keine Empfänger*innen für Sektionszuschüsse angegeben. Es werden daher keine " "Sektionszuschüsse ausbezahlt." +#: members/templates/admin/freizeit_finance_overview.html +#, python-format +msgid "" +"Warning: %(old_participant_count)s participant(s) of the excursion are 27 or " +"older. For each of them, an organisation fee of 10,00 € per day has to be " +"paid to the account. A total of %(total_org_fee_theoretical)s € is charged " +"against the other transactions." +msgstr "" +"Achtung: %(old_participant_count)s Teilnehmende der Ausfahrt sind 27 oder " +"älter. Für diese Teilnehmende ist ein Org-Beitrag von 10,00 € pro Tag " +"fällig. Daher werden insgesamt %(total_org_fee_theoretical)s € mit den " +"Zuschüssen und Aufwandsentschädigungen verrechnet, sofern diese in Anspruch " +"genommen werden." + #: members/templates/admin/freizeit_finance_overview.html msgid "" "Warning: The configured recipients of the allowance don't match the " @@ -1442,6 +1457,10 @@ msgstr "Zusammenfassung" msgid "This is the estimated cost and contribution summary:" msgstr "Das ist die geschätzte Kosten- und Zuschussübersicht." +#: members/templates/admin/freizeit_finance_overview.html +msgid "Organisation fees" +msgstr "Org-Beitrag" + #: members/templates/admin/freizeit_finance_overview.html msgid "Potential LJP contributions" msgstr "Mögliche LJP Zuschüsse" diff --git a/jdav_web/members/models.py b/jdav_web/members/models.py index aedcf49..7fdf422 100644 --- a/jdav_web/members/models.py +++ b/jdav_web/members/models.py @@ -1328,10 +1328,19 @@ class Freizeit(CommonModel): @property def participant_count(self): + return len(self.participants) + + @property + def participants(self): ps = set(map(lambda x: x.member, self.membersonlist.distinct())) jls = set(self.jugendleiter.distinct()) - return len(ps - jls) - + return list(ps - jls) + + @property + def old_participant_count(self): + old_ps = [m for m in self.participants if m.age() >= 27] + return len(old_ps) + @property def head_count(self): return self.staff_on_memberlist_count + self.participant_count diff --git a/jdav_web/members/templates/admin/freizeit_finance_overview.html b/jdav_web/members/templates/admin/freizeit_finance_overview.html index aecc588..43229f1 100644 --- a/jdav_web/members/templates/admin/freizeit_finance_overview.html +++ b/jdav_web/members/templates/admin/freizeit_finance_overview.html @@ -109,7 +109,7 @@ cost plan! {% endif %} {% if memberlist.statement.subsidy_to %}

-{% blocktrans %}The subsidies for night and transportation costs of {{ total_subsidies }}€ is configured to be paid to:{% endblocktrans %} +{% blocktrans %}The subsidies for night and transportation costs of {{ total_subsidies_theoretical }}€ is configured to be paid to:{% endblocktrans %} @@ -122,8 +122,14 @@ cost plan!

{% else %}

{% blocktrans %}No receivers of the subsidies were provided. Subsidies will not be used.{% endblocktrans %}

+{% endif %} +{% if total_org_fee %} +

+{% blocktrans %}Warning: {{ old_participant_count }} participant(s) of the excursion are 27 or older. For each of them, an organisation fee of 10,00 € per day has to be paid to the account. A total of {{ total_org_fee_theoretical }} € is charged against the other transactions.{% endblocktrans %} +

{% endif %} + {% if not memberlist.statement.allowance_to_valid %}

{% 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 %} @@ -178,12 +184,20 @@ you may obtain up to 25€ times {{ duration }} days for {{ participant_count }} {{ total_bills_theoretic }}€

+ + + + -- 2.38.4 From e1c00c20205bc6a5ba08b6993701bf7de3f54cc0 Mon Sep 17 00:00:00 2001 From: mariusrklein <47218379+mariusrklein@users.noreply.github.com> Date: Thu, 27 Mar 2025 23:34:57 +0100 Subject: [PATCH 02/11] feat(finance): display transaction reference length as it is restricted to 140 chars --- jdav_web/finance/admin.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/jdav_web/finance/admin.py b/jdav_web/finance/admin.py index f9a9e2a..b328050 100644 --- a/jdav_web/finance/admin.py +++ b/jdav_web/finance/admin.py @@ -137,6 +137,16 @@ class TransactionOnSubmittedStatementInline(admin.TabularInline): } readonly_fields = ['text_length_warning'] extra = 0 + + def text_length_warning(self, obj): + """Display reference length, warn if exceeds 140 characters.""" + len_reference = len(obj.reference) + len_string = f"{len_reference}/140" + if len_reference > 140: + return mark_safe(f'{len_string}') + + return len_string + text_length_warning.short_description = "Länge" def text_length_warning(self, obj): """Display reference length, warn if exceeds 140 characters.""" -- 2.38.4 From 4b86d5a5c6ccf874f0453628cca2348ea8a873ef Mon Sep 17 00:00:00 2001 From: mariusrklein <47218379+mariusrklein@users.noreply.github.com> Date: Thu, 27 Mar 2025 23:38:09 +0100 Subject: [PATCH 03/11] feat(finance): create finance statement and excursion summary --- jdav_web/finance/templates/finance/statement_summary.tex | 1 - 1 file changed, 1 deletion(-) diff --git a/jdav_web/finance/templates/finance/statement_summary.tex b/jdav_web/finance/templates/finance/statement_summary.tex index ee37f02..1b001a3 100644 --- a/jdav_web/finance/templates/finance/statement_summary.tex +++ b/jdav_web/finance/templates/finance/statement_summary.tex @@ -63,7 +63,6 @@ Zuschüsse und Aufwandsentschädigung werden wie folgt abgerufen: {% if statement.subsidy_to %} \item Der Zuschuss zu Übernachtung und Anreise für alle Jugendleiter*innen in Höhe von {{ statement.total_subsidies }} € wird überwiesen an: {{ statement.subsidy_to.name }} - {% else %} \item Zuschüsse zu Übernachtung und Anreise werden nicht in Anspruch genommen. {% endif %} -- 2.38.4 From cdf91cc69d3a3a5535e3cfd538bd262010bd2047 Mon Sep 17 00:00:00 2001 From: mariusrklein <47218379+mariusrklein@users.noreply.github.com> Date: Sun, 6 Apr 2025 14:23:05 +0200 Subject: [PATCH 04/11] feat(finance/excursion): added ljp payout functionality and tax --- jdav_web/finance/models.py | 1 - .../admin/freizeit_finance_overview.html | 25 +++++-------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/jdav_web/finance/models.py b/jdav_web/finance/models.py index 11477d4..e37f79e 100644 --- a/jdav_web/finance/models.py +++ b/jdav_web/finance/models.py @@ -267,7 +267,6 @@ class Statement(CommonModel): if self.ljp_to: ref = _("LJP-Contribution %(excu)s") % {'excu': self.excursion.name} Transaction(statement=self, member=self.ljp_to, amount=self.paid_ljp_contributions, confirmed=False, reference=ref).save() - return True diff --git a/jdav_web/members/templates/admin/freizeit_finance_overview.html b/jdav_web/members/templates/admin/freizeit_finance_overview.html index 43229f1..00a759f 100644 --- a/jdav_web/members/templates/admin/freizeit_finance_overview.html +++ b/jdav_web/members/templates/admin/freizeit_finance_overview.html @@ -136,29 +136,16 @@ cost plan!

{% endif %} - -{% if memberlist.statement.ljp_to %}

{% trans "LJP contributions" %}

-

-{% blocktrans %}By submitting the given seminar report, you will receive LJP contributions. -You have documented interventions worth of {{ total_seminar_days }} seminar days for {{ participant_count }} participants. -This results in a total contribution of {{ ljp_contributions }}€. -To receive them, you need to submit the LJP-Proposal within 3 weeks after your excursion and have it approved by the finance office.{% endblocktrans %} -

+{% if memberlist.statement.ljp_to %}

- {% blocktrans %}The LJP contributions are configured to be paid to:{% endblocktrans %} -

{% trans "IBAN valid" %}
+ {% trans "Organisation fees" %} + + {{ total_org_fee }}€ +
{% trans "Contributions by the association" %} - -{{ total_subsidies }}€ + -{{ total_subsidies_theoretical }}€
- - - - - - -
- {% trans "IBAN valid" %}
{{ memberlist.statement.ljp_to.name }}{{ memberlist.statement.ljp_to.iban_valid|render_bool }}
-

+ {% blocktrans %}By submitting the given seminar report, you will receive LJP contributions. You have + documented interventions worth of {{ total_seminar_days }} seminar days for {{ participant_count }} participants. + This results in a total contribution of {{ ljp_contributions }}€. To receive them, you need to + submit the LJP-Proposal within 3 weeks after your excursion and have it approved by the finance office. {% endblocktrans %} +

{% else %}

-- 2.38.4 From 59e8237a3f8951fa4a7bebd5c77bfc18b0348687 Mon Sep 17 00:00:00 2001 From: mariusrklein <47218379+mariusrklein@users.noreply.github.com> Date: Sun, 6 Apr 2025 15:36:01 +0200 Subject: [PATCH 05/11] fix: improved verbosity of org fee calculation --- jdav_web/members/locale/de/LC_MESSAGES/django.po | 12 ++++++++---- .../templates/admin/freizeit_finance_overview.html | 4 +++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/jdav_web/members/locale/de/LC_MESSAGES/django.po b/jdav_web/members/locale/de/LC_MESSAGES/django.po index ed43669..381d19f 100644 --- a/jdav_web/members/locale/de/LC_MESSAGES/django.po +++ b/jdav_web/members/locale/de/LC_MESSAGES/django.po @@ -1380,17 +1380,21 @@ msgstr "" "Keine Empfänger*innen für Sektionszuschüsse angegeben. Es werden daher keine " "Sektionszuschüsse ausbezahlt." +#: members/templates/admin/freizeit_finance_overview.html +msgid "Org fee" +msgstr "Organisationsbeitrag" + #: members/templates/admin/freizeit_finance_overview.html #, python-format msgid "" "Warning: %(old_participant_count)s participant(s) of the excursion are 27 or " "older. For each of them, an organisation fee of 10,00 € per day has to be " -"paid to the account. A total of %(total_org_fee_theoretical)s € is charged " -"against the other transactions." +"paid to the account. With a duration of %(duration)s days, a total of " +"%(total_org_fee_theoretical)s € is charged against the other transactions." msgstr "" "Achtung: %(old_participant_count)s Teilnehmende der Ausfahrt sind 27 oder " -"älter. Für diese Teilnehmende ist ein Org-Beitrag von 10,00 € pro Tag " -"fällig. Daher werden insgesamt %(total_org_fee_theoretical)s € mit den " +"ä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 " "Zuschüssen und Aufwandsentschädigungen verrechnet, sofern diese in Anspruch " "genommen werden." diff --git a/jdav_web/members/templates/admin/freizeit_finance_overview.html b/jdav_web/members/templates/admin/freizeit_finance_overview.html index 00a759f..bd50ae5 100644 --- a/jdav_web/members/templates/admin/freizeit_finance_overview.html +++ b/jdav_web/members/templates/admin/freizeit_finance_overview.html @@ -125,8 +125,10 @@ cost plan! {% endif %} {% if total_org_fee %} + +

{% trans "Org fee" %}

-{% blocktrans %}Warning: {{ old_participant_count }} participant(s) of the excursion are 27 or older. For each of them, an organisation fee of 10,00 € per day has to be paid to the account. A total of {{ total_org_fee_theoretical }} € is charged against the other transactions.{% endblocktrans %} +{% blocktrans %}Warning: {{ old_participant_count }} participant(s) of the excursion are 27 or older. For each of them, an organisation fee of 10,00 € per day has to be paid to the account. With a duration of {{ duration }} days, a total of {{ total_org_fee_theoretical }} € is charged against the other transactions.{% endblocktrans %}

{% endif %} -- 2.38.4 From cd90387476bebdc52c56d95b33b0e760ff63226e Mon Sep 17 00:00:00 2001 From: mariusrklein <47218379+mariusrklein@users.noreply.github.com> Date: Sun, 6 Apr 2025 15:56:49 +0200 Subject: [PATCH 06/11] added org-beitrag to statement summary --- jdav_web/finance/locale/de/LC_MESSAGES/django.po | 10 ++++++++++ .../finance/templates/finance/statement_summary.tex | 3 +++ 2 files changed, 13 insertions(+) diff --git a/jdav_web/finance/locale/de/LC_MESSAGES/django.po b/jdav_web/finance/locale/de/LC_MESSAGES/django.po index 4df0ed4..cff36a5 100644 --- a/jdav_web/finance/locale/de/LC_MESSAGES/django.po +++ b/jdav_web/finance/locale/de/LC_MESSAGES/django.po @@ -297,6 +297,16 @@ msgstr "Aufwandsentschädigung für %(excu)s" msgid "Night and travel costs for %(excu)s" msgstr "Übernachtungs- und Fahrtkosten für %(excu)s" +#: finance/models.py +msgid "reduced by org fee" +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 #, python-format msgid "LJP-Contribution %(excu)s" diff --git a/jdav_web/finance/templates/finance/statement_summary.tex b/jdav_web/finance/templates/finance/statement_summary.tex index 1b001a3..55f26a3 100644 --- a/jdav_web/finance/templates/finance/statement_summary.tex +++ b/jdav_web/finance/templates/finance/statement_summary.tex @@ -115,6 +115,9 @@ in der Ausgabenübersicht gesondert aufgeführt. {% if statement.subsidy_to %} \multicolumn{2}{l}{Zuschuss Übernachtung und Anreise für alle Jugendleiter*innen} & {{ statement.subsidy_to.name|esc_all }} & {{ statement.total_subsidies }} €\\ {% endif %} + {% if statement.total_org_fee %} + \multicolumn{2}{l}{abzüglich Organisationsbeitrag für {{ old_participant_count }} Teilnehmende über 27 } & & -{{ statement.total_org_fee }} €\\ + {% endif %} \midrule \multicolumn{3}{l}{\textbf{Summe Zuschüsse und Aufwandsentschädigung Jugendleitende}} & \textbf{ {{ statement.total_staff }} }€\\ {%endif %} -- 2.38.4 From 4ad5b074755d581dcb63983daea5cd7ee76e086e Mon Sep 17 00:00:00 2001 From: mariusrklein <47218379+mariusrklein@users.noreply.github.com> Date: Tue, 15 Apr 2025 22:01:27 +0200 Subject: [PATCH 07/11] fix: simplified logic and increased verbosity --- .../finance/locale/de/LC_MESSAGES/django.po | 35 +++++----------- jdav_web/finance/models.py | 42 +++++++++++-------- .../admin/overview_submitted_statement.html | 6 ++- .../templates/finance/statement_summary.tex | 8 +++- .../members/locale/de/LC_MESSAGES/django.po | 15 ++++--- .../admin/freizeit_finance_overview.html | 4 +- 6 files changed, 55 insertions(+), 55 deletions(-) diff --git a/jdav_web/finance/locale/de/LC_MESSAGES/django.po b/jdav_web/finance/locale/de/LC_MESSAGES/django.po index cff36a5..c875643 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-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" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -301,27 +301,11 @@ msgstr "Übernachtungs- und Fahrtkosten für %(excu)s" msgid "reduced by org fee" 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 #, python-format msgid "LJP-Contribution %(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 msgid "Total" msgstr "Gesamtbetrag" @@ -548,12 +532,11 @@ msgstr "" #: finance/templates/admin/overview_submitted_statement.html #, python-format msgid "" -"The subsidies for night and transportation costs of " -"%(total_subsidies_theoretical)s€ should be paid to:" +"The subsidies for night and transportation costs of %(total_subsidies)s€ " +"should be paid to:" msgstr "" -"Die Zuschüsse für Übernachtungs- und Fahrtkosten von " -"%(total_subsidies_theoretical)s€ für alle Jugendleiter*innen sollen " -"ausgezahlt werden an:" +"Die Zuschüsse für Übernachtungs- und Fahrtkosten von %(total_subsidies)s€ " +"für alle Jugendleiter*innen sollen ausgezahlt werden an:" #: finance/templates/admin/overview_submitted_statement.html msgid "" @@ -562,6 +545,10 @@ msgstr "" "Keine Empfänger*innen für Sektionszuschüsse angegeben. Es werden daher keine " "Sektionszuschüsse ausbezahlt." +#: finance/templates/admin/overview_submitted_statement.html +msgid "Org fee" +msgstr "Organisationsbeitrag" + #: finance/templates/admin/overview_submitted_statement.html #, python-format msgid "" @@ -576,8 +563,8 @@ msgstr "" "Aufwandsentschädigungen verrechnet." #: finance/templates/admin/overview_submitted_statement.html -msgid "Organisation fees" -msgstr "Org-Beitrag" +msgid "LJP contributions" +msgstr "LJP-Zuschüsse" #: finance/templates/admin/overview_submitted_statement.html #, python-format diff --git a/jdav_web/finance/models.py b/jdav_web/finance/models.py index e37f79e..51ea118 100644 --- a/jdav_web/finance/models.py +++ b/jdav_web/finance/models.py @@ -135,9 +135,10 @@ class Statement(CommonModel): needed_paiments.extend([(yl, self.allowance_per_yl) for yl in self.allowance_to.all()]) if self.subsidy_to: needed_paiments.append((self.subsidy_to, self.total_subsidies)) + # only include org fee if either allowance or subsidy is claimed (part of the property) - elif self.total_org_fee: - needed_paiments.append((self.allowance_to.all()[0], self.total_subsidies)) + if self.total_org_fee: + needed_paiments.append((self.org_fee_payant, -self.total_org_fee)) if self.ljp_to: 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() # subsidies (i.e. night and transportation costs) - if self.subsidy_to or self.total_org_fee: - if self.total_org_fee == 0: - ref = _("Night and travel costs for %(excu)s") % {'excu': self.excursion.name} - elif not self.subsidy_to: - ref = _("reduced by org fee") - else: - ref = _("Night and travel costs for %(excu)s, reduced by org fee") % {'excu': self.excursion.name} - + if self.subsidy_to: + 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() + + if self.total_org_fee: # 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] - - Transaction(statement=self, member=member, amount=self.total_subsidies, confirmed=False, reference=ref).save() + ref = _("reduced by org fee") + Transaction(statement=self, member=self.org_fee_payant, amount=-self.total_org_fee, confirmed=False, reference=ref).save() if self.ljp_to: ref = _("LJP-Contribution %(excu)s") % {'excu': self.excursion.name} @@ -396,7 +393,11 @@ class Statement(CommonModel): return cvt_to_decimal(0) @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 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) @property - def total_subsidies(self): - return self.total_subsidies_theoretical - self.total_org_fee + def subsidies_paid(self): + return self.total_subsidies - self.total_org_fee @property def theoretical_total_staff(self): @@ -423,6 +424,11 @@ class Statement(CommonModel): the sum of subsidies and allowances that youth leaders are actually collecting """ return self.total_allowance + self.total_subsidies + + @property + def total_staff_paid(self): + return self.total_staff - self.total_org_fee + @property def real_staff_count(self): @@ -455,7 +461,7 @@ class Statement(CommonModel): @property 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 def total_theoretic(self): @@ -507,10 +513,10 @@ class Statement(CommonModel): 'participant_count': self.excursion.participant_count, 'total_seminar_days': self.excursion.total_seminar_days, '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': self.total_org_fee, 'old_participant_count': self.excursion.old_participant_count, + 'total_staff_paid': self.total_staff_paid, } return dict(context, **excursion_context) else: diff --git a/jdav_web/finance/templates/admin/overview_submitted_statement.html b/jdav_web/finance/templates/admin/overview_submitted_statement.html index cdd4d09..c93cc08 100644 --- a/jdav_web/finance/templates/admin/overview_submitted_statement.html +++ b/jdav_web/finance/templates/admin/overview_submitted_statement.html @@ -98,7 +98,7 @@ {% endif %} {% if statement.subsidy_to %}

-{% 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 %} @@ -115,12 +115,14 @@ {% endif %} {% if total_org_fee %} +

{% trans "Org fee" %}

{% 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 %} {% if statement.ljp_to %} +

{% trans "LJP contributions" %}

{% 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 @@ -172,7 +174,7 @@ Once their proposal was approved, the ljp contributions of should be paid to:{%

{% trans "IBAN valid" %}
- {% trans "Organisation fees" %} + {% trans "Org fee" %} -{{ total_org_fee }}€ diff --git a/jdav_web/finance/templates/finance/statement_summary.tex b/jdav_web/finance/templates/finance/statement_summary.tex index 55f26a3..d9b3678 100644 --- a/jdav_web/finance/templates/finance/statement_summary.tex +++ b/jdav_web/finance/templates/finance/statement_summary.tex @@ -82,6 +82,12 @@ in der Ausgabenübersicht gesondert aufgeführt. {% 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 %} \vspace{110pt} {% 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 }} €\\ {% endif %} \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 %} {% if statement.ljp_to %} \midrule diff --git a/jdav_web/members/locale/de/LC_MESSAGES/django.po b/jdav_web/members/locale/de/LC_MESSAGES/django.po index 381d19f..cd4e1e8 100644 --- a/jdav_web/members/locale/de/LC_MESSAGES/django.po +++ b/jdav_web/members/locale/de/LC_MESSAGES/django.po @@ -1366,12 +1366,11 @@ msgstr "" #: members/templates/admin/freizeit_finance_overview.html #, python-format msgid "" -"The subsidies for night and transportation costs of " -"%(total_subsidies_theoretical)s€ is configured to be paid to:" +"The subsidies for night and transportation costs of %(total_subsidies)s€ is " +"configured to be paid to:" msgstr "" -"Die Zuschüsse für Übernachtungs- und Fahrtkosten von " -"%(total_subsidies_theoretical)s€ für alle Jugendleiter*innen werden " -"ausgezahlt an:" +"Die Zuschüsse für Übernachtungs- und Fahrtkosten von %(total_subsidies)s€ " +"für alle Jugendleiter*innen werden ausgezahlt an:" #: members/templates/admin/freizeit_finance_overview.html msgid "" @@ -1394,9 +1393,9 @@ msgid "" msgstr "" "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 " -"fällig. Durch die Länge der Ausfahrt von %(duration)s Tagen werden insgesamt %(total_org_fee_theoretical)s € mit den " -"Zuschüssen und Aufwandsentschädigungen verrechnet, sofern diese in Anspruch " -"genommen werden." +"fällig. Durch die Länge der Ausfahrt von %(duration)s Tagen werden insgesamt " +"%(total_org_fee_theoretical)s € mit den Zuschüssen und " +"Aufwandsentschädigungen verrechnet, sofern diese in Anspruch genommen werden." #: members/templates/admin/freizeit_finance_overview.html msgid "" diff --git a/jdav_web/members/templates/admin/freizeit_finance_overview.html b/jdav_web/members/templates/admin/freizeit_finance_overview.html index bd50ae5..ee9b311 100644 --- a/jdav_web/members/templates/admin/freizeit_finance_overview.html +++ b/jdav_web/members/templates/admin/freizeit_finance_overview.html @@ -109,7 +109,7 @@ cost plan! {% endif %} {% if memberlist.statement.subsidy_to %}

-{% 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 %} @@ -186,7 +186,7 @@ you may obtain up to 25€ times {{ duration }} days for {{ participant_count }} {% trans "Contributions by the association" %} -- 2.38.4 From 2c5e3988f3053f7a071c366fbc8ad872854ab519 Mon Sep 17 00:00:00 2001 From: mariusrklein <47218379+mariusrklein@users.noreply.github.com> Date: Tue, 15 Apr 2025 22:10:17 +0200 Subject: [PATCH 08/11] translations --- .../members/locale/de/LC_MESSAGES/django.po | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/jdav_web/members/locale/de/LC_MESSAGES/django.po b/jdav_web/members/locale/de/LC_MESSAGES/django.po index cd4e1e8..cf44d76 100644 --- a/jdav_web/members/locale/de/LC_MESSAGES/django.po +++ b/jdav_web/members/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-04-11 00:56+0200\n" +"POT-Creation-Date: 2025-04-15 22:08+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1415,12 +1415,14 @@ msgstr "LJP Zuschüsse" #: members/templates/admin/freizeit_finance_overview.html #, python-format msgid "" -"By submitting the given seminar report, you will receive LJP contributions.\n" -"You have documented interventions worth of %(total_seminar_days)s seminar " -"days for %(participant_count)s participants.\n" -"This results in a total contribution of %(ljp_contributions)s€.\n" -"To receive them, you need to submit the LJP-Proposal within 3 weeks after " -"your excursion and have it approved by the finance office." +"By submitting the given seminar report, you will receive LJP contributions. " +"You have\n" +" documented interventions worth of %(total_seminar_days)s seminar days " +"for %(participant_count)s participants.\n" +" This results in a total contribution of %(ljp_contributions)s€. To " +"receive them, you need to \n" +" submit the LJP-Proposal within 3 weeks after your excursion and have it " +"approved by the finance office. " msgstr "" "Wenn du den erstellten LJP-Antrag einreichst, erhältst du LJP-Zuschüsse. Du " "hast Lehreinheiten für insgesamt %(total_seminar_days)s Seminartage und für " @@ -1429,10 +1431,6 @@ msgstr "" "Um den zu erhalten, musst du den LJP-Antrag innerhalb von 3 Wochen nach der " "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 "" -- 2.38.4 From eebbed858b62428c107bc28b86b359921818c065 Mon Sep 17 00:00:00 2001 From: mariusrklein <47218379+mariusrklein@users.noreply.github.com> Date: Tue, 15 Apr 2025 22:23:07 +0200 Subject: [PATCH 09/11] fix merge inconsistencies --- jdav_web/finance/admin.py | 10 ------- .../templates/finance/statement_summary.tex | 1 + .../members/locale/de/LC_MESSAGES/django.po | 20 +++++++------- .../admin/freizeit_finance_overview.html | 26 ++++++++++++++----- 4 files changed, 31 insertions(+), 26 deletions(-) diff --git a/jdav_web/finance/admin.py b/jdav_web/finance/admin.py index b328050..f9a9e2a 100644 --- a/jdav_web/finance/admin.py +++ b/jdav_web/finance/admin.py @@ -137,16 +137,6 @@ class TransactionOnSubmittedStatementInline(admin.TabularInline): } readonly_fields = ['text_length_warning'] extra = 0 - - def text_length_warning(self, obj): - """Display reference length, warn if exceeds 140 characters.""" - len_reference = len(obj.reference) - len_string = f"{len_reference}/140" - if len_reference > 140: - return mark_safe(f'{len_string}') - - return len_string - text_length_warning.short_description = "Länge" def text_length_warning(self, obj): """Display reference length, warn if exceeds 140 characters.""" diff --git a/jdav_web/finance/templates/finance/statement_summary.tex b/jdav_web/finance/templates/finance/statement_summary.tex index d9b3678..d9bac97 100644 --- a/jdav_web/finance/templates/finance/statement_summary.tex +++ b/jdav_web/finance/templates/finance/statement_summary.tex @@ -63,6 +63,7 @@ Zuschüsse und Aufwandsentschädigung werden wie folgt abgerufen: {% if statement.subsidy_to %} \item Der Zuschuss zu Übernachtung und Anreise für alle Jugendleiter*innen in Höhe von {{ statement.total_subsidies }} € wird überwiesen an: {{ statement.subsidy_to.name }} + {% else %} \item Zuschüsse zu Übernachtung und Anreise werden nicht in Anspruch genommen. {% endif %} diff --git a/jdav_web/members/locale/de/LC_MESSAGES/django.po b/jdav_web/members/locale/de/LC_MESSAGES/django.po index cf44d76..b616d92 100644 --- a/jdav_web/members/locale/de/LC_MESSAGES/django.po +++ b/jdav_web/members/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-04-15 22:08+0200\n" +"POT-Creation-Date: 2025-04-15 22:18+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1415,14 +1415,12 @@ msgstr "LJP Zuschüsse" #: members/templates/admin/freizeit_finance_overview.html #, python-format msgid "" -"By submitting the given seminar report, you will receive LJP contributions. " -"You have\n" -" documented interventions worth of %(total_seminar_days)s seminar days " -"for %(participant_count)s participants.\n" -" This results in a total contribution of %(ljp_contributions)s€. To " -"receive them, you need to \n" -" submit the LJP-Proposal within 3 weeks after your excursion and have it " -"approved by the finance office. " +"By submitting the given seminar report, you will receive LJP contributions.\n" +"You have documented interventions worth of %(total_seminar_days)s seminar " +"days for %(participant_count)s participants.\n" +"This results in a total contribution of %(ljp_contributions)s€.\n" +"To receive them, you need to submit the LJP-Proposal within 3 weeks after " +"your excursion and have it approved by the finance office." msgstr "" "Wenn du den erstellten LJP-Antrag einreichst, erhältst du LJP-Zuschüsse. Du " "hast Lehreinheiten für insgesamt %(total_seminar_days)s Seminartage und für " @@ -1431,6 +1429,10 @@ msgstr "" "Um den zu erhalten, musst du den LJP-Antrag innerhalb von 3 Wochen nach der " "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 "" diff --git a/jdav_web/members/templates/admin/freizeit_finance_overview.html b/jdav_web/members/templates/admin/freizeit_finance_overview.html index ee9b311..9fea2f0 100644 --- a/jdav_web/members/templates/admin/freizeit_finance_overview.html +++ b/jdav_web/members/templates/admin/freizeit_finance_overview.html @@ -125,7 +125,6 @@ cost plan! {% endif %} {% if total_org_fee %} -

{% trans "Org fee" %}

{% blocktrans %}Warning: {{ old_participant_count }} participant(s) of the excursion are 27 or older. For each of them, an organisation fee of 10,00 € per day has to be paid to the account. With a duration of {{ duration }} days, a total of {{ total_org_fee_theoretical }} € is charged against the other transactions.{% endblocktrans %} @@ -138,16 +137,29 @@ cost plan!

{% endif %} -

{% trans "LJP contributions" %}

{% if memberlist.statement.ljp_to %} +

{% trans "LJP contributions" %}

- {% blocktrans %}By submitting the given seminar report, you will receive LJP contributions. You have - documented interventions worth of {{ total_seminar_days }} seminar days for {{ participant_count }} participants. - This results in a total contribution of {{ ljp_contributions }}€. To receive them, you need to - submit the LJP-Proposal within 3 weeks after your excursion and have it approved by the finance office. {% endblocktrans %} -

+{% blocktrans %}By submitting the given seminar report, you will receive LJP contributions. +You have documented interventions worth of {{ total_seminar_days }} seminar days for {{ participant_count }} participants. +This results in a total contribution of {{ ljp_contributions }}€. +To receive them, you need to submit the LJP-Proposal within 3 weeks after your excursion and have it approved by the finance office.{% endblocktrans %} +

+ +

+ {% blocktrans %}The LJP contributions are configured to be paid to:{% endblocktrans %} +

{% trans "IBAN valid" %} - -{{ total_subsidies_theoretical }}€ + -{{ total_subsidies }}€
+ + + + + + +
+ {% trans "IBAN valid" %}
{{ memberlist.statement.ljp_to.name }}{{ memberlist.statement.ljp_to.iban_valid|render_bool }}
+

{% else %}

-- 2.38.4 From f9e2bc540f9bdda598ba362a84a7a6c4de7d983c Mon Sep 17 00:00:00 2001 From: mariusrklein <47218379+mariusrklein@users.noreply.github.com> Date: Sun, 27 Apr 2025 15:22:04 +0200 Subject: [PATCH 10/11] fix ljp title in cost overview --- .../members/templates/admin/freizeit_finance_overview.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdav_web/members/templates/admin/freizeit_finance_overview.html b/jdav_web/members/templates/admin/freizeit_finance_overview.html index 9fea2f0..a805ee8 100644 --- a/jdav_web/members/templates/admin/freizeit_finance_overview.html +++ b/jdav_web/members/templates/admin/freizeit_finance_overview.html @@ -137,9 +137,9 @@ cost plan!

{% endif %} - -{% if memberlist.statement.ljp_to %}

{% trans "LJP contributions" %}

+{% if memberlist.statement.ljp_to %} +

{% blocktrans %}By submitting the given seminar report, you will receive LJP contributions. -- 2.38.4 From 633230b6070501d545d2ec3207dbad7458de7202 Mon Sep 17 00:00:00 2001 From: mariusrklein <47218379+mariusrklein@users.noreply.github.com> Date: Sun, 27 Apr 2025 23:03:32 +0200 Subject: [PATCH 11/11] abstract org fee into config variable --- jdav_web/finance/locale/de/LC_MESSAGES/django.po | 6 +++--- jdav_web/finance/models.py | 5 +++-- .../admin/overview_submitted_statement.html | 2 +- .../templates/finance/statement_summary.tex | 4 ++-- jdav_web/jdav_web/settings/local.py | 2 ++ jdav_web/members/locale/de/LC_MESSAGES/django.po | 16 ++++++++-------- .../admin/freizeit_finance_overview.html | 2 +- 7 files changed, 20 insertions(+), 17 deletions(-) diff --git a/jdav_web/finance/locale/de/LC_MESSAGES/django.po b/jdav_web/finance/locale/de/LC_MESSAGES/django.po index c875643..df726c6 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-04-15 21:12+0200\n" +"POT-Creation-Date: 2025-04-27 23:00+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -553,12 +553,12 @@ msgstr "Organisationsbeitrag" #, python-format msgid "" "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 " +"%(org_fee)s€ per person per day has to be paid. This totals to " "%(total_org_fee_theoretical)s€. This organisational fee will be accounted " "against allowances and subsidies." msgstr "" "Da Personen über 27 an der Ausfahrt teilnehommen haben, wird ein " -"Organisationsbeitrag von 10,00€ pro Person und Tag fällig. Der Gesamtbetrag " +"Organisationsbeitrag von %(org_fee)s€ pro Person und Tag fällig. Der Gesamtbetrag " "von %(total_org_fee_theoretical)s€ wird mit Zuschüssen und " "Aufwandsentschädigungen verrechnet." diff --git a/jdav_web/finance/models.py b/jdav_web/finance/models.py index 7c36025..2e4b3e1 100644 --- a/jdav_web/finance/models.py +++ b/jdav_web/finance/models.py @@ -381,10 +381,10 @@ class Statement(CommonModel): @property def total_org_fee_theoretical(self): - """participants older than 26.99 years need to pay a fee of 10€ per person per day.""" + """participants older than 26.99 years need to pay a specified organisation fee per person per day.""" if self.excursion is None: return 0 - return cvt_to_decimal(10 * self.excursion.duration * self.excursion.old_participant_count) + return cvt_to_decimal(settings.EXCURSION_ORG_FEE * self.excursion.duration * self.excursion.old_participant_count) @property def total_org_fee(self): @@ -523,6 +523,7 @@ class Statement(CommonModel): 'total_org_fee': self.total_org_fee, 'old_participant_count': self.excursion.old_participant_count, 'total_staff_paid': self.total_staff_paid, + 'org_fee': cvt_to_decimal(settings.EXCURSION_ORG_FEE), } return dict(context, **excursion_context) else: diff --git a/jdav_web/finance/templates/admin/overview_submitted_statement.html b/jdav_web/finance/templates/admin/overview_submitted_statement.html index c93cc08..c8dc382 100644 --- a/jdav_web/finance/templates/admin/overview_submitted_statement.html +++ b/jdav_web/finance/templates/admin/overview_submitted_statement.html @@ -116,7 +116,7 @@ {% if total_org_fee %}

{% trans "Org fee" %}

-{% 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 {{ org_fee }}€ 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 %} diff --git a/jdav_web/finance/templates/finance/statement_summary.tex b/jdav_web/finance/templates/finance/statement_summary.tex index d9bac97..99657e4 100644 --- a/jdav_web/finance/templates/finance/statement_summary.tex +++ b/jdav_web/finance/templates/finance/statement_summary.tex @@ -86,7 +86,7 @@ in der Ausgabenübersicht gesondert aufgeführt. {% 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. +\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 {{ statement.org_fee }} € erhoben und mit den bezahlten Zuschüssen und Aufwandsentschädigungen verrechnet. {% endif %} {% else %} @@ -123,7 +123,7 @@ in der Ausgabenübersicht gesondert aufgeführt. \multicolumn{2}{l}{Zuschuss Übernachtung und Anreise für alle Jugendleiter*innen} & {{ statement.subsidy_to.name|esc_all }} & {{ statement.total_subsidies }} €\\ {% endif %} {% if statement.total_org_fee %} - \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 {{ statement.old_participant_count }} Teilnehmende über 27 } & & -{{ statement.total_org_fee }} €\\ {% endif %} \midrule \multicolumn{3}{l}{\textbf{Summe Zuschüsse und Aufwandsentschädigung Jugendleitende}} & \textbf{ {{ statement.total_staff_paid }} }€\\ diff --git a/jdav_web/jdav_web/settings/local.py b/jdav_web/jdav_web/settings/local.py index 7d7ebcc..34dbe5c 100644 --- a/jdav_web/jdav_web/settings/local.py +++ b/jdav_web/jdav_web/settings/local.py @@ -55,6 +55,8 @@ DOMAIN = get_var('misc', 'domain', default='example.org') ALLOWANCE_PER_DAY = get_var('finance', 'allowance_per_day', default=22) MAX_NIGHT_COST = get_var('finance', 'max_night_cost', default=11) +EXCURSION_ORG_FEE = get_var('finance', 'org_fee', default=10) + # links CLOUD_LINK = get_var('links', 'cloud', default='https://startpage.com') diff --git a/jdav_web/members/locale/de/LC_MESSAGES/django.po b/jdav_web/members/locale/de/LC_MESSAGES/django.po index 763364f..3a5cb55 100644 --- a/jdav_web/members/locale/de/LC_MESSAGES/django.po +++ b/jdav_web/members/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-04-15 22:36+0200\n" +"POT-Creation-Date: 2025-04-27 23:00+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1387,12 +1387,12 @@ msgstr "Organisationsbeitrag" #, python-format msgid "" "Warning: %(old_participant_count)s participant(s) of the excursion are 27 or " -"older. For each of them, an organisation fee of 10,00 € per day has to be " -"paid to the account. With a duration of %(duration)s days, a total of " +"older. For each of them, an organisation fee of %(org_fee)s € per day has to " +"be paid to the account. With a duration of %(duration)s days, a total of " "%(total_org_fee_theoretical)s € is charged against the other transactions." msgstr "" "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 %(org_fee)s € pro Tag " "fällig. Durch die Länge der Ausfahrt von %(duration)s Tagen werden insgesamt " "%(total_org_fee_theoretical)s € mit den Zuschüssen und " "Aufwandsentschädigungen verrechnet, sofern diese in Anspruch genommen werden." @@ -1458,10 +1458,10 @@ msgid "" msgstr "" "Indem du einen Seminarbericht anfertigst, kannst du Landesjugendplan (LJP) " "Zuschüsse beantragen. In diesem Fall kannst du bis zu 25€ mal %(duration)s " -"Tage für %(theoretic_ljp_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 " +"Tage für %(theoretic_ljp_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." #: members/templates/admin/freizeit_finance_overview.html diff --git a/jdav_web/members/templates/admin/freizeit_finance_overview.html b/jdav_web/members/templates/admin/freizeit_finance_overview.html index b0325e8..8cc7a52 100644 --- a/jdav_web/members/templates/admin/freizeit_finance_overview.html +++ b/jdav_web/members/templates/admin/freizeit_finance_overview.html @@ -127,7 +127,7 @@ cost plan! {% if total_org_fee %}

{% trans "Org fee" %}

-{% blocktrans %}Warning: {{ old_participant_count }} participant(s) of the excursion are 27 or older. For each of them, an organisation fee of 10,00 € per day has to be paid to the account. With a duration of {{ duration }} days, a total of {{ total_org_fee_theoretical }} € is charged against the other transactions.{% endblocktrans %} +{% blocktrans %}Warning: {{ old_participant_count }} participant(s) of the excursion are 27 or older. For each of them, an organisation fee of {{ org_fee }} € per day has to be paid to the account. With a duration of {{ duration }} days, a total of {{ total_org_fee_theoretical }} € is charged against the other transactions.{% endblocktrans %}

{% endif %} -- 2.38.4