[FIX] point_of_sale: total discount computation
When the total discount is computed on a receipt, it is computed based on the the discount applied on lines, and the difference between the pricelist price and the unit price. But there is an option on the pricelist that say if you want to show or not the difference. Which is not respected in this case because in total we always show all discount. So we are now respecting the policy of the pricelist. TASK-ID: 2058650
This commit is contained in:
@@ -2777,7 +2777,9 @@ exports.Order = Backbone.Model.extend({
|
||||
get_total_discount: function() {
|
||||
return round_pr(this.orderlines.reduce((function(sum, orderLine) {
|
||||
sum += (orderLine.get_unit_price() * (orderLine.get_discount()/100) * orderLine.get_quantity());
|
||||
sum += ((orderLine.get_lst_price() - orderLine.get_unit_price()) * orderLine.get_quantity());
|
||||
if (orderLine.display_discount_policy() === 'without_discount'){
|
||||
sum += ((orderLine.get_lst_price() - orderLine.get_unit_price()) * orderLine.get_quantity());
|
||||
}
|
||||
return sum;
|
||||
}), 0), this.pos.currency.rounding);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user