fix: forgot price per unit
This commit is contained in:
parent
06c96d1136
commit
93b184d40d
1 changed files with 30 additions and 21 deletions
|
|
@ -207,27 +207,35 @@ function mapNode() {
|
|||
const noNameObjects = v.work
|
||||
.filter((w: Work) => !w.name)
|
||||
.flatMap((w: Work) =>
|
||||
w.productOnWork.map((p) => ({
|
||||
type: 'product',
|
||||
id: p.product.id,
|
||||
title: p.product.name,
|
||||
subtitle: p.product.code || ' ',
|
||||
detail: p.product.detail,
|
||||
remark: p.product.remark,
|
||||
value: {
|
||||
vat: 0,
|
||||
pricePerUnit: 0,
|
||||
discount: 0,
|
||||
amount: 0,
|
||||
service: v.raw,
|
||||
work: w,
|
||||
product: p.product,
|
||||
},
|
||||
checked: true,
|
||||
icon: 'mdi-shopping-outline',
|
||||
bg: 'hsla(var(--teal-10-hsl)/0.1)',
|
||||
fg: 'var(--teal-10)',
|
||||
})),
|
||||
w.productOnWork.map((p) => {
|
||||
const price = prop.agentPrice
|
||||
? p.product.agentPrice
|
||||
: p.product.price;
|
||||
const pricePerUnit = p.product.vatIncluded
|
||||
? precisionRound(price / (1 + (config.value?.vat || 0.07)))
|
||||
: price;
|
||||
return {
|
||||
type: 'product',
|
||||
id: p.product.id,
|
||||
title: p.product.name,
|
||||
subtitle: p.product.code || ' ',
|
||||
detail: p.product.detail,
|
||||
remark: p.product.remark,
|
||||
value: {
|
||||
vat: 0,
|
||||
pricePerUnit,
|
||||
discount: 0,
|
||||
amount: 0,
|
||||
service: v.raw,
|
||||
work: w,
|
||||
product: p.product,
|
||||
},
|
||||
checked: true,
|
||||
icon: 'mdi-shopping-outline',
|
||||
bg: 'hsla(var(--teal-10-hsl)/0.1)',
|
||||
fg: 'var(--teal-10)',
|
||||
};
|
||||
}),
|
||||
);
|
||||
const withNameObjects = v.work
|
||||
.filter((w: Work) => w.name)
|
||||
|
|
@ -490,6 +498,7 @@ watch(
|
|||
class="q-py-sm q-px-lg"
|
||||
style="background: hsla(var(--info-bg) / 0.1)"
|
||||
>
|
||||
0
|
||||
{{
|
||||
$t('general.list', {
|
||||
msg: $t('productService.title'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue