From 6b73a0a3694adb90e0aca075d51a1a989fdd9251 Mon Sep 17 00:00:00 2001 From: Jan Remmer Siebels Date: Wed, 1 Oct 2025 13:47:47 +0200 Subject: [PATCH] Add transfer data fields to payment form MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added empfaenger_iban, empfaenger_name, verwendungszweck to DestinataerUnterstuetzungForm - Made faellig_am read-only for automatically generated quarterly payments - Added proper placeholders for transfer data fields - Template already supports these fields in Überweisungsdaten section --- app/stiftung/forms.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/app/stiftung/forms.py b/app/stiftung/forms.py index dda0635..311e155 100644 --- a/app/stiftung/forms.py +++ b/app/stiftung/forms.py @@ -969,6 +969,9 @@ class DestinataerUnterstuetzungForm(forms.ModelForm): "faellig_am", "status", "beschreibung", + "empfaenger_iban", + "empfaenger_name", + "verwendungszweck", ] widgets = { "destinataer": forms.Select(attrs={"class": "form-select"}), @@ -981,8 +984,26 @@ class DestinataerUnterstuetzungForm(forms.ModelForm): ), "status": forms.Select(attrs={"class": "form-select"}), "beschreibung": forms.TextInput(attrs={"class": "form-control"}), + "empfaenger_iban": forms.TextInput( + attrs={"class": "form-control", "placeholder": "DE89 3704 0044 0532 0130 00"} + ), + "empfaenger_name": forms.TextInput( + attrs={"class": "form-control", "placeholder": "Max Mustermann"} + ), + "verwendungszweck": forms.TextInput( + attrs={"class": "form-control", "placeholder": "Vierteljährliche Unterstützung Q1/2025"} + ), } + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + # Make faellig_am read-only for automatically generated quarterly payments + if self.instance and self.instance.pk and self.instance.beschreibung: + if "Vierteljährliche Unterstützung" in self.instance.beschreibung and "(automatisch erstellt)" in self.instance.beschreibung: + self.fields['faellig_am'].widget.attrs['readonly'] = True + self.fields['faellig_am'].help_text = "Fälligkeitsdatum wird automatisch basierend auf Quartal berechnet" + class DestinataerNotizForm(forms.ModelForm): class Meta: