diff --git a/src/pages/05_quotation/ProductServiceForm.vue b/src/pages/05_quotation/ProductServiceForm.vue index 804e0499..255bacde 100644 --- a/src/pages/05_quotation/ProductServiceForm.vue +++ b/src/pages/05_quotation/ProductServiceForm.vue @@ -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'),