[IMP] pos_restaurant: adapt the splitbill UI to the new payment screen
authorFrederic van der Essen <fva@openerp.com / fvdessen+o@gmail.com>
Tue, 30 Sep 2014 18:29:54 +0000 (20:29 +0200)
committerFrédéric van der Essen <fvdessen@gmail.com>
Tue, 25 Nov 2014 18:14:39 +0000 (19:14 +0100)
addons/point_of_sale/static/src/css/pos.css
addons/point_of_sale/static/src/xml/pos.xml
addons/pos_restaurant/static/src/js/splitbill.js
addons/pos_restaurant/static/src/xml/splitbill.xml

index 6fd101c..e1db5e1 100644 (file)
@@ -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;
index 2e668f7..4b310d9 100644 (file)
     <t t-name="PaymentScreen-Paymentmethods">
         <div class='paymentmethods'>
             <t t-foreach="widget.pos.cashregisters" t-as="cashregister">
-                <div class="paymentmethod" t-att-data-id="cashregister.journal_id[0]">
+                <div class="button paymentmethod" t-att-data-id="cashregister.journal_id[0]">
                     <t t-esc="cashregister.journal_id[1]" />
                 </div>
             </t>
index 81591cc..e3d6b08 100644 (file)
@@ -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);
             });
         },
     });
index e14f7ff..28d72de 100644 (file)
                         <span class='subtotal'><t t-esc='widget.format_currency(0.0)'/></span>
                     </div>
                     <div class='paymentmethods'>
-                        <t t-foreach="widget.pos.cashregisters" t-as="cashregister">
-                            <div class='button paymentmethod' t-att-data-id="cashregister.id">
-                                <t t-esc='cashregister.journal.name' />
-                            </div>
-                        </t>
+                        <div class='button payment'>
+                            <i class='fa fa-chevron-right' /> Payment
+                        </div>
                     </div>
                 </div>
             </div>