refactor: handle agent
This commit is contained in:
parent
fd62732642
commit
c1afeee1da
3 changed files with 9 additions and 3 deletions
|
|
@ -445,7 +445,9 @@ watch(
|
||||||
<q-td align="right">
|
<q-td align="right">
|
||||||
{{
|
{{
|
||||||
formatNumberDecimal(
|
formatNumberDecimal(
|
||||||
props.row.product.calcVat
|
props.row.product[
|
||||||
|
agentPrice ? 'agentPriceCalcVat' : 'calcVat'
|
||||||
|
]
|
||||||
? precisionRound(
|
? precisionRound(
|
||||||
(props.row.pricePerUnit * props.row.amount -
|
(props.row.pricePerUnit * props.row.amount -
|
||||||
props.row.discount) *
|
props.row.discount) *
|
||||||
|
|
|
||||||
|
|
@ -307,7 +307,11 @@ function mapNode() {
|
||||||
const price = prop.agentPrice
|
const price = prop.agentPrice
|
||||||
? p.product.agentPrice
|
? p.product.agentPrice
|
||||||
: p.product.price;
|
: p.product.price;
|
||||||
const pricePerUnit = p.product.vatIncluded
|
const pricePerUnit = (
|
||||||
|
prop.agentPrice
|
||||||
|
? p.product.agentPriceVatIncluded
|
||||||
|
: p.product.vatIncluded
|
||||||
|
)
|
||||||
? precisionRound(price / (1 + (config.value?.vat || 0.07)))
|
? precisionRound(price / (1 + (config.value?.vat || 0.07)))
|
||||||
: price;
|
: price;
|
||||||
productCount.value++;
|
productCount.value++;
|
||||||
|
|
|
||||||
|
|
@ -398,7 +398,7 @@ function print() {
|
||||||
<td style="text-align: right">
|
<td style="text-align: right">
|
||||||
{{
|
{{
|
||||||
formatNumberDecimal(
|
formatNumberDecimal(
|
||||||
v.product.calcVat
|
v.product[agentPrice ? 'agentPriceCalcVat' : 'calcVat']
|
||||||
? precisionRound(
|
? precisionRound(
|
||||||
(v.pricePerUnit * v.amount - v.discount) *
|
(v.pricePerUnit * v.amount - v.discount) *
|
||||||
(config?.vat || 0.07),
|
(config?.vat || 0.07),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue