Browse Source

Ajout fonctionnalité mail 12/08

12.0
Juliana 4 years ago
parent
commit
f494499249
  1. 9
      static/src/css/style.css
  2. BIN
      static/src/img/logo-scan.png
  3. 32
      static/src/js/container.js
  4. 10
      static/src/xml/pos.xml

9
static/src/css/style.css

@ -65,6 +65,10 @@
}
.logo-scan{
width: 250px;
}
.pos-confirm-screen .logo-scan{
width: 150px;
}
@ -125,6 +129,7 @@
}
.pos .confirmation-screen .btn-back{
margin: 20px;
width: 300px;
}
@ -305,7 +310,8 @@ h1.product-name {
font-family: Inconsolata;
text-shadow: 0px 2px 0px #d2d2d2;
box-shadow: 0px 2px 0px #e1e1e1 inset;
width: 100%;
width: 220px;
/*width: 100%;*/
font-weight: normal;
}
@ -357,6 +363,7 @@ h1.product-name {
}
.pos-confirm-screen {
margin-top: -80px;
display: flex;
align-items: center;
justify-content: center;

BIN
static/src/img/logo-scan.png

Before

Width: 299  |  Height: 242  |  Size: 24 KiB

After

Width: 452  |  Height: 351  |  Size: 185 KiB

32
static/src/js/container.js

@ -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){

10
static/src/xml/pos.xml

@ -24,7 +24,6 @@
<li class="li-active"><span>1. Scanner l'étiquette</span></li>
<li><span>2</span></li>
<li><span>3</span></li>
<li><span>4</span></li>
</ul>
</div>
</div>
@ -195,8 +194,7 @@
<ul>
<li><span>1</span></li>
<li><span>2</span></li>
<li><span>3</span></li>
<li class="li-active"><span>4. Pesée confirmée</span></li>
<li class="li-active"><span>3. Pesée confirmée</span></li>
</ul>
</div>
</div>
@ -208,6 +206,11 @@
<div class='back-presentation'>
<img class="logo-scan mb-3" src="/vracoop_pos_free_balance_v2/static/src/img/picto-confirm.png" />
</div>
<h1 class='product-name'><t t-esc="widget.get_product_name()" /></h1>
<div class='product-price'>
à <t t-esc="widget.format_currency(widget.get_product_price()) + '/' + widget.get_product_uom()" />
</div>
<div class='back-presentation btn-back'>
Nouvelle pesée
<i class='fa fa-angle-double-right'></i>
@ -293,7 +296,6 @@
<li><span>1</span></li>
<li class="li-active"><span>2. Sélectionner un produit</span></li>
<li><span>3</span></li>
<li><span>4</span></li>
</ul>
</div>
</div>

Loading…
Cancel
Save