Merged in feat/SW-2079-update-booking-page-to-show-points- (pull request #1683)
feat: SW-2079 Show points in confirmation page * feat: SW-2079 Show points in confirmation page * feat: SW-2079 Optimized code * feat: SW-2079 Updated Body to Typography * feat: SW-2079 Multi-room total cost display * feat: SW-2079 Add reward nights condition rate title * feat: SW-2079 Removed extra checks * feat: SW-2079 Optimmized formatPrice function * feat: SW-2079 Typo fix Approved-by: Christian Andolf
This commit is contained in:
@@ -3,6 +3,7 @@ import React from "react"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
|
||||
import { dt } from "@/lib/dt"
|
||||
import { useBookingConfirmationStore } from "@/stores/booking-confirmation"
|
||||
@@ -61,15 +62,25 @@ function TableSectionHeader({
|
||||
export default function PriceDetailsModal() {
|
||||
const intl = useIntl()
|
||||
const lang = useLang()
|
||||
const { rooms, currencyCode, vat, fromDate, toDate, bookingCode } =
|
||||
useBookingConfirmationStore((state) => ({
|
||||
rooms: state.rooms,
|
||||
currencyCode: state.currencyCode,
|
||||
vat: state.vat,
|
||||
fromDate: state.fromDate,
|
||||
toDate: state.toDate,
|
||||
bookingCode: state.bookingCode,
|
||||
}))
|
||||
const {
|
||||
rooms,
|
||||
currencyCode,
|
||||
vat,
|
||||
fromDate,
|
||||
toDate,
|
||||
bookingCode,
|
||||
isVatCurrency,
|
||||
formattedTotalCost,
|
||||
} = useBookingConfirmationStore((state) => ({
|
||||
rooms: state.rooms,
|
||||
currencyCode: state.currencyCode,
|
||||
vat: state.vat,
|
||||
fromDate: state.fromDate,
|
||||
toDate: state.toDate,
|
||||
bookingCode: state.bookingCode,
|
||||
isVatCurrency: state.isVatCurrency,
|
||||
formattedTotalCost: state.formattedTotalCost,
|
||||
}))
|
||||
|
||||
if (!rooms[0]) {
|
||||
return null
|
||||
@@ -149,7 +160,7 @@ export default function PriceDetailsModal() {
|
||||
<Row
|
||||
bold
|
||||
label={intl.formatMessage({ id: "Room charge" })}
|
||||
value={formatPrice(intl, room.roomPrice, currencyCode)}
|
||||
value={room.formattedTotalCost}
|
||||
/>
|
||||
</TableSection>
|
||||
|
||||
@@ -200,24 +211,28 @@ export default function PriceDetailsModal() {
|
||||
})}
|
||||
<TableSection>
|
||||
<TableSectionHeader title={intl.formatMessage({ id: "Total" })} />
|
||||
<Row
|
||||
label={intl.formatMessage({ id: "Price excluding VAT" })}
|
||||
value={formatPrice(intl, bookingTotal.priceExVat, currencyCode)}
|
||||
/>
|
||||
<Row
|
||||
label={intl.formatMessage({ id: "VAT {vat}%" }, { vat })}
|
||||
value={formatPrice(intl, bookingTotal.vatAmount, currencyCode)}
|
||||
/>
|
||||
{isVatCurrency ? (
|
||||
<>
|
||||
<Row
|
||||
label={intl.formatMessage({ id: "Price excluding VAT" })}
|
||||
value={formatPrice(intl, bookingTotal.priceExVat, currencyCode)}
|
||||
/>
|
||||
<Row
|
||||
label={intl.formatMessage({ id: "VAT {vat}%" }, { vat })}
|
||||
value={formatPrice(intl, bookingTotal.vatAmount, currencyCode)}
|
||||
/>
|
||||
</>
|
||||
) : null}
|
||||
<tr className={styles.row}>
|
||||
<td>
|
||||
<Body textTransform="bold">
|
||||
{intl.formatMessage({ id: "Price including VAT" })}
|
||||
</Body>
|
||||
<Typography variant="Body/Paragraph/mdBold">
|
||||
<span>{intl.formatMessage({ id: "Price including VAT" })}</span>
|
||||
</Typography>
|
||||
</td>
|
||||
<td className={styles.price}>
|
||||
<Body textTransform="bold">
|
||||
{formatPrice(intl, bookingTotal.price, currencyCode)}
|
||||
</Body>
|
||||
<Typography variant="Body/Paragraph/mdBold">
|
||||
<span>{formattedTotalCost}</span>
|
||||
</Typography>
|
||||
</td>
|
||||
</tr>
|
||||
{bookingCode && (
|
||||
|
||||
Reference in New Issue
Block a user