我想打印模板PosTicket之前支付它(票的预览),我尝试了模块的PosTicket,但不起作用,有什么建议吗?谢谢。
发布于 2018-04-10 17:20:18
使用以下代码创建js
/* Button Widget */
var PrintBillButtonTicket = screens.ActionButtonWidget.extend({
template: 'PrintBillButtonTicket',
print_xml: function(){
var order = this.pos.get('selectedOrder');
if(order.get_orderlines().length > 0){
var receipt = order.export_for_printing();
receipt.bill = true;
this.$('.pos-receipt-container').html(QWeb.render('PosTicket',{
widget:this,
order: order,
receipt: order.export_for_printing(),
orderlines: order.get_orderlines(),
paymentlines: order.get_paymentlines(),
}));
}
},
button_click: function(){
this.print_xml();
},
});
screens.define_action_button({
'name': 'print_billticket',
'widget': PrintBillButtonTicket,
});在下面添加XML文件
<t t-name="PrintBillButtonTicket">
<span class="control-button order-printbillticket">
<i class="fa fa-print"></i>
Bill Print
</span>
</t>https://stackoverflow.com/questions/49758886
复制相似问题