|
@@ -17,7 +17,7 @@ openerp.eiru_kitchen_ticket = function (instance) {
|
|
var back_button = this.add_action_button({
|
|
var back_button = this.add_action_button({
|
|
label: _t('Back'),
|
|
label: _t('Back'),
|
|
icon: '/point_of_sale/static/src/img/icons/png48/go-previous.png',
|
|
icon: '/point_of_sale/static/src/img/icons/png48/go-previous.png',
|
|
- click: function(){
|
|
|
|
|
|
+ click: function(){
|
|
self.back();
|
|
self.back();
|
|
},
|
|
},
|
|
});
|
|
});
|
|
@@ -63,18 +63,21 @@ openerp.eiru_kitchen_ticket = function (instance) {
|
|
add.push({
|
|
add.push({
|
|
'id': product,
|
|
'id': product,
|
|
'name': this.pos.db.get_product_by_id(product).display_name,
|
|
'name': this.pos.db.get_product_by_id(product).display_name,
|
|
|
|
+ 'price': this.pos.db.get_product_by_id(product).price,
|
|
'quantity': current[product],
|
|
'quantity': current[product],
|
|
});
|
|
});
|
|
}else if( old[product] < current[product]){
|
|
}else if( old[product] < current[product]){
|
|
add.push({
|
|
add.push({
|
|
'id': product,
|
|
'id': product,
|
|
'name': this.pos.db.get_product_by_id(product).display_name,
|
|
'name': this.pos.db.get_product_by_id(product).display_name,
|
|
|
|
+ 'price': this.pos.db.get_product_by_id(product).price,
|
|
'quantity': current[product] - old[product],
|
|
'quantity': current[product] - old[product],
|
|
});
|
|
});
|
|
}else if( old[product] > current[product]){
|
|
}else if( old[product] > current[product]){
|
|
rem.push({
|
|
rem.push({
|
|
'id': product,
|
|
'id': product,
|
|
'name': this.pos.db.get_product_by_id(product).display_name,
|
|
'name': this.pos.db.get_product_by_id(product).display_name,
|
|
|
|
+ 'price': this.pos.db.get_product_by_id(product).price,
|
|
'quantity': old[product] - current[product],
|
|
'quantity': old[product] - current[product],
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -85,7 +88,8 @@ openerp.eiru_kitchen_ticket = function (instance) {
|
|
rem.push({
|
|
rem.push({
|
|
'id': product,
|
|
'id': product,
|
|
'name': this.pos.db.get_product_by_id(product).display_name,
|
|
'name': this.pos.db.get_product_by_id(product).display_name,
|
|
- 'quantity': old[product],
|
|
|
|
|
|
+ 'price': this.pos.db.get_product_by_id(product).price,
|
|
|
|
+ 'quantity': old[product],
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -107,7 +111,7 @@ openerp.eiru_kitchen_ticket = function (instance) {
|
|
|
|
|
|
var _add = [];
|
|
var _add = [];
|
|
var _rem = [];
|
|
var _rem = [];
|
|
-
|
|
|
|
|
|
+
|
|
for(var i = 0; i < add.length; i++){
|
|
for(var i = 0; i < add.length; i++){
|
|
if(product_in_category(add[i].id)){
|
|
if(product_in_category(add[i].id)){
|
|
_add.push(add[i]);
|
|
_add.push(add[i]);
|
|
@@ -139,7 +143,7 @@ openerp.eiru_kitchen_ticket = function (instance) {
|
|
}
|
|
}
|
|
return false;
|
|
return false;
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+
|
|
refresh: function() {
|
|
refresh: function() {
|
|
var self = this;
|
|
var self = this;
|
|
var order = self.pos.get('selectedOrder');
|
|
var order = self.pos.get('selectedOrder');
|
|
@@ -148,7 +152,7 @@ openerp.eiru_kitchen_ticket = function (instance) {
|
|
var table = ' ';
|
|
var table = ' ';
|
|
if(place != undefined){
|
|
if(place != undefined){
|
|
var floor = order.export_as_JSON().table.floor_id[1];
|
|
var floor = order.export_as_JSON().table.floor_id[1];
|
|
- var table = order.export_as_JSON().table.name;
|
|
|
|
|
|
+ var table = order.export_as_JSON().table.name;
|
|
}
|
|
}
|
|
var change = self.computeChanges();
|
|
var change = self.computeChanges();
|
|
$('.pos-receipt-container', this.$el).html(QWeb.render('KitchenTicket',{
|
|
$('.pos-receipt-container', this.$el).html(QWeb.render('KitchenTicket',{
|