Merged in fix/SW-2899 (pull request #2433)

fix (SW-2899): correct VAT calculations

* fix (SW-2899): correct VAT calculations

* refactor: add calculateVat util


Approved-by: Christian Andolf
This commit is contained in:
Arvid Norlin
2025-06-25 11:56:30 +00:00
parent 145a6d2365
commit 1802a391ec
3 changed files with 19 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
"use client"
import { useIntl } from "react-intl"
import { calculateVat } from "@/components/HotelReservation/utils"
import { formatPrice } from "@/utils/numberFormatting"
import RegularRow from "./Regular"
@@ -27,10 +28,7 @@ export default function VatRow({ totalPrice, vat }: VatProps) {
return null
}
const vatPercentage = vat / 100
const vatAmount = totalPrice.local.price * vatPercentage
const priceExclVat = totalPrice.local.price - vatAmount
const { vatAmount, priceExclVat } = calculateVat(totalPrice.local.price, vat)
return (
<>