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:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user