Browse Source

Mark for translation: productionsummary.xml

Neal Wilson 9 years ago
parent
commit
50cd9b1cb1
1 changed files with 21 additions and 19 deletions
  1. 21
    19
      config/Reports/productionsummary.xml

+ 21
- 19
config/Reports/productionsummary.xml View File

18
     </menu>
18
     </menu>
19
     <program>
19
     <program>
20
         <![CDATA[
20
         <![CDATA[
21
-            this.windowTitle = "Typica - Production Summary";
21
+            this.windowTitle = TTR("dailyproduction", "Typica - Production Summary");
22
             var dateSelect = findChildObject(this, 'dates');
22
             var dateSelect = findChildObject(this, 'dates');
23
             var dateQuery = new QSqlQuery();
23
             var dateQuery = new QSqlQuery();
24
             dateQuery.exec("SELECT time::date FROM roasting_log WHERE time = (SELECT min(time) FROM roasting_log) OR time = (SELECT max(time) FROM roasting_log) ORDER BY time ASC");
24
             dateQuery.exec("SELECT time::date FROM roasting_log WHERE time = (SELECT min(time) FROM roasting_log) OR time = (SELECT max(time) FROM roasting_log) ORDER BY time ASC");
33
             dateSelect.setLifetimeRange(lifetimeStartDate, lifetimeEndDate);
33
             dateSelect.setLifetimeRange(lifetimeStartDate, lifetimeEndDate);
34
             dateQuery = dateQuery.invalidate();
34
             dateQuery = dateQuery.invalidate();
35
             var unitBox = findChildObject(this, 'unit');
35
             var unitBox = findChildObject(this, 'unit');
36
-            unitBox.addItem("Kg");
37
-            unitBox.addItem("Lb");
36
+            unitBox.addItem(TTR("dailyproduction", "Kg"));
37
+            unitBox.addItem(TTR("dailyproduction", "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);
41
                 refresh();
41
                 refresh();
42
             });
42
             });
43
             var batchType = findChildObject(this, 'batchtype');
43
             var batchType = findChildObject(this, 'batchtype');
44
-            batchType.addItem("Any");
45
-            batchType.addItem("Production Roasts");
46
-            batchType.addItem("SampleRoasts");
44
+            batchType.addItem(TTR("dailyproduction", "Any"));
45
+            batchType.addItem(TTR("dailyproduction", "Production Roasts"));
46
+            batchType.addItem(TTR("dailyproduction", "Sample Roasts"));
47
             batchType.currentIndex = QSettings.value("script/batchtypefilter", 1);
47
             batchType.currentIndex = QSettings.value("script/batchtypefilter", 1);
48
             batchType['currentIndexChanged(int)'].connect(function() {
48
             batchType['currentIndexChanged(int)'].connect(function() {
49
                 QSettings.setValue("script/batchtypefilter", batchType.currentIndex);
49
                 QSettings.setValue("script/batchtypefilter", batchType.currentIndex);
50
                 refresh();
50
                 refresh();
51
             });
51
             });
52
             var approval = findChildObject(this, 'approval');
52
             var approval = findChildObject(this, 'approval');
53
-            approval.addItem("Any");
54
-            approval.addItem("Approved");
55
-            approval.addItem("Not Approved");
53
+            approval.addItem(TTR("dailyproduction", "Any"));
54
+            approval.addItem(TTR("dailyproduction", "Approved"));
55
+            approval.addItem(TTR("dailyproduction", "Not Approved"));
56
             approval.currentIndex = QSettings.value("script/approvalfilter", 1);
56
             approval.currentIndex = QSettings.value("script/approvalfilter", 1);
57
             approval['currentIndexChanged(int)'].connect(function() {
57
             approval['currentIndexChanged(int)'].connect(function() {
58
                 QSettings.setValue("script/approvalfilter", approval.currentIndex);
58
                 QSettings.setValue("script/approvalfilter", approval.currentIndex);
72
                 output.writeStartElement("html");
72
                 output.writeStartElement("html");
73
                 output.writeAttribute("xmlns", "http://www.w3.org/1999/xhtml");
73
                 output.writeAttribute("xmlns", "http://www.w3.org/1999/xhtml");
74
                 output.writeStartElement("head");
74
                 output.writeStartElement("head");
75
-                output.writeTextElement("title", "Production Summary");
75
+                output.writeTextElement("title", TTR("dailyproduction", "Production Summary"));
76
                 output.writeEndElement();
76
                 output.writeEndElement();
77
                 output.writeStartElement("body");
77
                 output.writeStartElement("body");
78
                 var dateRange = dateSelect.currentRange();
78
                 var dateRange = dateSelect.currentRange();
79
                 var startDate = dateRange[0];
79
                 var startDate = dateRange[0];
80
                 var endDate = dateRange[dateRange.length - 1];
80
                 var endDate = dateRange[dateRange.length - 1];
81
-                output.writeTextElement("h1", "Production Summary: " + startDate + " - " + endDate);
81
+                output.writeTextElement("h1", TTR("dailyproduction", "Production Summary: ") + startDate + " - " + endDate);
82
                 var conversion = 1;
82
                 var conversion = 1;
83
-                var unitText = 'Lb';
83
+                var unitText = TTR("dailyproduction", "Lb");
84
                 if(unitBox.currentIndex == 0) {
84
                 if(unitBox.currentIndex == 0) {
85
                     conversion = 2.2;
85
                     conversion = 2.2;
86
-                    unitText = 'Kg';
86
+                    unitText = TTR("dailyproduction", "Kg");
87
                 }
87
                 }
88
                 var transaction_filter;
88
                 var transaction_filter;
89
                 var approval_filter;
89
                 var approval_filter;
120
                 var batchesRoasted = query.value(0);
120
                 var batchesRoasted = query.value(0);
121
                 var unroastedSum = query.value(1);
121
                 var unroastedSum = query.value(1);
122
                 var roastedSum = query.value(2);
122
                 var roastedSum = query.value(2);
123
-                output.writeTextElement("p", "" + roastedSum + " " + unitText + " roasted from " + unroastedSum + " " + unitText + " green in " + batchesRoasted + " batches.");
123
+                output.writeTextElement("p", "" + roastedSum + " " + unitText + TTR("dailyproduction", " roasted from ") +
124
+                unroastedSum + " " + unitText + TTR("dailyproduction", " green in ") +
125
+                batchesRoasted + TTR("dailyproduction", " batches."));
124
                 query.prepare("SELECT time::date AS date, count(1), sum(unroasted_total_quantity) / :c1, sum(roasted_quantity) / :c2 FROM roasting_log WHERE time >= :sd AND time < :ed ::date + interval '1 day'" + transaction_filter + approval_filter + " GROUP BY date ORDER BY date ASC");
126
                 query.prepare("SELECT time::date AS date, count(1), sum(unroasted_total_quantity) / :c1, sum(roasted_quantity) / :c2 FROM roasting_log WHERE time >= :sd AND time < :ed ::date + interval '1 day'" + transaction_filter + approval_filter + " GROUP BY date ORDER BY date ASC");
125
                 query.bind(":c1", conversion);
127
                 query.bind(":c1", conversion);
126
                 query.bind(":c2", conversion);
128
                 query.bind(":c2", conversion);
132
                 output.writeAttribute("cellpadding", "3px");
134
                 output.writeAttribute("cellpadding", "3px");
133
                 output.writeStartElement("thead");
135
                 output.writeStartElement("thead");
134
                 output.writeStartElement("tr");
136
                 output.writeStartElement("tr");
135
-                output.writeTextElement("th", "Date");
136
-                output.writeTextElement("th", "Batches");
137
-                output.writeTextElement("th", "Unroasted (" + unitText + ")");
138
-                output.writeTextElement("th", "Roasted (" + unitText + ")");
137
+                output.writeTextElement("th", TTR("dailyproduction", "Date"));
138
+                output.writeTextElement("th", TTR("dailyproduction", "Batches"));
139
+                output.writeTextElement("th", TTR("dailyproduction", "Unroasted (") + unitText + ")");
140
+                output.writeTextElement("th", TTR("dailyproduction", "Roasted (") + unitText + ")");
139
                 output.writeEndElement();
141
                 output.writeEndElement();
140
                 output.writeEndElement();
142
                 output.writeEndElement();
141
                 output.writeStartElement("tbody");
143
                 output.writeStartElement("tbody");
156
                 output.writeStartElement("tfoot");
158
                 output.writeStartElement("tfoot");
157
                 output.writeStartElement("tr");
159
                 output.writeStartElement("tr");
158
                 output.writeStartElement("td");
160
                 output.writeStartElement("td");
159
-                output.writeTextElement("strong", "Totals:");
161
+                output.writeTextElement("strong", TTR("dailyproduction", "Totals:"));
160
                 output.writeEndElement();
162
                 output.writeEndElement();
161
                 output.writeTextElement("td", batchesRoasted);
163
                 output.writeTextElement("td", batchesRoasted);
162
                 output.writeTextElement("td", unroastedSum);
164
                 output.writeTextElement("td", unroastedSum);

Loading…
Cancel
Save