When an ALKIS identifier is set on a Land record, the button links to ogc-api.nrw.de detail view instead of the imprecise TIM-Online search. Falls back to TIM-Online when no ALKIS number is present. Closes STI-57 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
295 lines
12 KiB
Python
295 lines
12 KiB
Python
from django import forms
|
|
|
|
from ..models import Land, LandAbrechnung, LandVerpachtung, Paechter
|
|
|
|
|
|
class LandForm(forms.ModelForm):
|
|
"""Form für das Erstellen und Bearbeiten von Ländern"""
|
|
|
|
class Meta:
|
|
model = Land
|
|
fields = [
|
|
# Grundlegende Identifikation
|
|
"lfd_nr",
|
|
"ew_nummer",
|
|
"grundbuchblatt",
|
|
# Gerichtliche Zuständigkeit
|
|
"amtsgericht",
|
|
# Verwaltungsstruktur
|
|
"gemeinde",
|
|
"gemarkung",
|
|
"flur",
|
|
"flurstueck",
|
|
"adresse",
|
|
"alkis_kennzeichen",
|
|
# Flächenangaben
|
|
"groesse_qm",
|
|
"gruenland_qm",
|
|
"acker_qm",
|
|
"wald_qm",
|
|
"sonstiges_qm",
|
|
# Legacy Verpachtung (für Kompatibilität)
|
|
"verpachtete_gesamtflaeche",
|
|
"flaeche_alte_liste",
|
|
"verp_flaeche_aktuell",
|
|
# Aktuelle Verpachtung
|
|
"aktueller_paechter",
|
|
"paechter_name",
|
|
"paechter_anschrift",
|
|
"pachtbeginn",
|
|
"pachtende",
|
|
"verlaengerung_klausel",
|
|
"zahlungsweise",
|
|
"pachtzins_pro_ha",
|
|
"pachtzins_pauschal",
|
|
# Umsatzsteuer
|
|
"ust_option",
|
|
"ust_satz",
|
|
# Umlagen
|
|
"grundsteuer_umlage",
|
|
"versicherungen_umlage",
|
|
"verbandsbeitraege_umlage",
|
|
"jagdpacht_anteil_umlage",
|
|
# Legacy Steuern
|
|
"anteil_grundsteuer",
|
|
"anteil_lwk",
|
|
# Status
|
|
"aktiv",
|
|
"notizen",
|
|
]
|
|
widgets = {
|
|
# Grundlegende Identifikation
|
|
"lfd_nr": forms.TextInput(attrs={"class": "form-control"}),
|
|
"ew_nummer": forms.TextInput(attrs={"class": "form-control"}),
|
|
"grundbuchblatt": forms.TextInput(attrs={"class": "form-control"}),
|
|
# Gerichtliche Zuständigkeit
|
|
"amtsgericht": forms.TextInput(attrs={"class": "form-control"}),
|
|
# Verwaltungsstruktur
|
|
"gemeinde": forms.TextInput(attrs={"class": "form-control"}),
|
|
"gemarkung": forms.TextInput(attrs={"class": "form-control"}),
|
|
"flur": forms.TextInput(attrs={"class": "form-control"}),
|
|
"flurstueck": forms.TextInput(attrs={"class": "form-control"}),
|
|
"adresse": forms.TextInput(attrs={"class": "form-control"}),
|
|
# Flächenangaben
|
|
"groesse_qm": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
"gruenland_qm": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
"acker_qm": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
"wald_qm": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
"sonstiges_qm": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
# Legacy Verpachtung
|
|
"verpachtete_gesamtflaeche": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
"flaeche_alte_liste": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
"verp_flaeche_aktuell": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
# Aktuelle Verpachtung
|
|
"aktueller_paechter": forms.Select(attrs={"class": "form-select"}),
|
|
"paechter_name": forms.TextInput(attrs={"class": "form-control"}),
|
|
"paechter_anschrift": forms.Textarea(
|
|
attrs={"class": "form-control", "rows": 3}
|
|
),
|
|
"pachtbeginn": forms.DateInput(
|
|
attrs={"class": "form-control", "type": "date"}
|
|
),
|
|
"pachtende": forms.DateInput(
|
|
attrs={"class": "form-control", "type": "date"}
|
|
),
|
|
"verlaengerung_klausel": forms.CheckboxInput(
|
|
attrs={"class": "form-check-input"}
|
|
),
|
|
"zahlungsweise": forms.Select(attrs={"class": "form-select"}),
|
|
"pachtzins_pro_ha": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
"pachtzins_pauschal": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
# Umsatzsteuer
|
|
"ust_option": forms.CheckboxInput(attrs={"class": "form-check-input"}),
|
|
"ust_satz": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
# Umlagen
|
|
"grundsteuer_umlage": forms.CheckboxInput(
|
|
attrs={"class": "form-check-input"}
|
|
),
|
|
"versicherungen_umlage": forms.CheckboxInput(
|
|
attrs={"class": "form-check-input"}
|
|
),
|
|
"verbandsbeitraege_umlage": forms.CheckboxInput(
|
|
attrs={"class": "form-check-input"}
|
|
),
|
|
"jagdpacht_anteil_umlage": forms.CheckboxInput(
|
|
attrs={"class": "form-check-input"}
|
|
),
|
|
# Legacy
|
|
"anteil_grundsteuer": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
"anteil_lwk": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
# Status
|
|
"aktiv": forms.CheckboxInput(attrs={"class": "form-check-input"}),
|
|
"notizen": forms.Textarea(attrs={"class": "form-control", "rows": 3}),
|
|
}
|
|
|
|
|
|
class LandVerpachtungForm(forms.ModelForm):
|
|
"""Form für das Erstellen und Bearbeiten von Verpachtungen"""
|
|
|
|
class Meta:
|
|
model = LandVerpachtung
|
|
fields = [
|
|
'land',
|
|
'paechter',
|
|
'vertragsnummer',
|
|
'pachtbeginn',
|
|
'pachtende',
|
|
'verlaengerung_klausel',
|
|
'verpachtete_flaeche',
|
|
'pachtzins_pauschal',
|
|
'pachtzins_pro_ha',
|
|
'zahlungsweise',
|
|
'ust_option',
|
|
'ust_satz',
|
|
'grundsteuer_umlage',
|
|
'versicherungen_umlage',
|
|
'verbandsbeitraege_umlage',
|
|
'jagdpacht_anteil_umlage',
|
|
'status',
|
|
'bemerkungen'
|
|
]
|
|
widgets = {
|
|
'land': forms.Select(attrs={'class': 'form-select'}),
|
|
'paechter': forms.Select(attrs={'class': 'form-select'}),
|
|
'vertragsnummer': forms.TextInput(attrs={'class': 'form-control'}),
|
|
'pachtbeginn': forms.DateInput(attrs={'class': 'form-control', 'type': 'date'}),
|
|
'pachtende': forms.DateInput(attrs={'class': 'form-control', 'type': 'date'}),
|
|
'verlaengerung_klausel': forms.CheckboxInput(attrs={'class': 'form-check-input'}),
|
|
'verpachtete_flaeche': forms.NumberInput(attrs={'class': 'form-control', 'step': '0.01'}),
|
|
'pachtzins_pauschal': forms.NumberInput(attrs={'class': 'form-control', 'step': '0.01'}),
|
|
'pachtzins_pro_ha': forms.NumberInput(attrs={'class': 'form-control', 'step': '0.01'}),
|
|
'zahlungsweise': forms.Select(attrs={'class': 'form-select'}),
|
|
'ust_option': forms.CheckboxInput(attrs={'class': 'form-check-input'}),
|
|
'ust_satz': forms.NumberInput(attrs={'class': 'form-control', 'step': '0.01'}),
|
|
'grundsteuer_umlage': forms.CheckboxInput(attrs={'class': 'form-check-input'}),
|
|
'versicherungen_umlage': forms.CheckboxInput(attrs={'class': 'form-check-input'}),
|
|
'verbandsbeitraege_umlage': forms.CheckboxInput(attrs={'class': 'form-check-input'}),
|
|
'jagdpacht_anteil_umlage': forms.CheckboxInput(attrs={'class': 'form-check-input'}),
|
|
'status': forms.Select(attrs={'class': 'form-select'}),
|
|
'bemerkungen': forms.Textarea(attrs={'class': 'form-control', 'rows': 3}),
|
|
}
|
|
|
|
|
|
class LandAbrechnungForm(forms.ModelForm):
|
|
"""Form für das Erstellen und Bearbeiten von Landabrechnungen"""
|
|
|
|
class Meta:
|
|
model = LandAbrechnung
|
|
fields = [
|
|
"land",
|
|
"abrechnungsjahr",
|
|
# Einnahmen
|
|
"pacht_vereinnahmt",
|
|
"umlagen_vereinnahmt",
|
|
"sonstige_einnahmen",
|
|
# Ausgaben
|
|
"grundsteuer_bescheid_nr",
|
|
"grundsteuer_betrag",
|
|
"versicherungen_betrag",
|
|
"verbandsbeitraege_betrag",
|
|
"sonstige_abgaben_betrag",
|
|
"instandhaltung_betrag",
|
|
"verwaltung_recht_betrag",
|
|
# Umsatzsteuer
|
|
"vorsteuer_aus_umlagen",
|
|
# Sonstiges
|
|
"offene_posten",
|
|
"bemerkungen",
|
|
# Dokumente werden über Paperless verknüpft, nicht hochgeladen
|
|
]
|
|
widgets = {
|
|
"land": forms.Select(attrs={"class": "form-select"}),
|
|
"abrechnungsjahr": forms.NumberInput(
|
|
attrs={"class": "form-control", "min": "2000", "max": "2050"}
|
|
),
|
|
# Einnahmen
|
|
"pacht_vereinnahmt": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
"umlagen_vereinnahmt": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
"sonstige_einnahmen": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
# Ausgaben
|
|
"grundsteuer_bescheid_nr": forms.TextInput(attrs={"class": "form-control"}),
|
|
"grundsteuer_betrag": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
"versicherungen_betrag": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
"verbandsbeitraege_betrag": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
"sonstige_abgaben_betrag": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
"instandhaltung_betrag": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
"verwaltung_recht_betrag": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
# Umsatzsteuer
|
|
"vorsteuer_aus_umlagen": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
# Sonstiges
|
|
"offene_posten": forms.NumberInput(
|
|
attrs={"class": "form-control", "step": "0.01"}
|
|
),
|
|
"bemerkungen": forms.Textarea(attrs={"class": "form-control", "rows": 4}),
|
|
}
|
|
|
|
|
|
class PaechterForm(forms.ModelForm):
|
|
"""Form für das Erstellen und Bearbeiten von Pächtern"""
|
|
|
|
class Meta:
|
|
model = Paechter
|
|
fields = "__all__"
|
|
widgets = {
|
|
"anrede": forms.Select(attrs={"class": "form-select"}),
|
|
"vorname": forms.TextInput(attrs={"class": "form-control"}),
|
|
"nachname": forms.TextInput(attrs={"class": "form-control"}),
|
|
"email": forms.EmailInput(attrs={"class": "form-control"}),
|
|
"telefon": forms.TextInput(attrs={"class": "form-control"}),
|
|
"mobil": forms.TextInput(attrs={"class": "form-control"}),
|
|
"geburtsdatum": forms.DateInput(
|
|
attrs={"class": "form-control", "type": "date"}
|
|
),
|
|
"strasse": forms.TextInput(attrs={"class": "form-control"}),
|
|
"plz": forms.TextInput(attrs={"class": "form-control"}),
|
|
"ort": forms.TextInput(attrs={"class": "form-control"}),
|
|
"aktiv": forms.CheckboxInput(attrs={"class": "form-check-input"}),
|
|
"notizen": forms.Textarea(attrs={"class": "form-control", "rows": 3}),
|
|
}
|