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:
Bianca Widstam
2025-04-11 09:17:48 +00:00
parent 2b08f257f5
commit 696197906b
2 changed files with 5 additions and 3 deletions

View File

@@ -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 = {

View File

@@ -36,7 +36,7 @@ export function checkGuaranteeable(
export function checkCanDownloadInvoice(
isCancelled: boolean,
guaranteeInfo: boolean
isFlexBooking: boolean
) {
return !isCancelled && guaranteeInfo
return !isCancelled && !isFlexBooking
}