Merge pull request 'Egon Payment compatibility' (#237) from fix_egon_payment_sum into master
Reviewed-on: SGD-Nord/konova#237
This commit is contained in:
commit
c2fc210868
@ -11,6 +11,7 @@ import json
|
||||
import pika
|
||||
import xmltodict
|
||||
from django.db.models import Sum
|
||||
from django.utils import formats
|
||||
|
||||
from intervention.settings import EGON_RABBITMQ_HOST, EGON_RABBITMQ_USER, EGON_RABBITMQ_PW, EGON_RABBITMQ_PORT
|
||||
from konova.sub_settings.django_settings import DEFAULT_DATE_FORMAT
|
||||
@ -92,6 +93,9 @@ class EgonGmlBuilder:
|
||||
)["summed"]
|
||||
return all_payments
|
||||
|
||||
def _float_to_localized_string(self, value: float):
|
||||
return formats.number_format(value, use_l10n=True, decimal_pos=2)
|
||||
|
||||
def _gen_kompensationsArt(self) -> (str, int):
|
||||
comp_type = "Ersatzzahlung"
|
||||
comp_type_code = 774898901
|
||||
@ -191,7 +195,7 @@ class EgonGmlBuilder:
|
||||
"@xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/1053/{reg_office.atom_id if reg_office else None}",
|
||||
"#text": reg_office.long_name if reg_office else None
|
||||
},
|
||||
"oneo:ersatzzahlung": self._sum_all_payments(),
|
||||
"oneo:ersatzzahlung": self._float_to_localized_string(self._sum_all_payments()),
|
||||
"oneo:kompensationsart": {
|
||||
"@xlink:href": f"http://register.naturschutz.rlp.de/repository/services/referenzliste/88140/{comp_type_code}",
|
||||
"#text": comp_type
|
||||
|
Loading…
Reference in New Issue
Block a user