fix: calculate price
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 4s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 4s
This commit is contained in:
parent
4e71343af7
commit
de33d03631
1 changed files with 4 additions and 1 deletions
|
|
@ -334,6 +334,7 @@ const flowAccount = {
|
||||||
isVat: true,
|
isVat: true,
|
||||||
|
|
||||||
useReceiptDeduction: false,
|
useReceiptDeduction: false,
|
||||||
|
useInlineVat: true,
|
||||||
|
|
||||||
discounPercentage: 0,
|
discounPercentage: 0,
|
||||||
discountAmount: quotation.totalDiscount,
|
discountAmount: quotation.totalDiscount,
|
||||||
|
|
@ -377,7 +378,9 @@ const flowAccount = {
|
||||||
pricePerUnit: precisionRound(v.pricePerUnit),
|
pricePerUnit: precisionRound(v.pricePerUnit),
|
||||||
quantity: v.amount,
|
quantity: v.amount,
|
||||||
discountAmount: v.discount,
|
discountAmount: v.discount,
|
||||||
total: (v.pricePerUnit - (v.discount || 0)) * v.amount + v.vat,
|
total:
|
||||||
|
precisionRound(v.pricePerUnit * (1 + (v.vat === 0 ? VAT_DEFAULT : 0))) * v.amount -
|
||||||
|
(v.discount ?? 0),
|
||||||
vatRate: v.vat === 0 ? 0 : Math.round(VAT_DEFAULT * 100),
|
vatRate: v.vat === 0 ? 0 : Math.round(VAT_DEFAULT * 100),
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue