dav_events: Incorporated new rewards and fees
All checks were successful
Run tests / Execute tox to run the test suite (push) Successful in 3m17s
All checks were successful
Run tests / Execute tox to run the test suite (push) Successful in 3m17s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user