module.ProxyDevice = instance.web.Class.extend({
//a product has been scanned and recognized with success
- scan_item_succes: function(){
+ scan_item_success: function(){
console.log('PROXY: scan item success');
},
title: "Warning",
});
}else if(parse_result.type in {'unit':'', 'weight':'', 'price':''}){ //ean is associated to a product
- console.log('calling product callback');
if(self.action_callback['product']){
- console.log('found product callback');
self.action_callback['product'](parse_result);
}
//this.trigger("codebar",parse_result );
}else{
- console.log('calling callback:',parse_result.type);
if(self.action_callback[parse_result.type]){
- console.log('found callback');
self.action_callback[parse_result.type](parse_result);
}
}
},
initialize: function(attributes) {
this.pos = attributes.pos;
- console.log(attributes);
Backbone.Model.prototype.initialize.apply(this, arguments);
if(attributes.weight){
if(this.current_mode === 'client'){
this.set_current_screen(selectedOrder.get('client_screen') || this.default_client_screen);
}else if(this.current_mode === 'cashier'){
- console.log('default_cashier_screen:',this.default_cashier_screen);
this.set_current_screen(selectedOrder.get('cashier_screen') || this.default_cashier_screen);
}
this.selected_order = selectedOrder;
this.pos.barcode_reader.save_callbacks();
this.pos.barcode_reader.reset_action_callbacks();
- console.log('actionz callbacks zwave been resetses');
this.pos.barcode_reader.set_action_callbacks({
'cashier': function(ean){
clearInterval(this.intervalID);
return this.$element.find('#paymentlines');
},
back: function() {
- console.log('back');
this.pos.screen_selector.set_current_screen('products');
},
validateCurrentOrder: function() {
//FIXME this method is probably not at the right place ...
scan_product: function(parsed_ean){
var selectedOrder = this.pos.get('selectedOrder');
- var scannedProductModel = this.get_product_by_ean(parsed_ean.ean);
+ var scannedProductModel = this.get_product_by_ean(parsed_ean);
if (!scannedProductModel){
return false;
} else {