|
|
@ -378,11 +378,22 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require) |
|
|
|
|
|
|
|
var scale_screen = this.gui.screen_instances['balancescale']; |
|
|
|
this.set_weight(0); |
|
|
|
// this.set_price(0);
|
|
|
|
scale_screen.renderElement(); |
|
|
|
|
|
|
|
queue.schedule(function () { |
|
|
|
return self.pos.proxy.reset_weight().then(function () { |
|
|
|
self.set_weight(0); |
|
|
|
// self.set_price(0);
|
|
|
|
}); |
|
|
|
}, {duration: 500}); |
|
|
|
|
|
|
|
queue.schedule(function(){ |
|
|
|
return self.pos.proxy.scale_read().then(function(weight){ |
|
|
|
self.set_weight(weight.weight); |
|
|
|
return self.pos.proxy.scale_read().then(function(scale_answer){ |
|
|
|
self.set_weight(scale_answer.weight); |
|
|
|
if ((scale_answer.error === '30' || scale_answer.error === '31') && scale_answer.weight !== 0) { |
|
|
|
self.set_weight(0); |
|
|
|
} |
|
|
|
}); |
|
|
|
},{duration:500, repeat: true}); |
|
|
|
|
|
|
@ -393,16 +404,13 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require) |
|
|
|
var scale_screen = this.gui.screen_instances['balancescale']; |
|
|
|
scale_screen.weight = weight; |
|
|
|
scale_screen.$('.weight').text(scale_screen.get_product_weight_string()); |
|
|
|
scale_screen.$('.computed-price').text(scale_screen.format_currency(scale_screen.get_product_price() * 0)); |
|
|
|
}, |
|
|
|
|
|
|
|
set_price: function (price) { |
|
|
|
var scale_screen = this.gui.screen_instances['balancescale']; |
|
|
|
if (!price) { |
|
|
|
scale_screen.$('.computed-price').text(scale_screen.get_computed_price_string()); |
|
|
|
} else { |
|
|
|
scale_screen.price = price; |
|
|
|
scale_screen.$('.computed-price').text(scale_screen.format_currency(price)); |
|
|
|
} |
|
|
|
scale_screen.price = price; |
|
|
|
scale_screen.$('.computed-price').text(scale_screen.format_currency(0)); |
|
|
|
}, |
|
|
|
|
|
|
|
barcode_container_action: function(code){ |
|
|
@ -707,7 +715,7 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require) |
|
|
|
scale_screen.weight = weight; |
|
|
|
scale_screen.weight_brut = container.weight + scale_screen.weight; |
|
|
|
scale_screen.$('.weight').text(scale_screen.get_product_weight_string()); |
|
|
|
scale_screen.$('.computed-price').text(scale_screen.get_computed_price_string()); |
|
|
|
scale_screen.$('.computed-price').text(scale_screen.format_currency(scale_screen.get_product_price() * 0)); |
|
|
|
scale_screen.$('.weight-brut').text(scale_screen.get_product_weight_string_brut()); |
|
|
|
|
|
|
|
if (container){ |
|
|
@ -720,7 +728,11 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require) |
|
|
|
}, |
|
|
|
|
|
|
|
click_product: function(product) { |
|
|
|
this.create_transaction(product); |
|
|
|
var scale_screen = this.gui.screen_instances['balancescale']; |
|
|
|
|
|
|
|
if (scale_screen.weight != 0) { |
|
|
|
this.create_transaction(product); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
create_transaction: function(product){ |
|
|
|