[Fix] Pos bugs (#16256)

* Remove hard-coded values

* Fix change pos profile + add campaign

* Test case for coveralls

* Remove unnecessary method
This commit is contained in:
Charles-Henri Decultot
2018-12-24 10:09:30 +01:00
committed by Rushabh Mehta
parent 4265c5a772
commit 052033a76e
4 changed files with 47 additions and 23 deletions

View File

@@ -1135,16 +1135,18 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
},
apply_category: function() {
var me = this;
category = this.selected_item_group || "All Item Groups";
frappe.db.get_value("Item Group", {lft: 1, is_group: 1}, "name", (r) => {
category = this.selected_item_group || r.name;
if(category == 'All Item Groups') {
return this.item_data
} else {
return this.item_data.filter(function(element, index, array){
return element.item_group == category;
});
}
if(category == r.name) {
return this.item_data
} else {
return this.item_data.filter(function(element, index, array){
return element.item_group == category;
});
}
})
},
bind_items_event: function() {