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

@@ -94,3 +94,13 @@ export function sumPackagesRequestedPrice(packages: Packages | null) {
}
)
}
export function calculateVat(priceInclVat: number, vat: number) {
const vatPercentage = vat / 100
const priceExclVat = priceInclVat / (1 + vatPercentage)
const vatAmount = priceInclVat - priceExclVat
return {
priceExclVat,
vatAmount,
}
}