Browse Source

Add Kg to inventory update options

Neal Wilson 9 years ago
parent
commit
ae4a3fbffb
1 changed files with 11 additions and 3 deletions
  1. 11
    3
      config/Windows/greeninventory.xml

+ 11
- 3
config/Windows/greeninventory.xml View File

15
 			var units = findChildObject(this, 'units');
15
 			var units = findChildObject(this, 'units');
16
 			units.addItem("bag");
16
 			units.addItem("bag");
17
 			units.addItem("lb");
17
 			units.addItem("lb");
18
+			units.addItem("kg");
18
 			var items = findChildObject(this, 'item');
19
 			var items = findChildObject(this, 'item');
19
 			var status = findChildObject(this, 'current');
20
 			var status = findChildObject(this, 'current');
20
 			var q = "SELECT quantity FROM items WHERE id = ";
21
 			var q = "SELECT quantity FROM items WHERE id = ";
25
 			var text = items.currentText;
26
 			var text = items.currentText;
26
 			text = text + " Current inventory: ";
27
 			text = text + " Current inventory: ";
27
 			text = text + query.value(0);
28
 			text = text + query.value(0);
28
-			text = text + " pounds (";
29
+			text = text + " pounds ("
30
+			text = text + Number(query.value(0)) / 2.2;
31
+			text = text + " Kg (";
29
 			q = "SELECT ";
32
 			q = "SELECT ";
30
 			q = q + query.value(0);
33
 			q = q + query.value(0);
31
 			q = q + " / (SELECT conversion FROM lb_bag_conversion WHERE item = ";
34
 			q = q + " / (SELECT conversion FROM lb_bag_conversion WHERE item = ";
45
 				q = q + ", ";
48
 				q = q + ", ";
46
 				if(units.currentText == "lb") {
49
 				if(units.currentText == "lb") {
47
 					q = q + value.text;
50
 					q = q + value.text;
48
-				} else {
51
+				} else if (units.currentText == "kg") {
52
+					q = q + (value.text * 2.2);
53
+				}
54
+				else {
49
 					q = q + value.text;
55
 					q = q + value.text;
50
 					q = q + " * (SELECT conversion FROM lb_bag_conversion WHERE item = ";
56
 					q = q + " * (SELECT conversion FROM lb_bag_conversion WHERE item = ";
51
 					q = q + items.currentData();
57
 					q = q + items.currentData();
83
 				var text = items.currentText;
89
 				var text = items.currentText;
84
 				text = text + " Current inventory: ";
90
 				text = text + " Current inventory: ";
85
 				text = text + query.value(0);
91
 				text = text + query.value(0);
86
-				text = text + " pounds (";
92
+				text = text + " pounds ";
93
+				text = text + Number(query.value(0)) / 2.2;
94
+				text = text + " Kg (";
87
 				q = "SELECT ";
95
 				q = "SELECT ";
88
 				q = q + query.value(0);
96
 				q = q + query.value(0);
89
 				q = q + " / (SELECT conversion FROM lb_bag_conversion WHERE item = ";
97
 				q = q + " / (SELECT conversion FROM lb_bag_conversion WHERE item = ";

Loading…
Cancel
Save