diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index d693c3f15cb..3a6353991ab 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -1003,7 +1003,7 @@
-
+
CHANGE
diff --git a/addons/pos_restaurant/static/src/js/printbill.js b/addons/pos_restaurant/static/src/js/printbill.js index 233e25c757f..88966c72ec1 100644 --- a/addons/pos_restaurant/static/src/js/printbill.js +++ b/addons/pos_restaurant/static/src/js/printbill.js @@ -15,35 +15,30 @@ var BillScreenWidget = screens.ReceiptScreenWidget.extend({ click_back: function(){ this.gui.show_screen('products'); }, + get_receipt_render_env: function(){ + var render_env = this._super(); + render_env.receipt.bill = true; + return render_env; + }, render_receipt: function(){ this._super(); - this.$('.receipt-paymentlines').remove(); this.$('.receipt-change').remove(); }, - print_web: function(){ - window.print(); - }, }); gui.define_screen({name:'bill', widget: BillScreenWidget}); var PrintBillButton = screens.ActionButtonWidget.extend({ template: 'PrintBillButton', - print_html: function(){ - var order = this.pos.get('selectedOrder'); - if(order.get_orderlines().length > 0){ - var receipt = order.export_for_printing(); - receipt.bill = true; - this.pos.proxy.printer.print_receipt(QWeb.render('BillReceipt',{ - receipt: receipt, widget: this, pos: this.pos, order: order, - })); - } - }, button_click: function(){ - if (!this.pos.config.iface_print_via_proxy) { + var order = this.pos.get('selectedOrder'); + if(order.get_orderlines().length > 0) { this.gui.show_screen('bill'); } else { - this.print_html(); + this.gui.show_popup('error', { + 'title': _t('Nothing to Print'), + 'body': _t('There is no order lines'), + }); } }, }); @@ -51,12 +46,12 @@ var PrintBillButton = screens.ActionButtonWidget.extend({ screens.define_action_button({ 'name': 'print_bill', 'widget': PrintBillButton, - 'condition': function(){ + 'condition': function(){ return this.pos.config.iface_printbill; }, }); return { BillScreenWidget: BillScreenWidget, PrintBillButton: PrintBillButton, -} +}; }); diff --git a/addons/pos_restaurant/static/src/xml/printbill.xml b/addons/pos_restaurant/static/src/xml/printbill.xml index 3e64f249bf3..47fe78fd44f 100644 --- a/addons/pos_restaurant/static/src/xml/printbill.xml +++ b/addons/pos_restaurant/static/src/xml/printbill.xml @@ -33,135 +33,12 @@ - -
- - -
+ + + +
PRO FORMA
- -

- -

-
-
-
- -
-
- -
Tel:
-
- -
:
-
- -
-
- -
-
- -
-
- -
-
--------------------------------
-
Served by
-
-
-
-

- - - -
- - - -
- - -
-
- -
- -
Discount: %
-
-
- - - - - x - - -
-
-
-
- - - - -
--------
-
-
Subtotal
- -
- - -
-
-
- - - -
--------
-
-
- TOTAL - -
-

- - - - -
- Discounts - -
-
- - -
- - -
-
-
- - - - - - - -
- -
-
-
- -
-
-
-
-
- -
+