|
@ -199,9 +199,9 @@ openerp.pos_customer_display = function(instance){ |
|
|
return res; |
|
|
return res; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
var _super_update_payment_summary_ = module.PaymentScreenWidget.prototype.update_payment_summary; |
|
|
|
|
|
module.PaymentScreenWidget.prototype.update_payment_summary = function(){ |
|
|
|
|
|
res = _super_update_payment_summary_.call(this); |
|
|
|
|
|
|
|
|
module.PaymentScreenWidget.include({ |
|
|
|
|
|
update_payment_summary: function(){ |
|
|
|
|
|
res = this._super(); |
|
|
var currentOrder = this.pos.get('selectedOrder'); |
|
|
var currentOrder = this.pos.get('selectedOrder'); |
|
|
var paidTotal = currentOrder.getPaidTotal(); |
|
|
var paidTotal = currentOrder.getPaidTotal(); |
|
|
var dueTotal = currentOrder.getTotalTaxIncluded(); |
|
|
var dueTotal = currentOrder.getTotalTaxIncluded(); |
|
@ -211,39 +211,40 @@ openerp.pos_customer_display = function(instance){ |
|
|
this.pos.prepare_text_customer_display('update_payment', {'change': change_rounded}); |
|
|
this.pos.prepare_text_customer_display('update_payment', {'change': change_rounded}); |
|
|
} |
|
|
} |
|
|
return res; |
|
|
return res; |
|
|
}; |
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
var _super_closePOS_ = module.PosWidget.prototype.close; |
|
|
|
|
|
module.PosWidget.prototype.close = function(){ |
|
|
|
|
|
|
|
|
module.PosWidget.include({ |
|
|
|
|
|
close: function(){ |
|
|
|
|
|
this._super(); |
|
|
this.pos.prepare_text_customer_display('closePOS', {}); |
|
|
this.pos.prepare_text_customer_display('closePOS', {}); |
|
|
return _super_closePOS_.call(this); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
var _super_proxy_start_ = module.ProxyStatusWidget.prototype.start; |
|
|
|
|
|
module.ProxyStatusWidget.prototype.start = function(){ |
|
|
|
|
|
res = _super_proxy_start_.call(this); |
|
|
|
|
|
|
|
|
module.ProxyStatusWidget.include({ |
|
|
|
|
|
start: function(){ |
|
|
|
|
|
this._super(); |
|
|
this.pos.prepare_text_customer_display('openPOS', {}); |
|
|
this.pos.prepare_text_customer_display('openPOS', {}); |
|
|
return res; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
/* Handle Button "Display Total to Customer" */ |
|
|
/* Handle Button "Display Total to Customer" */ |
|
|
var _super_OrderWidget_init_ = module.OrderWidget.prototype.init; |
|
|
|
|
|
module.OrderWidget.prototype.init = function(parent, options){ |
|
|
|
|
|
_super_OrderWidget_init_.call(this, parent, options); |
|
|
|
|
|
|
|
|
/* TODO: understand why Odoo sends the prepare_text_customer_display |
|
|
|
|
|
3 times to the Posbox/LCD when the user clicks on the button |
|
|
|
|
|
'Show total to customer' */ |
|
|
|
|
|
module.OrderWidget.include({ |
|
|
|
|
|
update_summary: function(){ |
|
|
|
|
|
console.log('MY update_summary'); |
|
|
|
|
|
this._super(); |
|
|
var self = this; |
|
|
var self = this; |
|
|
this.prepare_text_customer_display = function(event){ |
|
|
|
|
|
self.pos.prepare_text_customer_display('addPaymentline', {}); |
|
|
|
|
|
event.stopPropagation(); |
|
|
|
|
|
}; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var _super_update_summary_ = module.OrderWidget.prototype.update_summary; |
|
|
|
|
|
module.OrderWidget.prototype.update_summary = function(){ |
|
|
|
|
|
_super_update_summary_.call(this); |
|
|
|
|
|
if (this.pos.config.iface_customer_display){ |
|
|
if (this.pos.config.iface_customer_display){ |
|
|
|
|
|
console.log('.addEventListener'); |
|
|
this.el.querySelector('.show-total-to-customer') |
|
|
this.el.querySelector('.show-total-to-customer') |
|
|
.addEventListener('click', this.prepare_text_customer_display); |
|
|
|
|
|
|
|
|
.removeEventListener('click', function(){self.pos.prepare_text_customer_display('addPaymentline', {})}); |
|
|
|
|
|
this.el.querySelector('.show-total-to-customer') |
|
|
|
|
|
.addEventListener('click', function(){self.pos.prepare_text_customer_display('addPaymentline', {})}); |
|
|
} |
|
|
} |
|
|
}; |
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
}; |
|
|
}; |