From f662d1058be68be49a2e1d4172caabac4c1ccb82 Mon Sep 17 00:00:00 2001 From: Frederic van der Essen Date: Tue, 30 Sep 2014 20:29:54 +0200 Subject: [PATCH] [IMP] pos_restaurant: adapt the splitbill UI to the new payment screen --- addons/point_of_sale/static/src/css/pos.css | 4 ++-- addons/point_of_sale/static/src/xml/pos.xml | 2 +- addons/pos_restaurant/static/src/js/splitbill.js | 16 +++------------- .../pos_restaurant/static/src/xml/splitbill.xml | 8 +++----- 4 files changed, 9 insertions(+), 21 deletions(-) diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index 6fd101cd0e8..e1db5e133df 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -1633,8 +1633,8 @@ td { .payment-screen .paymentmethods { margin: 16px; } -.splitbill-screen .paymentmethod, -.payment-screen .paymentmethod { +.splitbill-screen .paymentmethods .button, +.payment-screen .paymentmethods .button { background: rgb(221, 221, 221); line-height: 40px; margin-bottom: 4px; diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 2e668f7a08e..4b310d9656f 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -552,7 +552,7 @@
-
+
diff --git a/addons/pos_restaurant/static/src/js/splitbill.js b/addons/pos_restaurant/static/src/js/splitbill.js index 81591ccc589..e3d6b0810a9 100644 --- a/addons/pos_restaurant/static/src/js/splitbill.js +++ b/addons/pos_restaurant/static/src/js/splitbill.js @@ -76,7 +76,7 @@ function openerp_restaurant_splitbill(instance, module){ this.$('.order-info .subtotal').text(this.format_currency(neworder.getSubtotal())); }, - pay: function($el,order,neworder,splitlines,cashregister_id){ + pay: function(order,neworder,splitlines){ var orderlines = order.get('orderLines').models; var empty = true; var full = true; @@ -100,15 +100,8 @@ function openerp_restaurant_splitbill(instance, module){ return; } - for(var i = 0; i < this.pos.cashregisters.length; i++){ - if(this.pos.cashregisters[i].id === cashregister_id){ - var cashregister = this.pos.cashregisters[i]; - break; - } - } if(full){ - order.addPaymentline(cashregister); this.pos_widget.screen_selector.set_current_screen('payment'); }else{ for(var id in splitlines){ @@ -120,7 +113,6 @@ function openerp_restaurant_splitbill(instance, module){ } delete splitlines[id]; } - neworder.addPaymentline(cashregister); neworder.set_screen_data('screen','payment'); // for the kitchen printer we assume that everything @@ -159,10 +151,8 @@ function openerp_restaurant_splitbill(instance, module){ self.lineselect($el,order,neworder,splitlines,id); }); - this.$('.paymentmethod').click(function(){ - var id = parseInt($(this).data('id')); - var $el = $(this); - self.pay($el,order,neworder,splitlines,id); + this.$('.paymentmethods .button').click(function(){ + self.pay(order,neworder,splitlines); }); }, }); diff --git a/addons/pos_restaurant/static/src/xml/splitbill.xml b/addons/pos_restaurant/static/src/xml/splitbill.xml index e14f7ffef70..28d72de5e9a 100644 --- a/addons/pos_restaurant/static/src/xml/splitbill.xml +++ b/addons/pos_restaurant/static/src/xml/splitbill.xml @@ -74,11 +74,9 @@
- -
- -
-
+
+ Payment +