diff --git a/dav_events/django_project_config/settings-dav_events.py b/dav_events/django_project_config/settings-dav_events.py index c0df80f..fc8ca9c 100644 --- a/dav_events/django_project_config/settings-dav_events.py +++ b/dav_events/django_project_config/settings-dav_events.py @@ -133,125 +133,149 @@ FORM_INITIALS = { # EventCreateForm and sub classes # FORMS_DEVELOPMENT_INIT = False MATRIX_CONFIG = { - '0': {'description': _(u'Keiner / direkte Abrechnung (Tageswanderung)'), - 'trainer_fee': 0, - 'trainer_day_fee': 0, - 'participant_fee': 0, - 'participant_day_fee': 0, - 'pre_meeting_fee': 0, - 'pubtrans_bonus': 0, - 'min_participants': 0, - 'max_participants': 0, + '0': {'description': _(u'Keiner / direkte Abrechnung (Tageswanderung)'), + 'orga_compensation': 0, + 'pubtrans_compensation': 0, + 'trainer_compensation': 0, + 'trainer_daily_compensation': 0, + 'pre_meeting_compensation': 0, + 'participant_fee': 0, + 'participant_daily_fee': 0, + 'pubtrans_bonus': 0, + 'min_participants': 0, + 'max_participants': 0, }, - 'A': {'description': _(u'A (Mehrtageswanderung Mittelgebirge)'), - 'trainer_fee': 40, - 'trainer_day_fee': 50, - 'participant_fee': 10, - 'participant_day_fee': 10, - 'pre_meeting_fee': 20, - 'pubtrans_bonus': 20, - 'min_participants': 5, - 'max_participants': 8, + 'A': {'description': _(u'A (Mehrtageswanderung Mittelgebirge)'), + 'orga_compensation': 30, + 'pubtrans_compensation': 30, + 'trainer_compensation': 38, + 'trainer_daily_compensation': 48, + 'pre_meeting_compensation': 20, + 'participant_fee': 11, + 'participant_daily_fee': 11, + 'pubtrans_bonus': 20, + 'min_participants': 5, + 'max_participants': 8, }, - 'B': {'description': _(u'B (Alpine Mehrtageswanderung)'), - 'trainer_fee': 50, - 'trainer_day_fee': 75, - 'participant_fee': 10, - 'participant_day_fee': 20, - 'pre_meeting_fee': 20, - 'pubtrans_bonus': 30, - 'min_participants': 3, - 'max_participants': 6, + 'B': {'description': _(u'B (Alpine Mehrtageswanderung)'), + 'orga_compensation': 30, + 'pubtrans_compensation': 50, + 'trainer_compensation': 48, + 'trainer_daily_compensation': 73, + 'pre_meeting_compensation': 20, + 'participant_fee': 11, + 'participant_daily_fee': 21, + 'pubtrans_bonus': 30, + 'min_participants': 3, + 'max_participants': 6, }, - 'C': {'description': _(u'C (Tour/Kurs ohne Übernachtung)'), - 'trainer_fee': 30, - 'trainer_day_fee': 60, - 'participant_fee': 10, - 'participant_day_fee': 30, - 'pre_meeting_fee': 20, - 'pubtrans_bonus': 0, - 'min_participants': 3, - 'max_participants': 5, + 'C': {'description': _(u'C (Tour/Kurs ohne Übernachtung)'), + 'orga_compensation': 30, + 'pubtrans_compensation': 30, + 'trainer_compensation': 28, + 'trainer_daily_compensation': 57, + 'pre_meeting_compensation': 20, + 'participant_fee': 11, + 'participant_daily_fee': 32, + 'pubtrans_bonus': 20, + 'min_participants': 3, + 'max_participants': 5, }, - 'D': {'description': _(u'D (Tour/Kurs Mittelgebirge)'), - 'trainer_fee': 50, - 'trainer_day_fee': 75, - 'participant_fee': 20, - 'participant_day_fee': 25, - 'pre_meeting_fee': 20, - 'pubtrans_bonus': 30, - 'min_participants': 3, - 'max_participants': 5, + 'D': {'description': _(u'D (Tour/Kurs Mittelgebirge)'), + 'orga_compensation': 30, + 'pubtrans_compensation': 30, + 'trainer_compensation': 48, + 'trainer_daily_compensation': 73, + 'pre_meeting_compensation': 20, + 'participant_fee': 21, + 'participant_daily_fee': 26, + 'pubtrans_bonus': 20, + 'min_participants': 3, + 'max_participants': 5, }, - 'E': {'description': _(u'E (Alpine Klettertour DE/AT)'), - 'trainer_fee': 80, - 'trainer_day_fee': 75, - 'participant_fee': 40, - 'participant_day_fee': 40, - 'pre_meeting_fee': 20, - 'pubtrans_bonus': 30, - 'min_participants': 2, - 'max_participants': 3, + 'E': {'description': _(u'E (Alpine Klettertour DE/AT)'), + 'orga_compensation': 40, + 'pubtrans_compensation': 50, + 'trainer_compensation': 76, + 'trainer_daily_compensation': 73, + 'pre_meeting_compensation': 20, + 'participant_fee': 42, + 'participant_daily_fee': 42, + 'pubtrans_bonus': 30, + 'min_participants': 2, + 'max_participants': 3, }, - 'F': {'description': _(u'F (Alpine Klettertour CH/FR/IT/..)'), - 'trainer_fee': 80, - 'trainer_day_fee': 85, - 'participant_fee': 40, - 'participant_day_fee': 45, - 'pre_meeting_fee': 20, - 'pubtrans_bonus': 30, - 'min_participants': 2, - 'max_participants': 3, + 'F': {'description': _(u'F (Alpine Klettertour CH/FR/IT/..)'), + 'orga_compensation': 40, + 'pubtrans_compensation': 50, + 'trainer_compensation': 76, + 'trainer_daily_compensation': 82, + 'pre_meeting_compensation': 20, + 'participant_fee': 42, + 'participant_daily_fee': 47, + 'pubtrans_bonus': 30, + 'min_participants': 2, + 'max_participants': 3, }, - 'G': {'description': _(u'G (Alpiner Kurs DE/AT)'), - 'trainer_fee': 100, - 'trainer_day_fee': 75, - 'participant_fee': 35, - 'participant_day_fee': 30, - 'pre_meeting_fee': 20, - 'pubtrans_bonus': 30, - 'min_participants': 3, - 'max_participants': 4, + 'G': {'description': _(u'G (Alpiner Kurs DE/AT)'), + 'orga_compensation': 50, + 'pubtrans_compensation': 50, + 'trainer_compensation': 96, + 'trainer_daily_compensation': 73, + 'pre_meeting_compensation': 20, + 'participant_fee': 37, + 'participant_daily_fee': 32, + 'pubtrans_bonus': 30, + 'min_participants': 3, + 'max_participants': 4, }, - 'H': {'description': _(u'H (Alpiner Kurs CH/FR/IT/..)'), - 'trainer_fee': 100, - 'trainer_day_fee': 85, - 'participant_fee': 35, - 'participant_day_fee': 30, - 'pre_meeting_fee': 20, - 'pubtrans_bonus': 30, - 'min_participants': 3, - 'max_participants': 4, + 'H': {'description': _(u'H (Alpiner Kurs CH/FR/IT/..)'), + 'orga_compensation': 50, + 'pubtrans_compensation': 50, + 'trainer_compensation': 96, + 'trainer_daily_compensation': 82, + 'pre_meeting_compensation': 20, + 'participant_fee': 37, + 'participant_daily_fee': 32, + 'pubtrans_bonus': 30, + 'min_participants': 3, + 'max_participants': 4, }, - 'I': {'description': _(u'I (Alpine MTB/Ski-Tour DE/AT)'), - 'trainer_fee': 80, - 'trainer_day_fee': 75, - 'participant_fee': 25, - 'participant_day_fee': 25, - 'pre_meeting_fee': 20, - 'pubtrans_bonus': 30, - 'min_participants': 3, - 'max_participants': 6, + 'I': {'description': _(u'I (Alpine MTB/Ski-Tour DE/AT)'), + 'orga_compensation': 40, + 'pubtrans_compensation': 50, + 'trainer_compensation': 76, + 'trainer_daily_compensation': 73, + 'pre_meeting_compensation': 20, + 'participant_fee': 26, + 'participant_daily_fee': 26, + 'pubtrans_bonus': 30, + 'min_participants': 3, + 'max_participants': 6, }, - 'J': {'description': _(u'J (Alpine MTB/Ski-Tour CH/FR/IT/..)'), - 'trainer_fee': 80, - 'trainer_day_fee': 85, - 'participant_fee': 25, - 'participant_day_fee': 25, - 'pre_meeting_fee': 20, - 'pubtrans_bonus': 30, - 'min_participants': 3, - 'max_participants': 6, + 'J': {'description': _(u'J (Alpine MTB/Ski-Tour CH/FR/IT/..)'), + 'orga_compensation': 40, + 'pubtrans_compensation': 50, + 'trainer_compensation': 76, + 'trainer_daily_compensation': 82, + 'pre_meeting_compensation': 20, + 'participant_fee': 26, + 'participant_daily_fee': 26, + 'pubtrans_bonus': 30, + 'min_participants': 3, + 'max_participants': 6, }, - 'K': {'description': _(u'K (Ski-Tour/-Kurs mit Liftbenutzung)'), - 'trainer_fee': 80, - 'trainer_day_fee': 130, - 'participant_fee': 40, - 'participant_day_fee': 40, - 'pre_meeting_fee': 20, - 'pubtrans_bonus': 30, - 'min_participants': 3, - 'max_participants': 4, + 'K': {'description': _(u'K (Ski-Tour/-Kurs mit Liftbenutzung)'), + 'orga_compensation': 40, + 'pubtrans_compensation': 50, + 'trainer_compensation': 76, + 'trainer_daily_compensation': 124, + 'pre_meeting_compensation': 20, + 'participant_fee': 42, + 'participant_daily_fee': 42, + 'pubtrans_bonus': 30, + 'min_participants': 3, + 'max_participants': 4, }, } diff --git a/dav_events/forms/events.py b/dav_events/forms/events.py index ff3d2c7..487fb5c 100644 --- a/dav_events/forms/events.py +++ b/dav_events/forms/events.py @@ -773,26 +773,35 @@ class ChargesForm(EventCreateForm): _form_title = _(u'Kosten') _next_form_name = 'DescriptionForm' + pubtrans_planned = forms.BooleanField(disabled=True, required=False, + label=_(u'An-/Abreise mit Bahn/Bus geplant'), + ) charge_key = forms.CharField(disabled=True, label=_(u'Kostenschlüssel'), ) - trainer_fee = forms.FloatField(disabled=True, - label=_(u'Pauschale Trainer*in'), - ) - trainer_day_fee = forms.FloatField(disabled=True, - label=_(u'Tagespauschale Trainer*in'), - ) + orga_compensation = forms.FloatField(disabled=True, + label=_(u'Aufwand für Tourenleitung'), + ) + pubtrans_compensation = forms.FloatField(disabled=True, + label=_(u'Aufwand für Organisation Bahn/Bus'), + ) + trainer_compensation = forms.FloatField(disabled=True, + label=_(u'Aufwand für Trainer*in'), + ) + trainer_daily_compensation = forms.FloatField(disabled=True, + label=_(u'Täglicher Aufwand für Trainer*in'), + ) + pre_meeting_compensation = forms.FloatField(disabled=True, + label=_(u'Aufwand pro Vortreffen'), + ) participant_fee = forms.FloatField(disabled=True, - label=_(u'Pauschale Teilnehmer*in'), - ) - participant_day_fee = forms.FloatField(disabled=True, - label=_(u'Tagespauschale Teilnehmer*in'), - ) - pre_meeting_fee = forms.FloatField(disabled=True, - label=_(u'Pauschale pro Vortreffen'), + label=_(u'Beitrag für Teilnehmer*in'), ) + participant_daily_fee = forms.FloatField(disabled=True, + label=_(u'Täglicher Beitrag für Teilnehmer*in'), + ) pubtrans_bonus = forms.FloatField(disabled=True, - label=_(u'Bonus bei Benutzung öffentlicher Verkehrsmittel'), + label=_(u'Rückzahlung bei Benutzung Bahn/Bus'), ) trainer1_reward = forms.FloatField(disabled=True, label=_(u'Aufwandsentschädigung Tourenleiter*in'), @@ -832,6 +841,10 @@ class ChargesForm(EventCreateForm): additional_costs_text = u'' if transport != 'coach': additional_costs_text += ugettext(u'Fahrtkosten') + if transport == 'public': + pubtrans_planned = True + else: + pubtrans_planned = False if last_day: timedelta = last_day - first_day @@ -850,57 +863,83 @@ class ChargesForm(EventCreateForm): else: n_pre_meetings = 0 - trainer_reward = ( - matrix_config['trainer_fee'] - + ndays * matrix_config['trainer_day_fee'] - + n_pre_meetings * matrix_config['pre_meeting_fee'] + trainer1_reward = ( + matrix_config['orga_compensation'] + + matrix_config['trainer_compensation'] + + ndays * matrix_config['trainer_daily_compensation'] + + n_pre_meetings * matrix_config['pre_meeting_compensation'] + ) + trainer23_reward = ( + matrix_config['trainer_compensation'] + + ndays * matrix_config['trainer_daily_compensation'] + + n_pre_meetings * matrix_config['pre_meeting_compensation'] ) charge = ( matrix_config['participant_fee'] - + ndays * matrix_config['participant_day_fee'] + + ndays * matrix_config['participant_daily_fee'] ) - if arrival_previous_day: - trainer_reward += matrix_config['trainer_day_fee'] / 2.0 - charge += matrix_config['participant_day_fee'] / 2.0 + if pubtrans_planned: + trainer1_reward += matrix_config['pubtrans_compensation'] + if arrival_previous_day: + trainer1_reward += matrix_config['trainer_daily_compensation'] / 2.0 + trainer23_reward += matrix_config['trainer_daily_compensation'] / 2.0 + charge += matrix_config['participant_daily_fee'] / 2.0 + + self.fields['pubtrans_planned'].initial = pubtrans_planned self.fields['charge_key'].initial = matrix_config['description'] or matrix_key - self.fields['trainer_fee'].initial = matrix_config['trainer_fee'] - self.fields['trainer_day_fee'].initial = matrix_config['trainer_day_fee'] + self.fields['orga_compensation'].initial = matrix_config['orga_compensation'] + self.fields['pubtrans_compensation'].initial = matrix_config['pubtrans_compensation'] + self.fields['trainer_compensation'].initial = matrix_config['trainer_compensation'] + self.fields['trainer_daily_compensation'].initial = matrix_config['trainer_daily_compensation'] + self.fields['pre_meeting_compensation'].initial = matrix_config['pre_meeting_compensation'] self.fields['participant_fee'].initial = matrix_config['participant_fee'] - self.fields['participant_day_fee'].initial = matrix_config['participant_day_fee'] - self.fields['pre_meeting_fee'].initial = matrix_config['pre_meeting_fee'] + self.fields['participant_daily_fee'].initial = matrix_config['participant_daily_fee'] self.fields['pubtrans_bonus'].initial = matrix_config['pubtrans_bonus'] self.fields['charge'].initial = charge - self.fields['trainer1_reward'].initial = trainer_reward - self.fields['trainer23_reward'].initial = trainer_reward * 0.95 + self.fields['trainer1_reward'].initial = trainer1_reward + self.fields['trainer23_reward'].initial = trainer23_reward self.fields['pubtrans_bonus'].widget.attrs['title'] = ugettext(u'Der Bonus wird nachträglich' u' auf Meldung der Tourenleitung' u' verrechnet und ist noch nicht' u' in den hier dargestellten Zahlen enthalten.') - self.fields['charge'].widget.attrs['title'] = (u'%d € Pauschale \n' - u'+ %d Tage * %d € Tagespauschale \n' - u'+ %d halben Anreisetag * %d € Tagespauschale / 2' + self.fields['charge'].widget.attrs['title'] = (u'%d € Beitrag \n' + u'+ %d Tage * %d € täglicher Beitrag \n' + u'+ %d halben Anreisetag * %d € halbtäglicher Beitrag' % ( matrix_config['participant_fee'], - ndays, matrix_config['participant_day_fee'], - int(arrival_previous_day), matrix_config['participant_day_fee'], + ndays, matrix_config['participant_daily_fee'], + int(arrival_previous_day), matrix_config['participant_daily_fee']/2, ) ) - self.fields['trainer1_reward'].widget.attrs['title'] = (u'%d € Pauschale \n' - u'+ %d Tage * %d € Tagespauschale \n' - u'+ %d halben Anreisetag * %d € Tagespauschale / 2 \n' - u'+ %d Vortreffen * %d € Vortreffenpauschale' + self.fields['trainer1_reward'].widget.attrs['title'] = (u'%d € Aufwand für Tourenleitung\n' + u'+ %d € Aufwand für Organisation Bahn/Bus\n' + u'+ %d € Aufwand für Trainer*in\n' + u'+ %d Tage * %d € täglicher Aufwand \n' + u'+ %d halben Anreisetag * %d € halbtäglicher Aufwand\n' + u'+ %d Vortreffen * %d € Aufwand pro Vortreffen' % ( - matrix_config['trainer_fee'], - ndays, matrix_config['trainer_day_fee'], - int(arrival_previous_day), matrix_config['trainer_day_fee'], - n_pre_meetings, matrix_config['pre_meeting_fee'] + matrix_config['orga_compensation'], + int(pubtrans_planned)*matrix_config['pubtrans_compensation'], + matrix_config['trainer_compensation'], + ndays, matrix_config['trainer_daily_compensation'], + int(arrival_previous_day), matrix_config['trainer_daily_compensation']/2, + n_pre_meetings, matrix_config['pre_meeting_compensation'] + ) + ) + self.fields['trainer23_reward'].widget.attrs['title'] = (u'%d € Aufwand für Trainer*in\n' + u'+ %d Tage * %d € täglicher Aufwand \n' + u'+ %d halben Anreisetag * %d € halbtäglicher Aufwand\n' + u'+ %d Vortreffen * %d € Aufwand pro Vortreffen' + % ( + matrix_config['trainer_compensation'], + ndays, matrix_config['trainer_daily_compensation'], + int(arrival_previous_day), matrix_config['trainer_daily_compensation']/2, + n_pre_meetings, matrix_config['pre_meeting_compensation'] ) ) - self.fields['trainer23_reward'].widget.attrs['title'] = ugettext(u'95% der Aufwandsentschädigung' - u' Tourenleiter*in') self.fields['additional_costs'].widget.attrs['placeholder'] = ugettext(u'Kann freigelassen werden') self.fields['additional_costs'].initial = additional_costs_text diff --git a/dav_events/templates/dav_events/event_create/ChargesForm.html b/dav_events/templates/dav_events/event_create/ChargesForm.html index 1616fa2..00be9e2 100644 --- a/dav_events/templates/dav_events/event_create/ChargesForm.html +++ b/dav_events/templates/dav_events/event_create/ChargesForm.html @@ -11,21 +11,29 @@ {% bootstrap_field form.charge_key %}