[IMP] pos_restaurant: adapt the splitbill UI to the new payment screen
This commit is contained in:
committed by
Frédéric van der Essen
parent
b2b471f461
commit
f662d1058b
@@ -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;
|
||||
|
||||
@@ -552,7 +552,7 @@
|
||||
<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>
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -74,11 +74,9 @@
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user