[FIX] pms_api_rest: fix parameters in occupandy sql statement and name it

This commit is contained in:
Sara Lago
2023-09-07 10:45:27 +02:00
committed by Darío Lodeiros
parent cac8580073
commit 215ee18a80

View File

@@ -93,7 +93,7 @@ class PmsDashboardServices(Component):
self.env.cr.execute( self.env.cr.execute(
f""" f"""
SELECT CEIL(l.num * 100.00 / tr.num_total_rooms) SELECT CEIL(l.num * 100.00 / tr.num_total_rooms) AS occupancy
FROM FROM
( (
SELECT COUNT(1) num_total_rooms SELECT COUNT(1) num_total_rooms
@@ -112,8 +112,8 @@ class PmsDashboardServices(Component):
) l ) l
""", """,
( (
date_occupancy,
pms_dashboard_search_param.pmsPropertyId, pms_dashboard_search_param.pmsPropertyId,
date_occupancy,
pms_dashboard_search_param.pmsPropertyId, pms_dashboard_search_param.pmsPropertyId,
), ),
) )