Compare commits
2 Commits
642b6cb7a5
...
a343013eed
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a343013eed | ||
|
|
7380fa4378 |
@@ -672,6 +672,8 @@ def create_xml_from_db(list: list[Tuple[Reservation, Customer]]):
|
||||
for reservation, customer in list:
|
||||
_LOGGER.info(f"Creating XML for reservation {reservation.form_id} and customer {customer.given_name}")
|
||||
|
||||
try:
|
||||
|
||||
phone_numbers = [(customer.phone, PhoneTechType.MOBILE)] if customer.phone is not None else []
|
||||
customer_data = CustomerData(
|
||||
given_name=customer.given_name,
|
||||
@@ -745,6 +747,9 @@ def create_xml_from_db(list: list[Tuple[Reservation, Customer]]):
|
||||
hotel_name=reservation.hotel_name,
|
||||
)
|
||||
# Comments
|
||||
|
||||
offer_comment = None
|
||||
if reservation.offer is not None:
|
||||
offer_comment = CommentData(
|
||||
name=CommentName2.ADDITIONAL_INFO,
|
||||
text="Angebot/Offerta",
|
||||
@@ -776,6 +781,10 @@ def create_xml_from_db(list: list[Tuple[Reservation, Customer]]):
|
||||
|
||||
comments_xml = None
|
||||
if comments:
|
||||
|
||||
for c in comments:
|
||||
_LOGGER.info(f"Creating comment: name={c.name}, text={c.text}, list_items={len(c.list_items)}")
|
||||
|
||||
comments_data = CommentsData(comments=comments)
|
||||
comments_xml = alpine_bits_factory.create(comments_data, OtaMessageType.RETRIEVE)
|
||||
|
||||
@@ -801,6 +810,9 @@ def create_xml_from_db(list: list[Tuple[Reservation, Customer]]):
|
||||
|
||||
reservations_list.append(hotel_reservation)
|
||||
|
||||
except Exception as e:
|
||||
_LOGGER.error(f"Error creating XML for reservation {reservation.form_id} and customer {customer.given_name}: {e}")
|
||||
|
||||
retrieved_reservations = OtaResRetrieveRs.ReservationsList(
|
||||
hotel_reservation=reservations_list
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user