Merge pull request 'EGON GML Payment date' (#260) from fix_egon_payment_date into master

Reviewed-on: SGD-Nord/konova#260
This commit is contained in:
mpeltriaux 2022-12-02 06:43:05 +01:00
commit 3574b315eb

View File

@ -67,6 +67,7 @@ class EgonGmlBuilder:
"""
intervention = None
gml = None
_PAYMENT_FALLBACK_DATE = ""
def __init__(self, intervention):
self.intervention = intervention
@ -164,7 +165,10 @@ class EgonGmlBuilder:
payment_date = None
if payment is not None:
payment_date = payment.due_on
if payment_date is not None:
payment_date = payment_date.strftime(DEFAULT_DATE_FORMAT)
else:
payment_date = self._PAYMENT_FALLBACK_DATE
cons_office = self.intervention.responsible.conservation_office
reg_office = self.intervention.responsible.registration_office