#144 Report improved

* fixes bug in egon_export.py where missing payment date would result in non writing of gml
* fixes bug in egon_export.py which occured due to extension of parcel data fetching
* updates unavailable.html report content, such that users will understand why a recorded entry might not be visible, yet
This commit is contained in:
2022-04-12 10:33:03 +02:00
parent a6551534dc
commit 6ecbd74b93
4 changed files with 50 additions and 41 deletions

View File

@@ -80,7 +80,7 @@ class EgonGmlBuilder:
Returns:
str
"""
gmrkng_code = "000000"
gmrkng_code = "{0:06d}".format(int(parcel.parcel_group.key) or 0)
flr_code = "{0:03d}".format(int(parcel.flr or 0))
flrstckzhlr_code = "{0:05d}".format(int(parcel.flrstck_zhlr or 0))
flrstcknnr_code = "{0:06d}".format(int(parcel.flrstck_nnr or 0))
@@ -124,13 +124,13 @@ class EgonGmlBuilder:
"oneo:ortsangabe": {
"oneo:Ortsangaben": {
"oneo:kreisSchluessel": {
"xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/588/{parcel.district.krs}",
"xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/588/{parcel.district.key}",
},
"oneo:gemeindeSchluessel": {
"xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/910/{parcel.district.gmnd}",
"xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/910/{parcel.municipal.key}",
},
"oneo:verbandsgemeindeSchluessel": {
"xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/589/{parcel.gmrkng}",
"xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/589/{None}",
},
"oneo:flurstuecksKennzeichen": self._gen_flurstuecksKennzeichen(parcel),
}
@@ -156,6 +156,10 @@ class EgonGmlBuilder:
def build_gml(self):
comp_type, comp_type_code = self._gen_kompensationsArt()
payment_date = self.intervention.payments.first().due_on
if payment_date is not None:
payment_date = payment_date.strftime(DEFAULT_DATE_FORMAT)
xml_dict = {
"wfs:FeatureCollection": {
"@xmlns:wfs": "http://www.opengis.net/wfs",
@@ -207,7 +211,7 @@ class EgonGmlBuilder:
},
"oneo:zulassung": {
"oneo:Zulassungstermin": {
"oneo:bauBeginn": self.intervention.payments.first().due_on.strftime(DEFAULT_DATE_FORMAT),
"oneo:bauBeginn": payment_date,
"oneo:erlass": self.intervention.legal.registration_date.strftime(DEFAULT_DATE_FORMAT),
"oneo:rechtsKraft": self.intervention.legal.binding_date.strftime(DEFAULT_DATE_FORMAT),
}