Przeglądaj źródła

Add cost per unit column to coffee purchase previous years comparison report

Neal Wilson 9 lat temu
rodzic
commit
753bd9b2aa
1 zmienionych plików z 11 dodań i 2 usunięć
  1. 11
    2
      config/Reports/fypurchase.xml

+ 11
- 2
config/Reports/fypurchase.xml Wyświetl plik

@@ -64,13 +64,21 @@
64 64
 				output.writeTextElement("th", "Sacks Purchased");
65 65
 				switch(unitBox.currentIndex) {
66 66
 					case 0:
67
-						output.writeTextElement("th", "Kilos Purchased");
67
+						output.writeTextElement("th", "Kg Purchased");
68 68
 						break;
69 69
 					case 1:
70
-						output.writeTextElement("th", "Pounds Purchased");
70
+						output.writeTextElement("th", "Lb Purchased");
71 71
 						break;
72 72
 				}
73 73
 				output.writeTextElement("th", "Cost");
74
+                                switch(unitBox.currentIndex) {
75
+                                    case 0:
76
+                                        output.writeTextElement("th", "Cost per Kg");
77
+                                        break;
78
+                                    case 1:
79
+                                        output.writeTextElement("th", "Cost per Lb");
80
+                                        break;
81
+                                }
74 82
 				output.writeEndElement(); //tr
75 83
 				output.writeEndElement(); //thead
76 84
 				output.writeStartElement("tbody");
@@ -102,6 +110,7 @@
102 110
 					sacktotal += Number(query.value(0));
103 111
 					unittotal += Number(query.value(1));
104 112
 					costtotal += Number(query.value(2));
113
+                                        output.writeTextElement("td", (Number(query.value(2))/Number(query.value(1))).toFixed(2));
105 114
 					output.writeEndElement(); //tr
106 115
 				}
107 116
 				query = query.invalidate();

Ładowanie…
Anuluj
Zapisz