|
|
@ -165,9 +165,26 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
get_product_weight_string: function(){ |
|
|
|
var product = this.get_product(); |
|
|
|
var defaultstr = (this.weight || 0).toFixed(3) + ' kg'; |
|
|
|
if(!product || !this.pos){ |
|
|
|
return defaultstr; |
|
|
|
} |
|
|
|
var unit_id = product.uom_id; |
|
|
|
if(!unit_id){ |
|
|
|
return defaultstr; |
|
|
|
} |
|
|
|
var unit = this.pos.units_by_id[unit_id[0]]; |
|
|
|
var weight = round_pr(this.weight || 0, unit.rounding); |
|
|
|
var weightstr = weight.toFixed(Math.ceil(Math.log(1.0/unit.rounding) / Math.log(10) )); |
|
|
|
weightstr += ' ' + unit.name; |
|
|
|
return weightstr; |
|
|
|
}, |
|
|
|
|
|
|
|
get_product_weight_string_brut: function(){ |
|
|
|
var product = this.get_product(); |
|
|
|
var defaultstr = (this.weight + this.weight_container || 0).toFixed(3) + ' Kg'; |
|
|
|
var defaultstr = (this.weight + this.weight_container || 0).toFixed(3) + ' kg'; |
|
|
|
if(!product || !this.pos){ |
|
|
|
return defaultstr; |
|
|
|
} |
|
|
@ -381,13 +398,6 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require) |
|
|
|
|
|
|
|
var container = this.gui.get_current_screen_param('container'); |
|
|
|
|
|
|
|
// queue.schedule(function () {
|
|
|
|
// return self.pos.proxy.reset_weight().then(function () {
|
|
|
|
// self.set_weight(0);
|
|
|
|
// self.set_price(0);
|
|
|
|
// });
|
|
|
|
// }, {duration: 500});
|
|
|
|
|
|
|
|
// format price
|
|
|
|
var scale_screen = this.gui.screen_instances['balancescale']; |
|
|
|
var price = scale_screen.format_price(scale_screen.get_product_price()); |
|
|
@ -433,9 +443,9 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require) |
|
|
|
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)); |
|
|
|
scale_screen.$('.weight-brut').text(''); |
|
|
|
scale_screen.$('.weight-brut').text('0.000 kg'); |
|
|
|
|
|
|
|
var container_text = '' |
|
|
|
var container_text = '0.000 kg' |
|
|
|
scale_screen.$('.tare-container').text(container_text); |
|
|
|
}, |
|
|
|
|
|
|
@ -810,6 +820,7 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require) |
|
|
|
fields['write_date'] = date_time; |
|
|
|
|
|
|
|
fields['weight_net'] = scale_screen.weight; |
|
|
|
fields['weight_tare'] = container.weight; |
|
|
|
|
|
|
|
var pricelist = scale_screen._get_active_pricelist(); |
|
|
|
fields['price_product'] = (product ? product.get_price(pricelist, scale_screen.weight) : 0) || 0; |
|
|
|