浏览代码

Add Kg to inventory update options

Neal Wilson 9 年前
父节点
当前提交
ae4a3fbffb
共有 1 个文件被更改,包括 11 次插入3 次删除
  1. 11
    3
      config/Windows/greeninventory.xml

+ 11
- 3
config/Windows/greeninventory.xml 查看文件

@@ -15,6 +15,7 @@
15 15
 			var units = findChildObject(this, 'units');
16 16
 			units.addItem("bag");
17 17
 			units.addItem("lb");
18
+			units.addItem("kg");
18 19
 			var items = findChildObject(this, 'item');
19 20
 			var status = findChildObject(this, 'current');
20 21
 			var q = "SELECT quantity FROM items WHERE id = ";
@@ -25,7 +26,9 @@
25 26
 			var text = items.currentText;
26 27
 			text = text + " Current inventory: ";
27 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 32
 			q = "SELECT ";
30 33
 			q = q + query.value(0);
31 34
 			q = q + " / (SELECT conversion FROM lb_bag_conversion WHERE item = ";
@@ -45,7 +48,10 @@
45 48
 				q = q + ", ";
46 49
 				if(units.currentText == "lb") {
47 50
 					q = q + value.text;
48
-				} else {
51
+				} else if (units.currentText == "kg") {
52
+					q = q + (value.text * 2.2);
53
+				}
54
+				else {
49 55
 					q = q + value.text;
50 56
 					q = q + " * (SELECT conversion FROM lb_bag_conversion WHERE item = ";
51 57
 					q = q + items.currentData();
@@ -83,7 +89,9 @@
83 89
 				var text = items.currentText;
84 90
 				text = text + " Current inventory: ";
85 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 95
 				q = "SELECT ";
88 96
 				q = q + query.value(0);
89 97
 				q = q + " / (SELECT conversion FROM lb_bag_conversion WHERE item = ";

正在加载...
取消
保存