fix: always use totalPrice to display roomCharge

This commit is contained in:
Simon Emanuelsson
2025-04-16 12:41:37 +02:00
parent 1f94c581ae
commit 722d4505ba
18 changed files with 312 additions and 864 deletions

View File

@@ -1,12 +1,12 @@
import type { PriceType } from "@/types/components/hotelReservation/myStay/myStay"
import { PriceTypeEnum } from "@/types/components/hotelReservation/myStay/myStay"
export function getPriceType(
cheques: number,
points: number,
vouchers: number
): PriceType {
if (points > 0) return "points"
if (vouchers > 0) return "voucher"
if (cheques > 0) return "cheque"
return "money"
): PriceTypeEnum {
if (points > 0) return PriceTypeEnum.points
if (vouchers > 0) return PriceTypeEnum.voucher
if (cheques > 0) return PriceTypeEnum.cheque
return PriceTypeEnum.money
}

View File

@@ -153,6 +153,9 @@ export function mapRoomDetails({
requested: undefined,
},
},
totalPriceExVat: booking.totalPriceExVat,
totalPrice: booking.totalPrice,
vatAmount: booking.vatAmount,
breakfast,
priceType,
}