[IMP] pos_restaurant: add table information to the bill and the payment receipt
This commit is contained in:
committed by
Frédéric van der Essen
parent
7f40375f6b
commit
301ba1b4e4
@@ -667,8 +667,10 @@
|
||||
<div><t t-esc='receipt.header' /></div>
|
||||
</t>
|
||||
<t t-if='receipt.cashier'>
|
||||
<div>--------------------------------</div>
|
||||
<div>Served by <t t-esc='receipt.cashier' /></div>
|
||||
<div class='cashier'>
|
||||
<div>--------------------------------</div>
|
||||
<div>Served by <t t-esc='receipt.cashier' /></div>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
<br /><br />
|
||||
|
||||
@@ -615,6 +615,12 @@ function openerp_restaurant_floors(instance,module){
|
||||
this.table = this.pos.tables_by_id[json.table_id];
|
||||
this.floor = this.table ? this.pos.floors_by_id[json.floor_id] : undefined;
|
||||
},
|
||||
export_for_printing: function() {
|
||||
var json = _super_order.export_for_printing.apply(this,arguments);
|
||||
json.table = this.table ? this.table.name : undefined;
|
||||
json.floor = this.table ? this.table.floor.name : undefined;
|
||||
return json;
|
||||
},
|
||||
});
|
||||
|
||||
// We need to modify the OrderSelector to hide itself when we're on
|
||||
|
||||
@@ -12,7 +12,7 @@ function openerp_restaurant_printbill(instance,module){
|
||||
|
||||
printbill.click(function(){
|
||||
var order = self.pos.get('selectedOrder');
|
||||
if(order.get('orderLines').models.length > 0){
|
||||
if(order.get_orderlines().length > 0){
|
||||
var receipt = order.export_for_printing();
|
||||
receipt.bill = true;
|
||||
self.pos.proxy.print_receipt(QWeb.render('BillReceipt',{
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
|
||||
<t t-extend="XmlReceipt">
|
||||
<t t-jquery='.cashier' t-operation='append'>
|
||||
<t t-if='receipt.table'>
|
||||
at table <t t-esc='receipt.table' />
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
<t t-extend="BillReceipt">
|
||||
<t t-jquery='.cashier' t-operation='append'>
|
||||
<t t-if='receipt.table'>
|
||||
at table <t t-esc='receipt.table' />
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
<t t-name="TableWidget">
|
||||
<t t-if='!widget.selected'>
|
||||
<div class='table' t-att-style='widget.table_style_str()'>
|
||||
|
||||
@@ -41,8 +41,10 @@
|
||||
<div><t t-esc='receipt.header' /></div>
|
||||
</t>
|
||||
<t t-if='receipt.cashier'>
|
||||
<div>--------------------------------</div>
|
||||
<div>Served by <t t-esc='receipt.cashier' /></div>
|
||||
<div class='cashier'>
|
||||
<div>--------------------------------</div>
|
||||
<div>Served by <t t-esc='receipt.cashier' /></div>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
<br /><br />
|
||||
|
||||
Reference in New Issue
Block a user