fix: show summary price
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 5s

This commit is contained in:
Thanaphon Saengchan 2025-09-18 16:41:41 +07:00
parent 80056f8e0b
commit aa908f0c3d

View file

@ -196,7 +196,7 @@ function getPrice(
) {
if (filterHook) list = list.filter(filterHook);
return list.reduce(
const value = list.reduce(
(a, c) => {
if (
selectedInstallmentNo.value.length > 0 &&
@ -236,6 +236,8 @@ function getPrice(
finalPrice: 0,
},
);
return value;
}
const summaryPrice = computed(() => getPrice(productServiceList.value));
@ -1143,7 +1145,19 @@ watch(customerBranchOption, () => {
// }
function storeDataLocal() {
quotationFormData.value.productServiceList = productService.value;
const tempProductService = productService.value.map((v) => {
return {
...v,
vat: v.product[agentPrice ? 'agentPriceCalcVat' : 'calcVat']
? precisionRound(
((v.pricePerUnit * (1 + (config?.value.vat || 0.07)) * v.amount -
v.discount) /
(1 + (config?.value.vat || 0.07))) *
0.07,
)
: 0,
};
});
localStorage.setItem(
'quotation-preview',
@ -1152,7 +1166,7 @@ function storeDataLocal() {
codeInvoice: code.value,
codePayment: firstCodePayment.value,
...quotationFormData.value,
productServiceList: productService.value,
productServiceList: tempProductService,
},
meta: {
source: {