|
@@ -40,7 +40,10 @@ openerp.eiru_kitchen_ticket = function (instance) {
|
|
|
var resume = {};
|
|
|
var order = this.pos.get('selectedOrder');
|
|
|
order.get('orderLines').each(function(item){
|
|
|
+
|
|
|
+
|
|
|
var line = item.export_as_JSON();
|
|
|
+
|
|
|
if( typeof resume[line.product_id] === 'undefined'){
|
|
|
resume[line.product_id] = line.qty;
|
|
|
}else{
|
|
@@ -64,6 +67,7 @@ openerp.eiru_kitchen_ticket = function (instance) {
|
|
|
'id': product,
|
|
|
'name': this.pos.db.get_product_by_id(product).display_name,
|
|
|
'price': this.pos.db.get_product_by_id(product).price,
|
|
|
+ // 'product_pack_lines': this.pos.db.get_product_by_id(product).pack_lines,
|
|
|
'quantity': current[product],
|
|
|
});
|
|
|
}else if( old[product] < current[product]){
|
|
@@ -71,6 +75,7 @@ openerp.eiru_kitchen_ticket = function (instance) {
|
|
|
'id': product,
|
|
|
'name': this.pos.db.get_product_by_id(product).display_name,
|
|
|
'price': this.pos.db.get_product_by_id(product).price,
|
|
|
+ // 'product_pack_lines': this.pos.db.get_product_by_id(product).pack_lines,
|
|
|
'quantity': current[product] - old[product],
|
|
|
});
|
|
|
}else if( old[product] > current[product]){
|
|
@@ -78,6 +83,7 @@ openerp.eiru_kitchen_ticket = function (instance) {
|
|
|
'id': product,
|
|
|
'name': this.pos.db.get_product_by_id(product).display_name,
|
|
|
'price': this.pos.db.get_product_by_id(product).price,
|
|
|
+ // 'product_pack_lines': this.pos.db.get_product_by_id(product).pack_lines,
|
|
|
'quantity': old[product] - current[product],
|
|
|
});
|
|
|
}
|
|
@@ -89,6 +95,7 @@ openerp.eiru_kitchen_ticket = function (instance) {
|
|
|
'id': product,
|
|
|
'name': this.pos.db.get_product_by_id(product).display_name,
|
|
|
'price': this.pos.db.get_product_by_id(product).price,
|
|
|
+ // 'product_pack_lines': this.pos.db.get_product_by_id(product).pack_lines,
|
|
|
'quantity': old[product],
|
|
|
});
|
|
|
}
|
|
@@ -147,6 +154,22 @@ openerp.eiru_kitchen_ticket = function (instance) {
|
|
|
refresh: function() {
|
|
|
var self = this;
|
|
|
var order = self.pos.get('selectedOrder');
|
|
|
+ var categories = this.pos.printers[0].config.product_categories_ids;
|
|
|
+ var orderlines = order.get('orderLines').models;
|
|
|
+ var data = [];
|
|
|
+ _.each(orderlines, function(item){
|
|
|
+ for (var i = 0; i < categories.length; i++) {
|
|
|
+ if(item.product.pos_categ_id[0] == categories[i]){
|
|
|
+ data.push({
|
|
|
+ product_id: item.product.id,
|
|
|
+ product_name: item.product.display_name,
|
|
|
+ product_pack_lines: item.pack_lines,
|
|
|
+ product_qty: ' --> ' + item.quantity,
|
|
|
+ line_id: item.id,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
var place = order.export_as_JSON().table;
|
|
|
var floor = ' ';
|
|
|
var table = ' ';
|
|
@@ -162,6 +185,7 @@ openerp.eiru_kitchen_ticket = function (instance) {
|
|
|
filterLines: change.new,
|
|
|
floor: floor,
|
|
|
table: table,
|
|
|
+ kitchenlines: data,
|
|
|
}));
|
|
|
},
|
|
|
});
|