Browse Source

Translation markups: cogr.xml and dailyproductiondetail.xml

Neal Wilson 9 years ago
parent
commit
1f6ec16818
2 changed files with 25 additions and 25 deletions
  1. 2
    2
      config/Reports/cogr.xml
  2. 23
    23
      config/Reports/dailyproductiondetail.xml

+ 2
- 2
config/Reports/cogr.xml View File

19
                 report.print();
19
                 report.print();
20
             });
20
             });
21
             var unitBox = findChildObject(this, 'unit');
21
             var unitBox = findChildObject(this, 'unit');
22
-            unitBox.addItem(TTR("greencost", "Kg");
23
-            unitBox.addItem(TTR("greencost", "Lb");
22
+            unitBox.addItem(TTR("greencost", "Kg"));
23
+            unitBox.addItem(TTR("greencost", "Lb"));
24
             unitBox.currentIndex = QSettings.value("script/report_unit", 1);
24
             unitBox.currentIndex = QSettings.value("script/report_unit", 1);
25
             unitBox['currentIndexChanged(int)'].connect(function() {
25
             unitBox['currentIndexChanged(int)'].connect(function() {
26
                 QSettings.setValue("script/report_unit", unitBox.currentIndex);
26
                 QSettings.setValue("script/report_unit", unitBox.currentIndex);

+ 23
- 23
config/Reports/dailyproductiondetail.xml View File

49
 				output.writeStartElement("html");
49
 				output.writeStartElement("html");
50
 				output.writeAttribute("xmlns", "http://www.w3.org/1999/xhtml");
50
 				output.writeAttribute("xmlns", "http://www.w3.org/1999/xhtml");
51
 				output.writeStartElement("head");
51
 				output.writeStartElement("head");
52
-				output.writeTextElement("title", "Daily Production Report");
52
+				output.writeTextElement("title", TTR("dailyproduction", "Daily Production Report"));
53
 				output.writeEndElement();
53
 				output.writeEndElement();
54
 				output.writeStartElement("body");
54
 				output.writeStartElement("body");
55
 				var dateString = "" + dateField.year() + "-" + dateField.month() + "-" + dateField.day();
55
 				var dateString = "" + dateField.year() + "-" + dateField.month() + "-" + dateField.day();
56
-				output.writeTextElement("h1", "Daily Production Report: " + dateString);
57
-				output.writeTextElement("h2", "Batches Roasted");
56
+				output.writeTextElement("h1", TTR("dailyproduction", "Daily Production Report: ") + dateString);
57
+				output.writeTextElement("h2", TTR("dailyproduction", "Batches Roasted"));
58
 				var query = new QSqlQuery();
58
 				var query = new QSqlQuery();
59
 				var q = "SELECT time, machine, (SELECT name FROM machine WHERE id = machine), (SELECT name FROM items WHERE id = roasted_id), unroasted_id, unroasted_quantity, unroasted_total_quantity, roasted_id, roasted_quantity, annotation, duration, files, (SELECT loss FROM roasting_specification WHERE item = roasted_id AND time = (SELECT max(time) FROM roasting_specification WHERE time <= roasting_log.time AND item = roasted_id)), (SELECT tolerance FROM roasting_specification WHERE item = roasted_id AND time = (SELECT max(time) FROM roasting_specification WHERE time <= roasting_log.time AND item = roasted_id)), (SELECT notes FROM roasting_specification WHERE item = roasted_id AND time = (SELECT max(time) FROM roasting_specification WHERE time <= roasting_log.time AND item = roasted_id)), approval FROM roasting_log WHERE time > '" + dateString + "' AND time < ('" + dateString + "'::date + integer '1') ORDER BY time";
59
 				var q = "SELECT time, machine, (SELECT name FROM machine WHERE id = machine), (SELECT name FROM items WHERE id = roasted_id), unroasted_id, unroasted_quantity, unroasted_total_quantity, roasted_id, roasted_quantity, annotation, duration, files, (SELECT loss FROM roasting_specification WHERE item = roasted_id AND time = (SELECT max(time) FROM roasting_specification WHERE time <= roasting_log.time AND item = roasted_id)), (SELECT tolerance FROM roasting_specification WHERE item = roasted_id AND time = (SELECT max(time) FROM roasting_specification WHERE time <= roasting_log.time AND item = roasted_id)), (SELECT notes FROM roasting_specification WHERE item = roasted_id AND time = (SELECT max(time) FROM roasting_specification WHERE time <= roasting_log.time AND item = roasted_id)), approval FROM roasting_log WHERE time > '" + dateString + "' AND time < ('" + dateString + "'::date + integer '1') ORDER BY time";
60
 				query.exec(q);
60
 				query.exec(q);
66
 				output.writeStartElement("thead");
66
 				output.writeStartElement("thead");
67
 				output.writeStartElement("tr");
67
 				output.writeStartElement("tr");
68
                                 output.writeAttribute("valign", "bottom");
68
                                 output.writeAttribute("valign", "bottom");
69
-				output.writeTextElement("th", "Time");
70
-				output.writeTextElement("th", "Machine");
71
-				output.writeTextElement("th", "Batch ID");
69
+				output.writeTextElement("th", TTR("dailyproduction", "Time"));
70
+				output.writeTextElement("th", TTR("dailyproduction", "Machine"));
71
+				output.writeTextElement("th", TTR("dailyproduction", "Batch ID"));
72
 				switch(unitBox.currentIndex)
72
 				switch(unitBox.currentIndex)
73
 				{
73
 				{
74
 					case 0:
74
 					case 0:
75
-						output.writeTextElement("th", "Green Weights (Kg)");
75
+						output.writeTextElement("th", TTR("dailyproduction", "Green Weights (Kg)"));
76
 						break;
76
 						break;
77
 					case 1:
77
 					case 1:
78
-						output.writeTextElement("th", "Green Weights (Lb)");
78
+						output.writeTextElement("th", TTR("dailyproduction", "Green Weights (Lb)"));
79
 						break;
79
 						break;
80
 				}
80
 				}
81
 				output.writeTextElement("th", "Green Coffees");
81
 				output.writeTextElement("th", "Green Coffees");
82
 				switch(unitBox.currentIndex)
82
 				switch(unitBox.currentIndex)
83
 				{
83
 				{
84
 					case 0:
84
 					case 0:
85
-						output.writeTextElement("th", "Roasted Weight (Kg)");
85
+						output.writeTextElement("th", TTR("dailyproduction", "Roasted Weight (Kg)"));
86
 						break;
86
 						break;
87
 					case 1:
87
 					case 1:
88
-						output.writeTextElement("th", "Roasted Weight (Lb)");
88
+						output.writeTextElement("th", TTR("dailyproduction", "Roasted Weight (Lb)"));
89
 						break;
89
 						break;
90
 				}
90
 				}
91
-				output.writeTextElement("th", "Roasted Coffee");
92
-				output.writeTextElement("th", "% Weight Loss");
93
-				output.writeTextElement("th", "Duration");
91
+				output.writeTextElement("th", TTR("dailyproduction", "Roasted Coffee"));
92
+				output.writeTextElement("th", TTR("dailyproduction", "% Weight Loss"));
93
+				output.writeTextElement("th", TTR("dailyproduction", "Duration"));
94
 				output.writeEndElement();
94
 				output.writeEndElement();
95
 				output.writeEndElement();
95
 				output.writeEndElement();
96
 				output.writeStartElement("tbody");
96
 				output.writeStartElement("tbody");
231
 					output.writeStartElement("tr");
231
 					output.writeStartElement("tr");
232
 					output.writeStartElement("td");
232
 					output.writeStartElement("td");
233
 					output.writeAttribute("colspan", "5");
233
 					output.writeAttribute("colspan", "5");
234
-					output.writeTextElement("strong", "Profile Summary");
234
+					output.writeTextElement("strong", TTR("dailyproduction", "Profile Summary"));
235
 					var buffer2 = new QBuffer("<points>"+annotations+"</points>");
235
 					var buffer2 = new QBuffer("<points>"+annotations+"</points>");
236
 					buffer2.open(1);
236
 					buffer2.open(1);
237
 					var colQuery = new XQuery;
237
 					var colQuery = new XQuery;
240
 					var result = colQuery.exec();
240
 					var result = colQuery.exec();
241
 					buffer2.close();
241
 					buffer2.close();
242
 					var seriesHeaders = new Array();
242
 					var seriesHeaders = new Array();
243
-					seriesHeaders.push("Time");
243
+					seriesHeaders.push(TTR("dailyproduction", "Time"));
244
 					var records = result.split(";");
244
 					var records = result.split(";");
245
 					for(var i = 0; i < records.length - 1; i++) {
245
 					for(var i = 0; i < records.length - 1; i++) {
246
 						seriesHeaders.push(records[i].replace(/^\s+|\s+$/g,""));
246
 						seriesHeaders.push(records[i].replace(/^\s+|\s+$/g,""));
247
 					}
247
 					}
248
-					seriesHeaders.push("Note");
248
+					seriesHeaders.push(TTR("dailyproduction", "Note"));
249
 					output.writeStartElement("table");
249
 					output.writeStartElement("table");
250
 					output.writeStartElement("thead");
250
 					output.writeStartElement("thead");
251
 					output.writeStartElement("tr");
251
 					output.writeStartElement("tr");
328
 				output.writeEmptyElement("td");
328
 				output.writeEmptyElement("td");
329
 				output.writeEmptyElement("td");
329
 				output.writeEmptyElement("td");
330
 				output.writeStartElement("td");
330
 				output.writeStartElement("td");
331
-				output.writeTextElement("strong", "Totals:");
331
+				output.writeTextElement("strong", TTR("dailyproduction", "Totals:"));
332
 				output.writeEndElement();
332
 				output.writeEndElement();
333
 				q = "SELECT sum(unroasted_total_quantity), sum(roasted_quantity), sum(duration) FROM roasting_log WHERE time > '" + dateString + "' AND time < ('" + dateString + "'::date + integer '1')";
333
 				q = "SELECT sum(unroasted_total_quantity), sum(roasted_quantity), sum(duration) FROM roasting_log WHERE time > '" + dateString + "' AND time < ('" + dateString + "'::date + integer '1')";
334
 				query.exec(q);
334
 				query.exec(q);
358
 				output.writeEndElement();
358
 				output.writeEndElement();
359
 				output.writeEndElement(); //tfoot
359
 				output.writeEndElement(); //tfoot
360
 				output.writeEndElement(); //table
360
 				output.writeEndElement(); //table
361
-				output.writeTextElement("h2", "Inventory");
361
+				output.writeTextElement("h2", TTR("dailyproduction", "Inventory"));
362
 				output.writeStartElement("table");
362
 				output.writeStartElement("table");
363
 				output.writeAttribute("rules", "groups");
363
 				output.writeAttribute("rules", "groups");
364
 				output.writeAttribute("cellpadding", "3px");
364
 				output.writeAttribute("cellpadding", "3px");
365
 				output.writeStartElement("thead");
365
 				output.writeStartElement("thead");
366
 				output.writeStartElement("tr");
366
 				output.writeStartElement("tr");
367
-				output.writeTextElement("th", "Green Coffee");
368
-				output.writeTextElement("th", "Starting Inventory");
369
-				output.writeTextElement("th", "Ending Inventory");
370
-				output.writeTextElement("th", "Change");
371
-				output.writeTextElement("th", "Availability");
367
+				output.writeTextElement("th", TTR("dailyproduction", "Green Coffee"));
368
+				output.writeTextElement("th", TTR("dailyproduction", "Starting Inventory"));
369
+				output.writeTextElement("th", TTR("dailyproduction", "Ending Inventory"));
370
+				output.writeTextElement("th", TTR("dailyproduction", "Change"));
371
+				output.writeTextElement("th", TTR("dailyproduction", "Availability"));
372
 				output.writeEndElement();
372
 				output.writeEndElement();
373
 				output.writeEndElement();
373
 				output.writeEndElement();
374
 				output.writeStartElement("tbody");
374
 				output.writeStartElement("tbody");

Loading…
Cancel
Save