Browse Source

Created ticket without price for Proxy 'XmlReceipt'

pull/496/head
Carlos Troyano 4 years ago
parent
commit
3e06d51602
  1. 16
      pos_ticket_without_price/static/src/js/screens.js
  2. 31
      pos_ticket_without_price/static/src/xml/pos.xml

16
pos_ticket_without_price/static/src/js/screens.js

@ -28,8 +28,14 @@ odoo.define('pos_ticket_without_price.screens', function (require) {
var button_print_ticket_without_price =
this.$('.button.print_ticket_without_price');
button_print_ticket_without_price.click(function () {
self.render_ticket_without_price();
self.print();
console.log("self.pos.config.iface_print_via_proxy")
console.log(self.pos.config.iface_print_via_proxy)
if (!self.pos.config.iface_print_via_proxy) {
self.render_ticket_without_price();
self.print();
} else {
self.proxy_render_ticket_without_price();
}
});
},
@ -40,6 +46,12 @@ odoo.define('pos_ticket_without_price.screens', function (require) {
this.get_receipt_render_env()));
},
proxy_render_ticket_without_price: function() {
var receipt = QWeb.render('XmlReceiptWithoutPrice', this.get_receipt_render_env());
this.pos.proxy.print_receipt(receipt);
this.pos.get_order()._printed = true;
},
});
});

31
pos_ticket_without_price/static/src/xml/pos.xml

@ -30,4 +30,35 @@
</t>
</t>
<t t-name="XmlReceiptWithoutPrice" t-extend="XmlReceipt">
<t t-jquery="t[t-if='receipt.company.logo']" t-operation="before">
<h1>TICKET WITHOUT PRICE</h1>
</t>
<t t-jquery="t[t-foreach='receipt.orderlines']" t-operation="replace">
<t t-foreach='receipt.orderlines' t-as='line'>
<value t-att-value-decimals='pos.dp["Product Unit of Measure"]' value-autoint='on'>
<t t-esc='line.quantity' />
</value>
x
<t t-esc='line.product_name_wrapped[0]' />
<br/>
</t>
</t>
<t t-jquery="t[t-set='taxincluded']" t-operation="replace" />
<t t-jquery="t[t-set='!taxincluded']" t-operation="replace" />
<t t-jquery="t[t-set='taxincluded']" t-operation="replace" />
<t t-jquery="line &gt; right" t-operation="replace" />
<t t-jquery="line &gt; left" t-operation="replace" />
<t t-jquery="line[class='total']" t-operation="replace" />
<t t-jquery="t[t-foreach='paymentlines']" t-operation="replace" />
<t t-jquery="line[size='double-height']" t-operation="replace" />
<t t-jquery="line[class='before-footer']" t-operation="replace" />
</t>
</templates>
Loading…
Cancel
Save