Skip to content
Extraits de code Groupes Projets
Valider ba0a7843 rédigé par Juliana's avatar Juliana
Parcourir les fichiers

Add set time screen

parent ed4c7a16
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
{
"name": "VRACOOP - POS Balance Container QRCode",
"summary": "VRACOOP - POS Balance Container QRCode",
"version": "12.0.1.2.0",
"version": "12.0.1.3.0",
"development_status": "Beta",
"author": "Le Filament",
"maintainers": ["remi-filament"],
......
......@@ -47,16 +47,18 @@ odoo.define('vracoop_pos_container_qrcode.container_print_qr', function (require
var count_it = 0;
queue.schedule(function () {
return self.pos.proxy.scale_read_data_price(priceStr).then(function (scale_answer) {
self.set_weight(scale_answer.weight);
if (count_it < 6) {
if (count_it < 4) {
count_it += 1;
}
else {
count_it = 0;
if (self.weight > 0){
self.print();
self.gui.show_screen('confirmation');
}
}
self.set_weight(scale_answer.weight);
if ((scale_answer.error === '30' || scale_answer.error === '31') && scale_answer.weight !== 0) {
self.set_weight(0);
}
......@@ -74,7 +76,6 @@ odoo.define('vracoop_pos_container_qrcode.container_print_qr', function (require
$("#pos-header-text-peser").removeClass('oe_hidden');
$("#pos-topheader-scale-cont").removeClass('oe_hidden');
//this.render_receipt();
},
......@@ -123,18 +124,6 @@ odoo.define('vracoop_pos_container_qrcode.container_print_qr', function (require
var url_qrcode = url_qr.concat(code_base36);
// var self = this;
// var get_image_deffered;
// get_image_deffered = this._convert_qr_img_to_base64(url_qrcode);
// return $.when.apply($, get_image_deffered).then(function(){
// return {
// widget: self,
// weight: self.weight,
// url_barcode: url_qrcode,
// barcode_base64: self.barcode_base64,
// }
// })
return {
widget: this,
weight: this.weight,
......@@ -143,31 +132,6 @@ odoo.define('vracoop_pos_container_qrcode.container_print_qr', function (require
},
_convert_qr_img_to_base64: function (url_qrcode) {
var deferred = new $.Deferred();
var img = new Image();
img.onload = function () {
var canvas = document.createElement('CANVAS');
var ctx = canvas.getContext('2d');
canvas.height = 200;
canvas.width = 200;
ctx.drawImage(img,0,0);
var dataURL = canvas.toDataURL('image/jpeg');
this.barcode_base64 = dataURL;
canvas = null;
deferred.resolve();
};
img.crossOrigin = 'use-credentials';
img.src = window.location.origin + "/report/barcode/?type=QR&value=" + url_qrcode + "&width=200&height=200";
return deferred;
},
renderElement: function() {
var self = this;
this._super();
......@@ -249,8 +213,34 @@ odoo.define('vracoop_pos_container_qrcode.container_print_qr', function (require
},
});
var ConfirmationScreen = screens.ScreenWidget.extend({
template: 'ConfirmationScreen',
next_screen: 'balancecontainerqr',
show: function(){
this._super();
var self = this;
setTimeout(function(){
self.gui.show_screen('balancecontainerqr');
}, 5000);
},
});
gui.define_screen({
'name': 'confirmation',
'widget': ConfirmationScreen,
'condition': function(){
return this.pos.config.is_print_container_qr;
},
});
// Add the Presentation to the GUI, and set it as the default screen
// Add the Balance print QR Code to the GUI, and set it as the default screen
chrome.Chrome.include({
build_widgets: function(){
this._super();
......
......@@ -105,4 +105,36 @@
</receipt>
</t>
<t t-name="ConfirmationScreen">
<div class="confirmation-screen screen">
<div class="pos-topheader-bal">
<div class="pos-header-custo">
<div class="">
<span class='button back'>
<i class='fa fa-angle-double-left'></i>
Retour
</span>
</div>
<div id="pos-header-text-confirm" class="pos-text oe_hidden">
<ul>
<li><span>1</span></li>
<li><span>2</span></li>
<li class="li-active"><span>3. Pesée confirmée</span></li>
</ul>
</div>
</div>
</div>
<div class="pos-bottom pos-bottom-confirm">
<div class="pos-confirm-screen">
<p class="text-center">Merci.<br/>
Vous pouvez passer en caisse</p>
<div class='back-presentation'>
<img class="logo-scan mb-3" src="/vracoop_pos_free_balance_v2/static/src/img/picto-confirm.png" />
</div>
</div>
</div>
</div>
</t>
</templates>
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter