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.
28 lines
1.1 KiB
28 lines
1.1 KiB
odoo.define('total_quantity_pos.QuantityChange', function(require) {
|
|
'use strict';
|
|
|
|
const OrderSummary = require('point_of_sale.OrderSummary');
|
|
const Registries = require('point_of_sale.Registries');
|
|
|
|
const QuantityChange = OrderSummary =>
|
|
class extends OrderSummary {
|
|
//For getting the total items in the product screen
|
|
get total_items() {
|
|
var total_items = this.env.pos.get_order().orderlines.length;
|
|
return total_items;
|
|
}
|
|
//For getting the total count of products in the product screen
|
|
get quant_count() {
|
|
var total_items = this.env.pos.get_order().orderlines.length;
|
|
let quant_count = 0;
|
|
let i = 0;
|
|
for (; i < total_items;) {
|
|
quant_count += this.env.pos.get_order().orderlines.models[i].quantity;
|
|
i++;
|
|
}
|
|
return quant_count;
|
|
}
|
|
};
|
|
Registries.Component.extend(OrderSummary, QuantityChange);
|
|
return QuantityChange;
|
|
});
|
|
|