fix: wrong price calc
This commit is contained in:
parent
ab26a52c48
commit
5de762bb72
2 changed files with 4 additions and 3 deletions
|
|
@ -63,7 +63,7 @@ function calcPrice(c: (typeof rows.value)[number]) {
|
|||
);
|
||||
const finalPriceNoVat = finalPriceWithVat / (1 + (config.value?.vat || 0.07));
|
||||
|
||||
const price = finalPriceNoVat * c.amount;
|
||||
const price = finalPriceNoVat * c.amount - c.discount;
|
||||
const vat = c.product.calcVat
|
||||
? (finalPriceNoVat * c.amount - c.discount) * (config.value?.vat || 0.07)
|
||||
: 0;
|
||||
|
|
@ -434,7 +434,8 @@ watch(
|
|||
<q-td align="right">
|
||||
{{
|
||||
formatNumberDecimal(
|
||||
props.row.pricePerUnit * props.row.amount,
|
||||
props.row.pricePerUnit * props.row.amount -
|
||||
props.row.discount,
|
||||
2,
|
||||
)
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ onMounted(async () => {
|
|||
const finalPriceNoVat =
|
||||
finalPriceWithVat / (1 + (config.value?.vat || 0.07));
|
||||
|
||||
const price = finalPriceNoVat * v.amount;
|
||||
const price = finalPriceNoVat * v.amount - v.discount;
|
||||
const vat =
|
||||
(finalPriceNoVat * v.amount - v.discount) *
|
||||
(config.value?.vat || 0.07);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue