feat: add separate price vat calc
This commit is contained in:
parent
ef81a93690
commit
310464f834
7 changed files with 344 additions and 280 deletions
|
|
@ -64,7 +64,7 @@ function calcPrice(c: (typeof rows.value)[number]) {
|
|||
const finalPriceNoVat = finalPriceWithVat / (1 + (config.value?.vat || 0.07));
|
||||
|
||||
const price = finalPriceNoVat * c.amount - c.discount;
|
||||
const vat = c.product.calcVat
|
||||
const vat = c.product[props.agentPrice ? 'agentPriceCalcVat' : 'calcVat']
|
||||
? (finalPriceNoVat * c.amount - c.discount) * (config.value?.vat || 0.07)
|
||||
: 0;
|
||||
return precisionRound(price + vat);
|
||||
|
|
@ -387,7 +387,9 @@ watch(
|
|||
{{
|
||||
formatNumberDecimal(
|
||||
props.row.pricePerUnit +
|
||||
(props.row.product.calcVat
|
||||
(props.row.product[
|
||||
agentPrice ? 'agentPriceCalcVat' : 'calcVat'
|
||||
]
|
||||
? props.row.pricePerUnit * (config?.vat || 0.07)
|
||||
: 0),
|
||||
2,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue