EGON GML Payment date

* fixes bug where missing payment date would result in no egon message sent
This commit is contained in:
mpeltriaux 2022-12-01 15:35:45 +01:00
parent 2689e73d3a
commit c3350bb9bc

View File

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