fix: .01 error

This commit is contained in:
Methapon2001 2025-09-17 09:27:39 +07:00
parent b9cfb6274b
commit 0e57a3daf6

View file

@ -284,8 +284,10 @@ onMounted(async () => {
(a, c) => {
const calcVat = c.vat > 0;
const vatFactor = calcVat ? (config.value?.vat ?? 0.07) : 0;
const pricePerUnit =
precisionRound(c.pricePerUnit * (1 + vatFactor)) / (1 + vatFactor);
const price =
(c.pricePerUnit * c.amount * (1 + vatFactor) - c.discount) /
(pricePerUnit * c.amount * (1 + vatFactor) - c.discount) /
(1 + vatFactor);
a.totalPrice = precisionRound(a.totalPrice + price + c.discount);