[FIX] pms-api-rest: fix param property in sql pricelist calendar & fix item union with property

This commit is contained in:
miguelpadin
2023-07-26 17:29:08 +02:00
committed by Darío Lodeiros
parent b509bf519f
commit c27e9700d9

View File

@@ -422,7 +422,7 @@ class PmsCalendarService(Component):
) price,
(SELECT COUNT (1)
FROM pms_room r
WHERE r.room_type_id = dr.room_type_id AND r.active = true AND r.pms_property_id = 1
WHERE r.room_type_id = dr.room_type_id AND r.active = true AND r.pms_property_id = %s
AND NOT EXISTS (SELECT 1
FROM pms_reservation_line
WHERE date = dr.date
@@ -466,9 +466,13 @@ class PmsCalendarService(Component):
AND it.product_id = dr.product_id
AND it.active = true
AND it.pricelist_id = %s
AND EXISTS (SELECT 1
FROM product_pricelist_item_pms_property_rel relp
WHERE relp.product_pricelist_item_id = it.id AND relp.pms_property_id = %s)
ORDER BY dr.room_type_id, dr.date;
""",
(
calendar_search_param.pmsPropertyId,
calendar_search_param.pmsPropertyId,
calendar_search_param.pmsPropertyId,
date_from,
@@ -477,6 +481,7 @@ class PmsCalendarService(Component):
calendar_search_param.pmsPropertyId,
calendar_search_param.availabilityPlanId,
calendar_search_param.pricelistId,
calendar_search_param.pmsPropertyId,
),
)