You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

26 lines
904 B

odoo.define('total_quantity_pos.OrderSummary', function(require) {
'use strict';
const OrderSummary = require('point_of_sale.OrderSummary');
const Registries = require('point_of_sale.Registries');
const QuantityChange = (OrderSummary) => class extends OrderSummary {
getTotal() {
// Get total number of items and quantities of
// products from the orderlines.
var result = super.getTotal(...arguments);
var total_items = this.props.order.orderlines.length;
let quant_count = 0;
let i = 0 ;
for( ; i < total_items; ){
quant_count += this.props.order.orderlines[i].quantity
i++;
}
this.props.total_quantity = quant_count;
return result;
}
}
Registries.Component.extend(OrderSummary, QuantityChange)
});