feat: adjust price to respect its calc vat
This commit is contained in:
parent
fba9adc5f3
commit
82793dc7a8
4 changed files with 50 additions and 25 deletions
|
|
@ -199,7 +199,7 @@ onMounted(async () => {
|
|||
})
|
||||
.reduce(
|
||||
(a, c) => {
|
||||
const priceNoVat = c.product.vatIncluded
|
||||
const priceNoVat = c.product.serviceChargeVatIncluded
|
||||
? c.pricePerUnit / (1 + (config.value?.vat || 0.07))
|
||||
: c.pricePerUnit;
|
||||
const adjustedPriceWithVat = precisionRound(
|
||||
|
|
@ -219,9 +219,10 @@ onMounted(async () => {
|
|||
priceUnit: precisionRound(priceNoVat),
|
||||
amount: c.amount,
|
||||
discount: c.discount,
|
||||
vat: c.product.calcVat ? precisionRound(rawVat) : 0,
|
||||
vat: c.product.serviceChargeCalcVat ? precisionRound(rawVat) : 0,
|
||||
value: precisionRound(
|
||||
priceNoVat * c.amount + (c.product.calcVat ? rawVatTotal : 0),
|
||||
priceNoVat * c.amount +
|
||||
(c.product.serviceChargeCalcVat ? rawVatTotal : 0),
|
||||
),
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue