|
@@ -45,17 +45,25 @@ function pos_ticket_model(instance, module){
|
|
|
},
|
|
|
refresh: function() {
|
|
|
var order = this.pos.get('selectedOrder');
|
|
|
- console.log(order);
|
|
|
+ var orderLines = order.get('orderLines').models;
|
|
|
+ // console.log(orderLines);
|
|
|
+ var qty = _.reduce(_.map(orderLines,function(item){
|
|
|
+ return item.quantity;
|
|
|
+ }), function(memo, num){
|
|
|
+ return memo + num;
|
|
|
+ },0);
|
|
|
+ // console.log(total);
|
|
|
$('.pos-receipt-container', this.$el).html(QWeb.render('PosTicket',{
|
|
|
widget:this,
|
|
|
order: order,
|
|
|
orderlines: order.get('orderLines').models,
|
|
|
paymentlines: order.get('paymentLines').models,
|
|
|
- logo: order.pos.company_logo_base64
|
|
|
+ logo: order.pos.company_logo_base64,
|
|
|
+ quantity: qty,
|
|
|
}));
|
|
|
},
|
|
|
close: function(){
|
|
|
this._super();
|
|
|
}
|
|
|
});
|
|
|
-};
|
|
|
+}
|