fix: price different by 0.01
This commit is contained in:
parent
8c42eade65
commit
23d9f0054c
1 changed files with 6 additions and 2 deletions
|
|
@ -419,7 +419,9 @@ export class QuotationController extends Controller {
|
|||
const price = body.agentPrice ? p.agentPrice : p.price;
|
||||
const pricePerUnit = p.vatIncluded ? precisionRound(price / (1 + VAT_DEFAULT)) : price;
|
||||
const vat = p.calcVat
|
||||
? precisionRound((pricePerUnit * v.amount - (v.discount || 0)) * VAT_DEFAULT)
|
||||
? precisionRound(
|
||||
(pricePerUnit * (v.discount ? v.amount : 1) - (v.discount || 0)) * VAT_DEFAULT,
|
||||
) * (!v.discount ? v.amount : 1)
|
||||
: 0;
|
||||
|
||||
return {
|
||||
|
|
@ -667,7 +669,9 @@ export class QuotationController extends Controller {
|
|||
const price = record.agentPrice ? p.agentPrice : p.price;
|
||||
const pricePerUnit = p.vatIncluded ? precisionRound(price / (1 + VAT_DEFAULT)) : price;
|
||||
const vat = p.calcVat
|
||||
? precisionRound((pricePerUnit * v.amount - (v.discount || 0)) * VAT_DEFAULT)
|
||||
? precisionRound(
|
||||
(pricePerUnit * (v.discount ? v.amount : 1) - (v.discount || 0)) * VAT_DEFAULT,
|
||||
) * (!v.discount ? v.amount : 1)
|
||||
: 0;
|
||||
return {
|
||||
order: i + 1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue