Merged in fix/SW-2254-disable-download-invoice-if-flex (pull request #1775)
fix(SW-2254): disable download invoice if the booking is flex * fix(SW-2254): disable download invoice if the booking is flex Approved-by: Simon.Emanuelsson
This commit is contained in:
@@ -4,6 +4,7 @@ import { useIntl } from "react-intl"
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
|
||||
import { CancellationRuleEnum } from "@/constants/booking"
|
||||
import { customerService } from "@/constants/currentWebHrefs"
|
||||
import { preliminaryReceipt } from "@/constants/routes/myStay"
|
||||
import { useManageStayStore } from "@/stores/my-stay/manageStayStore"
|
||||
@@ -82,7 +83,8 @@ export default function ActionPanel({ hotel }: ActionPanelProps) {
|
||||
|
||||
const canDownloadInvoice = checkCanDownloadInvoice(
|
||||
bookedRoom.isCancelled,
|
||||
!!bookedRoom.guaranteeInfo
|
||||
bookedRoom.rateDefinition.cancellationRule ===
|
||||
CancellationRuleEnum.CancellableBefore6PM
|
||||
)
|
||||
|
||||
const calendarEvent: EventAttributes = {
|
||||
|
||||
@@ -36,7 +36,7 @@ export function checkGuaranteeable(
|
||||
|
||||
export function checkCanDownloadInvoice(
|
||||
isCancelled: boolean,
|
||||
guaranteeInfo: boolean
|
||||
isFlexBooking: boolean
|
||||
) {
|
||||
return !isCancelled && guaranteeInfo
|
||||
return !isCancelled && !isFlexBooking
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user