Fix rounding for line item discounts
This commit is contained in:
parent
20238909c4
commit
b5dfb2317f
5 changed files with 6 additions and 6 deletions
|
|
@ -549,7 +549,7 @@ class InvoiceRepository extends BaseRepository
|
|||
if ($invoice->is_amount_discount) {
|
||||
$lineTotal -= $discount;
|
||||
} else {
|
||||
$lineTotal -= $lineTotal * $discount / 100;
|
||||
$lineTotal -= round($lineTotal * $discount / 100, 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -595,7 +595,7 @@ function calculateAmounts(invoice) {
|
|||
if (parseInt(invoice.is_amount_discount)) {
|
||||
lineTotal -= discount;
|
||||
} else {
|
||||
lineTotal -= (lineTotal * discount / 100);
|
||||
lineTotal -= roundToTwo(lineTotal * discount / 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -652,7 +652,7 @@ function calculateAmounts(invoice) {
|
|||
if (parseInt(invoice.is_amount_discount)) {
|
||||
lineTotal -= discount;
|
||||
} else {
|
||||
lineTotal -= (lineTotal * discount / 100);
|
||||
lineTotal -= roundToTwo(lineTotal * discount / 100);
|
||||
}
|
||||
}
|
||||
lineTotal = roundToTwo(lineTotal);
|
||||
|
|
|
|||
|
|
@ -904,7 +904,7 @@ function ItemModel(data) {
|
|||
if (parseInt(model.invoice().is_amount_discount())) {
|
||||
value -= discount;
|
||||
} else {
|
||||
value -= (value * discount / 100);
|
||||
value -= roundToTwo(value * discount / 100);
|
||||
}
|
||||
}
|
||||
return value ? roundToTwo(value) : 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue