/* c) The receipt screen */
+.pos .receipt-screen .centered-content .button {
+ line-height: 32px;
+ padding: 3px 13px;
+ font-size: 20px;
+ background: rgb(230, 230, 230);
+ margin: 12px;
+ border-radius: 3px;
+ border: solid 1px rgb(209, 209, 209);
+ cursor: pointer;
+}
.pos .pos-receipt-container {
font-size: 0.75em;
+ text-align: center;
}
.pos .pos-sale-ticket {
}
@media print {
+ body {
+ margin: 0;
+ }
.oe_leftbar,
.pos .pos-topheader,
.pos .pos-leftpane,
- .pos .keyboard_frame {
+ .pos .keyboard_frame,
+ .pos .receipt-screen header,
+ .pos .receipt-screen .top-content,
+ .pos .receipt-screen .centered-content .button {
display: none !important;
}
.pos,
left: 0px !important;
background-color: white;
}
- .pos .receipt-screen header {
- display: none !important;
- }
.pos .receipt-screen {
text-align: left;
}
+ .pos .receipt-screen .centered-content{
+ position: static;
+ border: none;
+ margin: none;
+ }
+ .pos .pos-receipt-container {
+ text-align: left;
+ }
.pos-actionbar {
display: none !important;
}
this._super();
var self = this;
- var print_button = this.add_action_button({
- label: _t('Print'),
- icon: '/point_of_sale/static/src/img/icons/png48/printer.png',
- click: function(){ self.print(); },
- });
-
- var finish_button = this.add_action_button({
- label: _t('Next Order'),
- icon: '/point_of_sale/static/src/img/icons/png48/go-next.png',
- click: function() { self.finishOrder(); },
- });
-
this.refresh();
this.print();
- //
// The problem is that in chrome the print() is asynchronous and doesn't
// execute until all rpc are finished. So it conflicts with the rpc used
// to send the orders to the backend, and the user is able to go to the next
// 2 seconds is the same as the default timeout for sending orders and so the dialog
// should have appeared before the timeout... so yeah that's not ultra reliable.
- finish_button.set_disabled(true);
+ this.lock_screen(true);
setTimeout(function(){
- finish_button.set_disabled(false);
+ self.lock_screen(false);
}, 2000);
},
+ lock_screen: function(locked) {
+ this._locked = locked;
+ if (locked) {
+ this.$('.next').removeClass('highlight');
+ } else {
+ this.$('.next').addClass('highlight');
+ }
+ },
print: function() {
window.print();
},
- finishOrder: function() {
- this.pos.get('selectedOrder').destroy();
+ finish_order: function() {
+ if (!this._locked) {
+ this.pos.get_order().finalize();
+ }
+ },
+ renderElement: function() {
+ var self = this;
+ this._super();
+ this.$('.next').click(function(){
+ self.finish_order();
+ });
+ this.$('.button.print').click(function(){
+ self.print();
+ });
},
refresh: function() {
- var order = this.pos.get('selectedOrder');
- $('.pos-receipt-container', this.$el).html(QWeb.render('PosTicket',{
+ var order = this.pos.get_order();
+ this.$('.pos-receipt-container').html(QWeb.render('PosTicket',{
widget:this,
order: order,
orderlines: order.get('orderLines').models,
paymentlines: order.get('paymentLines').models,
}));
},
- close: function(){
- this._super();
- }
});
-
module.PaymentScreenWidget = module.ScreenWidget.extend({
template: 'PaymentScreenWidget',
back_screen: 'product',
</t>
<t t-name="ReceiptScreenWidget">
- <div class="receipt-screen screen touch-scrollable" >
- <div class="pos-step-container">
- <div class="pos-receipt-container">
+ <div class='receipt-screen screen'>
+ <div class='screen-content'>
+ <div class='top-content'>
+ <h1>Receipt</h1>
+ <span class='button next'>
+ Next Order
+ <i class='fa fa-angle-double-right'></i>
+ </span>
+ </div>
+ <div class="centered-content">
+ <div class="button print">
+ <i class='fa fa-print'></i> Print
+ </div>
+ <div class="pos-receipt-container">
+ </div>
</div>
</div>
</div>