Merged in fix/SW-2249-missing-currency (pull request #2159)

fix(SW-2249): Added default currency to summary and price details modal

* fix(SW-2249): Added default currency to summary and price details modal


Approved-by: Hrishikesh Vaipurkar
This commit is contained in:
Tobias Johansson
2025-05-26 06:51:57 +00:00
parent 2ddf31cbed
commit f77202f58b
13 changed files with 77 additions and 67 deletions

View File

@@ -31,6 +31,7 @@ import type { BreakfastPackage } from "@/types/components/hotelReservation/break
import type { BedTypeSchema } from "@/types/components/hotelReservation/enterDetails/bedType"
import type { Price } from "@/types/components/hotelReservation/price"
import type { Child } from "@/types/components/hotelReservation/selectRate/selectRate"
import type { CurrencyEnum } from "@/types/enums/currency"
import type { Package, Packages } from "@/types/requests/packages"
type RoomPrice =
@@ -59,6 +60,7 @@ export interface PriceDetailsTableProps {
toDate: string
totalPrice: Price
vat: number
defaultCurrency: CurrencyEnum
}
export default function PriceDetailsTable({
@@ -69,6 +71,7 @@ export default function PriceDetailsTable({
toDate,
totalPrice,
vat,
defaultCurrency,
}: PriceDetailsTableProps) {
const intl = useIntl()
const lang = useLang()
@@ -122,11 +125,7 @@ export default function PriceDetailsTable({
}
if (!currency) {
if (room.packages?.length) {
currency = room.packages[0].localPrice.currency
} else if (room.breakfast) {
currency = room.breakfast.localPrice.currency
}
currency = defaultCurrency
}
if (!price && !voucherPrice && !chequePrice && !redemptionPrice) {