From 696197906b73d87cfb2e8c046fd2fc9e0fdf5841 Mon Sep 17 00:00:00 2001 From: Bianca Widstam Date: Fri, 11 Apr 2025 09:17:48 +0000 Subject: [PATCH] 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 --- .../HotelReservation/MyStay/ManageStay/ActionPanel/index.tsx | 4 +++- .../HotelReservation/MyStay/ManageStay/ActionPanel/utils.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/index.tsx index 6a82837e0..985cdb3fd 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/index.tsx @@ -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 = { diff --git a/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/utils.ts b/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/utils.ts index 67ef5bf7a..f4d1389be 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/utils.ts +++ b/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/utils.ts @@ -36,7 +36,7 @@ export function checkGuaranteeable( export function checkCanDownloadInvoice( isCancelled: boolean, - guaranteeInfo: boolean + isFlexBooking: boolean ) { - return !isCancelled && guaranteeInfo + return !isCancelled && !isFlexBooking }