mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX] pms-api-rest: num. services, amenities, round(discount), cancelation rule.
This commit is contained in:
committed by
Darío Lodeiros
parent
f661b67a4a
commit
c87c5153ef
@@ -53,7 +53,7 @@ class PmsReservationInfo(Datamodel):
|
||||
pendingCheckinData = fields.Integer(required=False, allow_none=True)
|
||||
createDate = fields.String(required=False, allow_none=True)
|
||||
segmentationId = fields.Integer(required=False, allow_none=True)
|
||||
cancellationPolicyId = fields.Integer(required=False, allow_none=True)
|
||||
cancelationRuleId = fields.Integer(required=False, allow_none=True)
|
||||
toAssign = fields.Boolean(required=False, allow_none=True)
|
||||
reservationType = fields.String(required=False, allow_none=True)
|
||||
|
||||
|
||||
@@ -23,4 +23,4 @@ class PmsRoomInfo(Datamodel):
|
||||
roomTypeClassId = fields.Integer(required=False, allow_none=True)
|
||||
ubicationId = fields.Integer(required=False, allow_none=True)
|
||||
extraBedsAllowed = fields.Integer(required=False, allow_none=True)
|
||||
roomAmenityIds = fields.List(fields.Integer(), required=False)
|
||||
roomAmenityIds = fields.List(fields.Integer(), required=False, allow_none=True)
|
||||
|
||||
@@ -266,10 +266,13 @@ class PmsFolioService(Component):
|
||||
allowedCheckout=reservation.allowed_checkout,
|
||||
splitted=reservation.splitted,
|
||||
priceTotal=reservation.price_room_services_set,
|
||||
servicesCount=len(
|
||||
# TODO: REVIEW IF THIS OR QTY OF EACH ONE
|
||||
servicesCount=sum(
|
||||
reservation.service_ids.filtered(
|
||||
|
||||
lambda x: not x.is_board_service
|
||||
)
|
||||
.mapped("product_qty")
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
@@ -60,10 +60,12 @@ class PmsPricelistService(Component):
|
||||
PmsPricelistInfo(
|
||||
id=pricelist.id,
|
||||
name=pricelist.name,
|
||||
cancellationPolicyId=pricelist.cancelation_rule_id.id
|
||||
cancelationRuleId=pricelist.cancelation_rule_id.id
|
||||
if pricelist.cancelation_rule_id
|
||||
else None,
|
||||
defaultAvailabilityPlanId=pricelist.availability_plan_id.id,
|
||||
defaultAvailabilityPlanId=pricelist.availability_plan_id.id
|
||||
if pricelist.availability_plan_id else None
|
||||
,
|
||||
pmsPropertyIds=pricelist.pms_property_ids.mapped("id"),
|
||||
)
|
||||
)
|
||||
|
||||
@@ -105,7 +105,7 @@ class PmsReservationService(Component):
|
||||
reservationType=reservation.reservation_type,
|
||||
priceTotal=reservation.price_room_services_set,
|
||||
discount=reservation.discount,
|
||||
commissionAmount=reservation.commission_amount
|
||||
commissionAmount=round(reservation.commission_amount, 2)
|
||||
if reservation.commission_amount
|
||||
else None,
|
||||
priceOnlyServices=reservation.price_services,
|
||||
|
||||
Reference in New Issue
Block a user