Merged in fix/BOOK-584-strikethrough-regulare-price (pull request #3374)
fix(BOOK-584): multiple nights did not show strikethrough price, wrong calculation for regular price per stay * fix(BOOK-548): multiple nights did not show strikethrough price, wrong calculation for regular price per stay * fix(BOOK-584): fix test, regularPrice first compare with pricePerStay Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -479,7 +479,7 @@ type RegularRoomRequestedPrice = {
|
||||
pricePerStay: number
|
||||
}
|
||||
|
||||
export function getRegularPrice(
|
||||
export function getTotalRegularPrice(
|
||||
rooms: RegularPriceCalculationRoom[],
|
||||
isMember: boolean,
|
||||
nights: number
|
||||
@@ -539,13 +539,13 @@ export function getRegularPrice(
|
||||
useMemberRate: !!useMemberRate,
|
||||
regularMemberPrice: memberRate
|
||||
? {
|
||||
pricePerStay: memberRate.localPrice.pricePerNight,
|
||||
pricePerStay: memberRate.localPrice.pricePerStay,
|
||||
regularPricePerStay: memberRate.localPrice.regularPricePerStay,
|
||||
}
|
||||
: undefined,
|
||||
regularPublicPrice: publicRate
|
||||
? {
|
||||
pricePerStay: publicRate.localPrice.pricePerNight,
|
||||
pricePerStay: publicRate.localPrice.pricePerStay,
|
||||
regularPricePerStay: publicRate.localPrice.regularPricePerStay,
|
||||
}
|
||||
: undefined,
|
||||
@@ -609,7 +609,7 @@ export function getTotalPrice(
|
||||
"member" in x.roomRate || "public" in x.roomRate
|
||||
)
|
||||
if (regularRooms.length > 0) {
|
||||
return getRegularPrice(regularRooms, isMember, nights)
|
||||
return getTotalRegularPrice(regularRooms, isMember, nights)
|
||||
}
|
||||
|
||||
logger.warn(
|
||||
|
||||
Reference in New Issue
Block a user