Browse Source

Mark for translation: fypurchase.xml

Neal Wilson 9 years ago
parent
commit
88ebed5740
1 changed files with 16 additions and 13 deletions
  1. 16
    13
      config/Reports/fypurchase.xml

+ 16
- 13
config/Reports/fypurchase.xml View File

14
 	</menu>
14
 	</menu>
15
 	<program>
15
 	<program>
16
 		<![CDATA[
16
 		<![CDATA[
17
-			this.windowTitle = "Typica - Coffee Purchase Previous Years Comparison";
17
+			this.windowTitle = TTR("fypurchase", "Typica - Coffee Purchase Previous Years Comparison");
18
 			/* Set Lifetime range. */
18
 			/* Set Lifetime range. */
19
 			var dateSelect = findChildObject(this, 'dates');
19
 			var dateSelect = findChildObject(this, 'dates');
20
 			var query = new QSqlQuery();
20
 			var query = new QSqlQuery();
33
 			});
33
 			});
34
 			/* Add units to unit selector and enable functionality */
34
 			/* Add units to unit selector and enable functionality */
35
 			var unitBox = findChildObject(this, 'unit');
35
 			var unitBox = findChildObject(this, 'unit');
36
-			unitBox.addItem("Kg");
37
-			unitBox.addItem("Lb");
36
+			unitBox.addItem(TTR("fypurchase", "Kg"));
37
+			unitBox.addItem(TTR("fypurchase", "Lb"));
38
 			unitBox.currentIndex = QSettings.value("script/report_unit", 1);
38
 			unitBox.currentIndex = QSettings.value("script/report_unit", 1);
39
 			unitBox['currentIndexChanged(int)'].connect(function() {
39
 			unitBox['currentIndexChanged(int)'].connect(function() {
40
 				QSettings.setValue("script/report_unit", unitBox.currentIndex);
40
 				QSettings.setValue("script/report_unit", unitBox.currentIndex);
50
                 output.writeStartElement("html");
50
                 output.writeStartElement("html");
51
                 output.writeAttribute("xmlns", "http://www.w3.org/1999/xhtml");
51
                 output.writeAttribute("xmlns", "http://www.w3.org/1999/xhtml");
52
                 output.writeStartElement("head");
52
                 output.writeStartElement("head");
53
-				output.writeTextElement("title", "Coffee Purchase Previous Years Comparison");
53
+				output.writeTextElement("title", TTR("fypurchase", "Coffee Purchase Previous Years Comparison"));
54
 				output.writeEndElement();
54
 				output.writeEndElement();
55
 				output.writeStartElement("body");
55
 				output.writeStartElement("body");
56
-				output.writeTextElement("h1", "Coffee Purchase Previous Years Comparison");
56
+				output.writeTextElement("h1", TTR("fypurchase", "Coffee Purchase Previous Years Comparison"));
57
 				output.writeStartElement("table");
57
 				output.writeStartElement("table");
58
 				output.writeAttribute("style", "page-break-after: auto; text-align: left");
58
 				output.writeAttribute("style", "page-break-after: auto; text-align: left");
59
 				output.writeAttribute("rules", "groups");
59
 				output.writeAttribute("rules", "groups");
61
 				output.writeStartElement("thead");
61
 				output.writeStartElement("thead");
62
 				output.writeStartElement("tr");
62
 				output.writeStartElement("tr");
63
 				output.writeEmptyElement("th");
63
 				output.writeEmptyElement("th");
64
-				output.writeTextElement("th", "Sacks Purchased");
64
+				output.writeTextElement("th", TTR("fypurchase", "Sacks Purchased"));
65
 				switch(unitBox.currentIndex) {
65
 				switch(unitBox.currentIndex) {
66
 					case 0:
66
 					case 0:
67
-						output.writeTextElement("th", "Kg Purchased");
67
+						output.writeTextElement("th", TTR("fypurchase", "Kg Purchased"));
68
 						break;
68
 						break;
69
 					case 1:
69
 					case 1:
70
-						output.writeTextElement("th", "Lb Purchased");
70
+						output.writeTextElement("th", TTR("fypurchase", "Lb Purchased"));
71
 						break;
71
 						break;
72
 				}
72
 				}
73
-				output.writeTextElement("th", "Cost");
73
+				output.writeTextElement("th", TTR("fypurchase", "Cost"));
74
                                 switch(unitBox.currentIndex) {
74
                                 switch(unitBox.currentIndex) {
75
                                     case 0:
75
                                     case 0:
76
-                                        output.writeTextElement("th", "Cost per Kg");
76
+                                        output.writeTextElement("th", TTR("fypurchase", "Cost per Kg"));
77
                                         break;
77
                                         break;
78
                                     case 1:
78
                                     case 1:
79
-                                        output.writeTextElement("th", "Cost per Lb");
79
+                                        output.writeTextElement("th", TTR("fypurchase", "Cost per Lb"));
80
                                         break;
80
                                         break;
81
                                 }
81
                                 }
82
 				output.writeEndElement(); //tr
82
 				output.writeEndElement(); //tr
116
 				query = query.invalidate();
116
 				query = query.invalidate();
117
 				output.writeEndElement(); //tbody
117
 				output.writeEndElement(); //tbody
118
 				output.writeStartElement("tfoot");
118
 				output.writeStartElement("tfoot");
119
-				output.writeTextElement("th", "Totals:");
119
+				output.writeTextElement("th", TTR("fypurchase", "Totals:"));
120
 				output.writeTextElement("td", sacktotal.toFixed(2));
120
 				output.writeTextElement("td", sacktotal.toFixed(2));
121
 				output.writeTextElement("td", unittotal.toFixed(2));
121
 				output.writeTextElement("td", unittotal.toFixed(2));
122
 				output.writeTextElement("td", costtotal.toFixed(2));
122
 				output.writeTextElement("td", costtotal.toFixed(2));
140
 					expandedYears.push(url);
140
 					expandedYears.push(url);
141
 					var element = new WebElement(view.findFirstElement("#" + url));
141
 					var element = new WebElement(view.findFirstElement("#" + url));
142
 					var year = url.slice(1,url.length);
142
 					var year = url.slice(1,url.length);
143
-					var details = '<tr><td /><td colspan="3"><table><tr><th>Id</th><th>Invoice</th><th>Vendor</th><th>Cost</th></tr>';
143
+					var details = '<tr><td /><td colspan="3"><table><tr><th>Id</th><th>' + TTR("fypurchase", "Invoice") +
144
+                                        '</th><th>' + TTR("fypurchase", "Vendor") +
145
+                                        '</th><th>' + TTR("fypurchase", "Cost") +
146
+                                        '</th></tr>';
144
 					q = "SELECT id, invoice, vendor, (SELECT sum(cost) FROM invoice_items WHERE invoice_id = id) FROM invoices WHERE time >= '" + year + "-01-01' AND time <= '" + year + "-12-31'";
147
 					q = "SELECT id, invoice, vendor, (SELECT sum(cost) FROM invoice_items WHERE invoice_id = id) FROM invoices WHERE time >= '" + year + "-01-01' AND time <= '" + year + "-12-31'";
145
 					var query = new QSqlQuery();
148
 					var query = new QSqlQuery();
146
 					query.exec(q);
149
 					query.exec(q);

Loading…
Cancel
Save