From a7970a1221734b14e43f559f03c64f882d85ded6 Mon Sep 17 00:00:00 2001 From: mipel Date: Mon, 20 Sep 2021 09:03:03 +0200 Subject: [PATCH] #18 EcoAccount funding * adds constraint for setting the deductable_surface too low -> existing deductions would not be valid anymore * adds/updates translations --- compensation/models.py | 8 +++ locale/de/LC_MESSAGES/django.mo | Bin 19398 -> 19884 bytes locale/de/LC_MESSAGES/django.po | 107 +++++++++++++++++--------------- 3 files changed, 66 insertions(+), 49 deletions(-) diff --git a/compensation/models.py b/compensation/models.py index 990951b..bc6aaa5 100644 --- a/compensation/models.py +++ b/compensation/models.py @@ -298,6 +298,14 @@ class EcoAccount(AbstractCompensation): if self.deductable_surface > after_state_sum: raise ValidationError(_("Deductable surface can not be larger than existing surfaces in after states")) + # Deductable surface can not be lower than amount of already deducted surfaces + # User needs to contact deducting user in case of further problems + deducted_sum = self.get_deductions_surface() + if self.deductable_surface < deducted_sum: + raise ValidationError( + _("Deductable surface can not be smaller than the sum of already existing deductions. Please contact the responsible users for the deductions!") + ) + def save(self, *args, **kwargs): if self.identifier is None or len(self.identifier) == 0: # Create new identifier diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index 2ee53066cc1b83e60649f49b7f04d58883dd7e69..25b93fb8ee941c123accd3f177d6164916ccbea0 100644 GIT binary patch delta 6671 zcmZ|Td3+S*9mnw}5JCvyNC-D11IQ^M+zJwrLj!_nh*AZVZjuQ}TsFG9;Zi$-f>0?U z$RP-FYE>vy5T#sdfL7566;P^B6j4y|zyqX${d{+xX#eTF`s4jP&&)i>?|Ejy?pqwU zep#G%JT-oy;mU|JrUj!!x&k?X8^m_WSt`p4`lsdemED1I$D{KLFM7DAYi%t%t4C zunz6>P!n2#?eKZ5jt4Qpc*Y#2pbkDny>JFef;o>`VO(=#k}wTb&pGIxBe4Z=v2ljWzJBM?o)shZ^W-)J*HQV)p2uI=B(_ zVy<-*=29PnJ#hnSi$2EQcos>Dxq_4E;28La2Jwc%{g;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^haf5O_tXT)IPlz80PPuuOi00Z8TunSpN6D-w^y1DS z5(%a6T)fBKmwY)wlD6JHPkM04UV>VG?#{zN35B%{*%#7jh5;y;AaI3kEG-vy1uKDt=285dR`x zATo(+G}s%j5QB(`gwh@2dE#3_=@nv{H|PFHf`x<=LIX|mFy+jY99ii`Dp(MRW#CUW3`olgpFMc9oi69k7+lbA?>%=VeUx|j!VRgKPeyFsI z=tM*jzbBNY5~qne#2bX3|AkO`$Hh#riVC##6+UC@X5%vAOE=uZ\n" "Language-Team: LANGUAGE \n" @@ -53,7 +53,7 @@ msgstr "Zahlung wird an diesem Datum erwartet" #: ema/templates/ema/detail/includes/actions.html:34 #: ema/templates/ema/detail/includes/deadlines.html:34 #: ema/templates/ema/detail/includes/documents.html:31 -#: intervention/forms.py:345 +#: intervention/forms.py:346 #: intervention/templates/intervention/detail/includes/documents.html:31 #: intervention/templates/intervention/detail/includes/payments.html:34 #: intervention/templates/intervention/detail/includes/revocation.html:38 @@ -62,7 +62,7 @@ msgid "Comment" msgstr "Kommentar" #: compensation/forms.py:68 compensation/forms.py:265 compensation/forms.py:346 -#: intervention/forms.py:347 konova/forms.py:317 +#: intervention/forms.py:348 konova/forms.py:317 msgid "Additional comment, maximum {} letters" msgstr "Zusätzlicher Kommentar, maximal {} Zeichen" @@ -97,11 +97,11 @@ msgstr "Biotoptyp wählen" #: compensation/templates/compensation/detail/eco_account/includes/states-before.html:36 #: ema/templates/ema/detail/includes/states-after.html:36 #: ema/templates/ema/detail/includes/states-before.html:36 -#: intervention/forms.py:478 +#: intervention/forms.py:479 msgid "Surface" msgstr "Fläche" -#: compensation/forms.py:155 intervention/forms.py:480 +#: compensation/forms.py:155 intervention/forms.py:481 msgid "in m²" msgstr "" @@ -133,7 +133,7 @@ msgstr "Fristart wählen" #: compensation/templates/compensation/detail/compensation/includes/deadlines.html:31 #: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:31 #: ema/templates/ema/detail/includes/deadlines.html:31 -#: intervention/forms.py:320 +#: intervention/forms.py:321 msgid "Date" msgstr "Datum" @@ -245,9 +245,18 @@ msgstr "Stück" msgid "" "Deductable surface can not be larger than existing surfaces in after states" msgstr "" +"Die abbuchbare Fläche darf die Gesamtfläche der Zielzustände nicht überschreiten" + +#: compensation/models.py:306 +msgid "" +"Deductable surface can not be smaller than the sum of already existing " +"deductions. Please contact the responsible users for the deductions!" +msgstr "" +"Es wurde bereits mehr Fläche abgebucht, als Sie nun als abbuchbar einstellen wollen. " +"Kontaktieren Sie die für die Abbuchungen verantwortlichen Nutzer!" #: compensation/tables.py:24 compensation/tables.py:164 ema/tables.py:28 -#: intervention/forms.py:29 intervention/tables.py:23 +#: intervention/forms.py:30 intervention/tables.py:23 #: intervention/templates/intervention/detail/includes/compensations.html:30 msgid "Identifier" msgstr "Kennung" @@ -258,7 +267,7 @@ msgstr "Kennung" #: compensation/templates/compensation/detail/eco_account/includes/documents.html:28 #: compensation/templates/compensation/detail/eco_account/view.html:31 #: ema/tables.py:33 ema/templates/ema/detail/includes/documents.html:28 -#: ema/templates/ema/detail/view.html:24 intervention/forms.py:36 +#: ema/templates/ema/detail/view.html:24 intervention/forms.py:37 #: intervention/tables.py:28 #: intervention/templates/intervention/detail/includes/compensations.html:33 #: intervention/templates/intervention/detail/includes/documents.html:28 @@ -353,7 +362,7 @@ msgstr "Ökokonten" #: compensation/tables.py:222 #: compensation/templates/compensation/detail/eco_account/view.html:19 -#: intervention/forms.py:462 intervention/forms.py:469 +#: intervention/forms.py:463 intervention/forms.py:470 #: konova/templates/konova/home.html:88 templates/navbar.html:34 msgid "Eco-account" msgstr "Ökokonto" @@ -445,7 +454,7 @@ msgstr "Frist/Termin hinzufügen" #: compensation/templates/compensation/detail/compensation/includes/deadlines.html:28 #: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:28 -#: ema/templates/ema/detail/includes/deadlines.html:28 intervention/forms.py:41 +#: ema/templates/ema/detail/includes/deadlines.html:28 intervention/forms.py:42 msgid "Type" msgstr "Typ" @@ -565,7 +574,7 @@ msgstr "Zuletzt bearbeitet" #: compensation/templates/compensation/detail/compensation/view.html:79 #: compensation/templates/compensation/detail/eco_account/view.html:78 -#: ema/templates/ema/detail/view.html:69 intervention/forms.py:254 +#: ema/templates/ema/detail/view.html:69 intervention/forms.py:255 #: intervention/templates/intervention/detail/view.html:111 msgid "Shared with" msgstr "Freigegeben für" @@ -638,7 +647,7 @@ msgid "Conversation office file number" msgstr "Aktenzeichen Naturschutzbehörde" #: compensation/templates/compensation/detail/eco_account/view.html:66 -#: ema/templates/ema/detail/view.html:50 intervention/forms.py:53 +#: ema/templates/ema/detail/view.html:50 intervention/forms.py:54 #: intervention/templates/intervention/detail/view.html:59 msgid "Intervention handler" msgstr "Eingriffsverursacher" @@ -752,120 +761,120 @@ msgstr "Gemarkung" msgid "Search for district" msgstr "Nach Gemarkung suchen" -#: intervention/forms.py:32 +#: intervention/forms.py:33 msgid "Generated automatically if none was given" msgstr "Wird automatisch erzeugt, falls nicht angegeben" -#: intervention/forms.py:44 +#: intervention/forms.py:45 msgid "Which intervention type is this" msgstr "Welcher Eingriffstyp" -#: intervention/forms.py:47 +#: intervention/forms.py:48 #: intervention/templates/intervention/detail/view.html:39 msgid "Law" msgstr "Gesetz" -#: intervention/forms.py:50 +#: intervention/forms.py:51 msgid "Based on which law" msgstr "Basiert auf welchem Recht" -#: intervention/forms.py:56 +#: intervention/forms.py:57 msgid "Who performs the intervention" msgstr "Wer führt den Eingriff durch" -#: intervention/forms.py:59 +#: intervention/forms.py:60 msgid "Data provider" msgstr "Datenbereitsteller" -#: intervention/forms.py:61 +#: intervention/forms.py:62 msgid "Who provides the data for the intervention" msgstr "Wer stellt die Daten für den Eingriff zur Verfügung" -#: intervention/forms.py:66 +#: intervention/forms.py:67 msgid "Organization" msgstr "Organisation" -#: intervention/forms.py:72 +#: intervention/forms.py:73 msgid "Data provider details" msgstr "Datenbereitsteller Details" -#: intervention/forms.py:75 +#: intervention/forms.py:76 msgid "Further details" msgstr "Weitere Details" -#: intervention/forms.py:88 +#: intervention/forms.py:89 msgid "Map" msgstr "Karte" -#: intervention/forms.py:90 +#: intervention/forms.py:91 msgid "Where does the intervention take place" msgstr "Wo findet der Eingriff statt" -#: intervention/forms.py:98 +#: intervention/forms.py:99 msgid "Files" msgstr "Dateien" -#: intervention/forms.py:105 +#: intervention/forms.py:106 msgid "New intervention" msgstr "Neuer Eingriff" -#: intervention/forms.py:147 +#: intervention/forms.py:148 msgid "Edit intervention" msgstr "Eingriff bearbeiten" -#: intervention/forms.py:243 +#: intervention/forms.py:244 msgid "Share link" msgstr "Freigabelink" -#: intervention/forms.py:245 +#: intervention/forms.py:246 msgid "Send this link to users who you want to have writing access on the data" msgstr "Andere Nutzer erhalten über diesen Link Zugriff auf die Daten" -#: intervention/forms.py:257 +#: intervention/forms.py:258 msgid "Remove check to remove access for this user" msgstr "Wählen Sie die Nutzer ab, die keinen Zugriff mehr haben sollen" -#: intervention/forms.py:268 +#: intervention/forms.py:269 #: intervention/templates/intervention/detail/includes/controls.html:15 msgid "Share" msgstr "Freigabe" -#: intervention/forms.py:269 +#: intervention/forms.py:270 msgid "Share settings for {}" msgstr "Freigabe Einstellungen für {}" -#: intervention/forms.py:322 +#: intervention/forms.py:323 msgid "Date of revocation" msgstr "Datum des Widerspruchs" -#: intervention/forms.py:332 +#: intervention/forms.py:333 #: intervention/templates/intervention/detail/includes/revocation.html:35 msgid "Document" msgstr "Dokument" -#: intervention/forms.py:335 konova/forms.py:305 +#: intervention/forms.py:336 konova/forms.py:305 msgid "Must be smaller than 15 Mb" msgstr "Muss kleiner als 15 Mb sein" -#: intervention/forms.py:358 +#: intervention/forms.py:359 #: intervention/templates/intervention/detail/includes/revocation.html:18 msgid "Add revocation" msgstr "Widerspruch hinzufügen" -#: intervention/forms.py:398 +#: intervention/forms.py:399 msgid "Checked intervention data" msgstr "Eingriffsdaten geprüft" -#: intervention/forms.py:404 +#: intervention/forms.py:405 msgid "Checked compensations data and payments" msgstr "Kompensationen und Zahlungen geprüft" -#: intervention/forms.py:412 +#: intervention/forms.py:413 #: intervention/templates/intervention/detail/includes/controls.html:19 msgid "Run check" msgstr "Prüfung vornehmen" -#: intervention/forms.py:413 konova/forms.py:389 +#: intervention/forms.py:414 konova/forms.py:389 msgid "" "I, {} {}, confirm that all necessary control steps have been performed by " "myself." @@ -873,30 +882,30 @@ msgstr "" "Ich, {} {}, bestätige, dass die notwendigen Kontrollschritte durchgeführt " "wurden:" -#: intervention/forms.py:464 +#: intervention/forms.py:465 msgid "Only recorded accounts can be selected for deductions" msgstr "Nur verzeichnete Ökokonten können für Abbuchungen verwendet werden." -#: intervention/forms.py:483 intervention/forms.py:490 +#: intervention/forms.py:484 intervention/forms.py:491 #: intervention/tables.py:88 #: intervention/templates/intervention/detail/view.html:19 #: konova/templates/konova/home.html:11 templates/navbar.html:22 msgid "Intervention" msgstr "Eingriff" -#: intervention/forms.py:485 +#: intervention/forms.py:486 msgid "Only shared interventions can be selected" msgstr "Nur freigegebene Eingriffe können gewählt werden" -#: intervention/forms.py:498 +#: intervention/forms.py:499 msgid "New Deduction" msgstr "Neue Abbuchung" -#: intervention/forms.py:499 +#: intervention/forms.py:500 msgid "Enter the information for a new deduction from a chosen eco-account" msgstr "Geben Sie die Informationen für eine neue Abbuchung ein." -#: intervention/forms.py:535 +#: intervention/forms.py:536 msgid "" "Eco-account {} is not recorded yet. You can only deduct from recorded " "accounts." @@ -904,7 +913,7 @@ msgstr "" "Ökokonto {} ist noch nicht verzeichnet. Abbuchungen können nur von " "verzeichneten Ökokonten erfolgen." -#: intervention/forms.py:548 +#: intervention/forms.py:549 msgid "" "The account {} has not enough surface for a deduction of {} m². There are " "only {} m² left"