[FIX] point_of_sale: discount applied twice
* Setup an IoTBox connected to a receipt printer * In POS Config: - IoT Box: check "IoTBox", set the IP of the Box and check "Receipt Printer" - Pricing: Select "Tax-Included Price" * Start the POS, select any product * Click on "Disc" on the virutal keyboard on the bottom left of the POS * Enter the amount of the discount * Validatate payment (Click "Payment" > "Cash" > Enter Amount > "Validate") * A ticket should print on the receipt printer: - The price in the rigth column is correct Current behaviour: * In the left column, it shows : Product name, Base price, Discount: X%, 1 x Price --> This price is not correct, it shows the price with the discount applied twice. Expected behaviour: * Discount applied once everywhere on ticket. task-1978564 closes odoo/odoo#34278 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -1637,9 +1637,9 @@ exports.Orderline = Backbone.Model.extend({
|
||||
},
|
||||
get_display_price_one: function(){
|
||||
var rounding = this.pos.currency.rounding;
|
||||
var price_unit = this.get_unit_price() * (1.0 - (this.get_discount() / 100.0));
|
||||
var price_unit = this.get_unit_price();
|
||||
if (this.pos.config.iface_tax_included !== 'total') {
|
||||
return round_pr(price_unit, rounding);
|
||||
return round_pr(price_unit * (1.0 - (this.get_discount() / 100.0)), rounding);
|
||||
} else {
|
||||
var product = this.get_product();
|
||||
var taxes_ids = product.taxes_id;
|
||||
|
||||
@@ -791,8 +791,8 @@
|
||||
<left><t t-esc='line.product_name_wrapped[0]' /></left>
|
||||
<right><value t-att-value-decimals='pos.currency.decimals'><t t-esc='line.price_display' /></value></right>
|
||||
</line>
|
||||
<t t-call="XmlReceiptWrappedProductNameLines"/>
|
||||
</t>
|
||||
<t t-call="XmlReceiptWrappedProductNameLines"/>
|
||||
<t t-if='!simple'>
|
||||
<line><left><t t-esc='line.product_name_wrapped[0]' /></left></line>
|
||||
<t t-call="XmlReceiptWrappedProductNameLines"/>
|
||||
|
||||
Reference in New Issue
Block a user