fix: display modify dates for already guaranteed changeable rates
This commit is contained in:
committed by
Michael Zetterberg
parent
b8a976db22
commit
2abd4c5c12
@@ -1,6 +1,4 @@
|
||||
"use client"
|
||||
|
||||
import { useMemo } from "react"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons"
|
||||
@@ -58,38 +56,34 @@ export default function ActionPanel({ hotel }: ActionPanelProps) {
|
||||
checkOutDate,
|
||||
createDateTime,
|
||||
canChangeDate,
|
||||
isPrePaid,
|
||||
priceType,
|
||||
} = bookedRoom
|
||||
|
||||
const datetimeIsInThePast = useMemo(
|
||||
() => isDatetimePast(checkInDate),
|
||||
[checkInDate]
|
||||
)
|
||||
const datetimeIsInThePast = isDatetimePast(checkInDate)
|
||||
|
||||
const isDateModifyable = checkDateModifiable({
|
||||
const isDateModifyable = checkDateModifiable(
|
||||
canChangeDate,
|
||||
datetimeIsInThePast,
|
||||
isCancelled: bookedRoom.isCancelled,
|
||||
isPrePaid,
|
||||
isRewardNight: priceType === "points",
|
||||
})
|
||||
bookedRoom.isCancelled,
|
||||
priceType === "points"
|
||||
)
|
||||
|
||||
const isCancelable = checkCancelable({
|
||||
bookedRoom,
|
||||
linkedReservationRooms,
|
||||
const isCancelable = checkCancelable(
|
||||
bookedRoom.isCancelable,
|
||||
datetimeIsInThePast,
|
||||
})
|
||||
linkedReservationRooms
|
||||
)
|
||||
|
||||
const isGuaranteeable = checkGuaranteeable({
|
||||
bookedRoom,
|
||||
datetimeIsInThePast,
|
||||
})
|
||||
const isGuaranteeable = checkGuaranteeable(
|
||||
!!bookedRoom.guaranteeInfo,
|
||||
bookedRoom.isCancelled,
|
||||
datetimeIsInThePast
|
||||
)
|
||||
|
||||
const canDownloadInvoice = checkCanDownloadInvoice({
|
||||
isCancelled: bookedRoom.isCancelled,
|
||||
isPrePaid,
|
||||
})
|
||||
const canDownloadInvoice = checkCanDownloadInvoice(
|
||||
bookedRoom.isCancelled,
|
||||
!!bookedRoom.guaranteeInfo
|
||||
)
|
||||
|
||||
const calendarEvent: EventAttributes = {
|
||||
busyStatus: "FREE",
|
||||
|
||||
Reference in New Issue
Block a user