diff options
| author | Joren Van Onder <jov@odoo.com> | 2015-08-27 15:59:04 +0200 |
|---|---|---|
| committer | Cedric Snauwaert <csn@openerp.com> | 2015-08-27 17:11:07 +0200 |
| commit | dbb77c5f504bfb1b459ef51ca71862640ebf7c90 (patch) | |
| tree | 15db77416a68fa619ce771316e9228dd743f577d | |
| parent | 65dbf8f11740dda608fe8e7789f7652d97b656bb (diff) | |
[FIX] point_of_sale: take quantity into account when calculating taxes
Fixes a bug introduced in 5a8a0d252cc735de4c95748c90f34ccbf50349b5.
Before this, creating an order with two of the same products would
result in a total price to pay which would only include the tax of one
product. This would cause point of sale orders in the backend which
weren't fully paid.
| -rw-r--r-- | addons/point_of_sale/static/src/js/models.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 2ae832f8c94..0891ed037c5 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -1275,13 +1275,13 @@ exports.Orderline = Backbone.Model.extend({ return base_amount >= 0 ? ret : ret * -1; } if ((tax.amount_type === 'percent' && !tax.price_include) || (tax.amount_type === 'division' && tax.price_include)){ - return base_amount * tax.amount / 100; + return (base_amount * tax.amount / 100) * quantity; } if (tax.amount_type === 'percent' && tax.price_include){ - return base_amount - (base_amount / (1 + tax.amount / 100)); + return (base_amount - (base_amount / (1 + tax.amount / 100))) * quantity; } if (tax.amount_type === 'division' && !tax.price_include) { - return base_amount / (1 - tax.amount / 100) - base_amount; + return (base_amount / (1 - tax.amount / 100) - base_amount) * quantity; } return false; }, |
