[Fix] Pos bugs (#16256)

* Remove hard-coded values

* Fix change pos profile + add campaign

* Test case for coveralls

* Remove unnecessary method
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index f3ec775..6072fb8 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -324,7 +324,8 @@
 			return {
 				"print_format": print_format,
 				"allow_edit_rate": pos.get("allow_user_to_edit_rate"),
-				"allow_edit_discount": pos.get("allow_user_to_edit_discount")
+				"allow_edit_discount": pos.get("allow_user_to_edit_discount"),
+				"campaign": pos.get("campaign")
 			}
 
 	def update_time_sheet(self, sales_invoice):
diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
index 68cc500..f9364e2 100644
--- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
 # License: GNU General Public License v3. See license.txt
 from __future__ import unicode_literals
 
@@ -762,6 +762,20 @@
 		set_perpetual_inventory(0)
 
 		frappe.db.sql("delete from `tabPOS Profile`")
+	
+	def test_pos_si_without_payment(self):
+		set_perpetual_inventory()
+		make_pos_profile()
+
+		pos = copy.deepcopy(test_records[1])
+		pos["is_pos"] = 1
+		pos["update_stock"] = 1
+
+		si = frappe.copy_doc(pos)
+		si.insert()
+
+		# Check that the invoice cannot be submitted without payments
+		self.assertRaises(frappe.ValidationError, si.submit)
 
 	def test_sales_invoice_gl_entry_with_perpetual_inventory_no_item_code(self):
 		set_perpetual_inventory()
diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js
index 91f3711..04c8718 100755
--- a/erpnext/accounts/page/pos/pos.js
+++ b/erpnext/accounts/page/pos/pos.js
@@ -1135,16 +1135,18 @@
 	},
 
 	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() {