summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorFrederic van der Essen <fva@openerp.com / fvdessen+o@gmail.com>2014-11-17 15:37:21 +0100
committerFrédéric van der Essen <fvdessen@gmail.com>2014-11-26 12:11:57 +0100
commit301ba1b4e40e1084c2b2acba804853ae200bb6f3 (patch)
tree62d451ae847dbb7df9e84909db974f5e0cfd797f /addons
parent7f40375f6b1c4a6b92595be910f80cbc06fbb12e (diff)
[IMP] pos_restaurant: add table information to the bill and the payment receipt
Diffstat (limited to 'addons')
-rw-r--r--addons/point_of_sale/static/src/xml/pos.xml6
-rw-r--r--addons/pos_restaurant/static/src/js/floors.js6
-rw-r--r--addons/pos_restaurant/static/src/js/printbill.js2
-rw-r--r--addons/pos_restaurant/static/src/xml/floors.xml16
-rw-r--r--addons/pos_restaurant/static/src/xml/printbill.xml6
5 files changed, 31 insertions, 5 deletions
diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml
index 7861a90fb4c..d74ca50a202 100644
--- a/addons/point_of_sale/static/src/xml/pos.xml
+++ b/addons/point_of_sale/static/src/xml/pos.xml
@@ -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 />
diff --git a/addons/pos_restaurant/static/src/js/floors.js b/addons/pos_restaurant/static/src/js/floors.js
index 39534f4ac35..0e1e0253f54 100644
--- a/addons/pos_restaurant/static/src/js/floors.js
+++ b/addons/pos_restaurant/static/src/js/floors.js
@@ -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
diff --git a/addons/pos_restaurant/static/src/js/printbill.js b/addons/pos_restaurant/static/src/js/printbill.js
index ce79416e8b5..c8bfc8ec93e 100644
--- a/addons/pos_restaurant/static/src/js/printbill.js
+++ b/addons/pos_restaurant/static/src/js/printbill.js
@@ -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',{
diff --git a/addons/pos_restaurant/static/src/xml/floors.xml b/addons/pos_restaurant/static/src/xml/floors.xml
index ba90d433f56..dc8ba35eccb 100644
--- a/addons/pos_restaurant/static/src/xml/floors.xml
+++ b/addons/pos_restaurant/static/src/xml/floors.xml
@@ -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()'>
diff --git a/addons/pos_restaurant/static/src/xml/printbill.xml b/addons/pos_restaurant/static/src/xml/printbill.xml
index 111251c1856..7bceefb05e6 100644
--- a/addons/pos_restaurant/static/src/xml/printbill.xml
+++ b/addons/pos_restaurant/static/src/xml/printbill.xml
@@ -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 />