[FIX] point_of_sale: fixup
This commit is contained in:
committed by
Gert Pellin - GPE
parent
088044811d
commit
3e77a95e5c
@@ -1307,9 +1307,6 @@ exports.Product = Backbone.Model.extend({
|
||||
// pricelist that have base == 'pricelist'.
|
||||
return price;
|
||||
},
|
||||
get_discount_policy: function(pricelist){
|
||||
return pricelist.discount_policy;
|
||||
},
|
||||
});
|
||||
|
||||
var orderline_id = 1;
|
||||
@@ -1784,10 +1781,10 @@ exports.Orderline = Backbone.Model.extend({
|
||||
};
|
||||
},
|
||||
display_discount_policy: function(){
|
||||
return this.product.get_discount_policy(this.order.pricelist);
|
||||
return this.order.pricelist.discount_policy;
|
||||
},
|
||||
get_list_price: function(){
|
||||
return this.product.list_price;
|
||||
get_lst_price: function(){
|
||||
return this.product.lst_price;
|
||||
},
|
||||
});
|
||||
|
||||
@@ -2460,8 +2457,8 @@ 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_list_price() - orderLine.get_unit_price()) * orderLine.get_quantity());
|
||||
return sum
|
||||
sum += ((orderLine.get_lst_price() - orderLine.get_unit_price()) * orderLine.get_quantity());
|
||||
return sum;
|
||||
}), 0), this.pos.currency.rounding);
|
||||
},
|
||||
get_total_tax: function() {
|
||||
|
||||
@@ -1269,7 +1269,7 @@
|
||||
<t t-if="line.get_product().tracking!=='none'">
|
||||
<i class="oe_link_icon fa fa-list oe_icon line-lot-icon oe_green" t-if="line.has_valid_product_lot()"
|
||||
aria-label="Valid product lot" role="img" title="Valid product lot"/>
|
||||
<i class="oe_link_icon fa fa-list oe_icon line-lot-icon oe_red" t-if="!(line.has_valid_product_lot())"
|
||||
<i class="oe_link_icon fa fa-list oe_icon line-lot-icon oe_red" t-if="!line.has_valid_product_lot()"
|
||||
aria-label="Invalid product lot" role="img" title="Invalid product lot"/>
|
||||
</t>
|
||||
</span>
|
||||
@@ -1285,10 +1285,10 @@
|
||||
<t t-esc="line.get_unit().name" />
|
||||
at
|
||||
<t t-if="line.display_discount_policy() == 'without_discount' &&
|
||||
line.get_unit_display_price() != line.get_list_price()">
|
||||
<strike>
|
||||
<t t-esc="widget.format_currency(line.get_list_price(),'Product List Price')" />
|
||||
</strike>
|
||||
line.get_unit_display_price() != line.get_lst_price()">
|
||||
<s>
|
||||
<t t-esc="widget.format_currency(line.get_lst_price(),'Product Price')" />
|
||||
</s>
|
||||
<t t-esc="widget.format_currency(line.get_unit_display_price(),'Product Price')" />
|
||||
</t>
|
||||
<t t-else="">
|
||||
@@ -1482,11 +1482,11 @@
|
||||
<td>
|
||||
<t t-esc="orderline.get_product().display_name"/>
|
||||
<t t-if="orderline.display_discount_policy() == 'without_discount' &&
|
||||
orderline.get_unit_display_price() != orderline.get_list_price()">
|
||||
orderline.get_unit_display_price() != orderline.get_lst_price()">
|
||||
<div class="pos-disc-font">
|
||||
<strike>
|
||||
<t t-esc="widget.format_currency(orderline.get_list_price(),'Product List Price')"/>
|
||||
</strike>
|
||||
<s>
|
||||
<t t-esc="widget.format_currency(orderline.get_lst_price(),'Product Price')"/>
|
||||
</s>
|
||||
->
|
||||
<t t-esc="widget.format_currency(orderline.get_unit_display_price(),'Product Price')"/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user