mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX] pms-api-rest: fix precommit
This commit is contained in:
committed by
Darío Lodeiros
parent
fb4c9a83c1
commit
630664d338
@@ -71,6 +71,7 @@ class PmsCalendarInfo(Datamodel):
|
|||||||
priceDayTotal = fields.Number(required=False, allow_none=True)
|
priceDayTotal = fields.Number(required=False, allow_none=True)
|
||||||
priceDayTotalServices = fields.Number(required=False, allow_none=True)
|
priceDayTotalServices = fields.Number(required=False, allow_none=True)
|
||||||
|
|
||||||
|
|
||||||
class PmsCalendarAlertsPerDay(Datamodel):
|
class PmsCalendarAlertsPerDay(Datamodel):
|
||||||
_name = "pms.calendar.alerts.per.day"
|
_name = "pms.calendar.alerts.per.day"
|
||||||
date = fields.String(required=True, allow_none=False)
|
date = fields.String(required=True, allow_none=False)
|
||||||
|
|||||||
@@ -30,12 +30,14 @@ class PmsCalendarService(Component):
|
|||||||
count_nights = (date_to - date_from).days + 1
|
count_nights = (date_to - date_from).days + 1
|
||||||
target_dates = [date_from + timedelta(days=x) for x in range(count_nights)]
|
target_dates = [date_from + timedelta(days=x) for x in range(count_nights)]
|
||||||
pms_property_id = calendar_search_param.pmsPropertyId
|
pms_property_id = calendar_search_param.pmsPropertyId
|
||||||
subselect_sum_services_price = "(" \
|
subselect_sum_services_price = (
|
||||||
" SELECT COALESCE(SUM(s.price_day_total),0) price_day_total_services " \
|
"("
|
||||||
" FROM pms_service_line s " \
|
" SELECT COALESCE(SUM(s.price_day_total),0) price_day_total_services "
|
||||||
" WHERE s.reservation_id = night.reservation_id " \
|
" FROM pms_service_line s "
|
||||||
" AND s.date = night.date AND NOT s.is_board_service " \
|
" WHERE s.reservation_id = night.reservation_id "
|
||||||
" ) "
|
" AND s.date = night.date AND NOT s.is_board_service "
|
||||||
|
" ) "
|
||||||
|
)
|
||||||
selected_fields_mapper = {
|
selected_fields_mapper = {
|
||||||
"id": "night.id",
|
"id": "night.id",
|
||||||
"state": "night.state",
|
"state": "night.state",
|
||||||
@@ -56,7 +58,7 @@ class PmsCalendarService(Component):
|
|||||||
"folio_pending_amount": "folio.pending_amount",
|
"folio_pending_amount": "folio.pending_amount",
|
||||||
"adults": "reservation.adults",
|
"adults": "reservation.adults",
|
||||||
"price_day_total": "night.price_day_total",
|
"price_day_total": "night.price_day_total",
|
||||||
"price_day_total_services": subselect_sum_services_price
|
"price_day_total_services": subselect_sum_services_price,
|
||||||
}
|
}
|
||||||
selected_fields_sql = list(selected_fields_mapper.values())
|
selected_fields_sql = list(selected_fields_mapper.values())
|
||||||
selected_fields = list(selected_fields_mapper.keys())
|
selected_fields = list(selected_fields_mapper.keys())
|
||||||
|
|||||||
Reference in New Issue
Block a user