|
@@ -21,26 +21,26 @@
|
21
|
21
|
</menu>
|
22
|
22
|
<program>
|
23
|
23
|
<![CDATA[
|
24
|
|
- this.windowTitle = "Typica - Recent Average Coffee Production";
|
|
24
|
+ this.windowTitle = TTR("productionreport", "Typica - Recent Average Coffee Production");
|
25
|
25
|
var report = findChildObject(this, 'report');
|
26
|
26
|
var printMenu = findChildObject(this, 'print');
|
27
|
27
|
printMenu.triggered.connect(function() {
|
28
|
28
|
report.print();
|
29
|
29
|
});
|
30
|
30
|
var sortBox = findChildObject(this, 'sort');
|
31
|
|
- sortBox.addItem("Roasted Coffee A-Z");
|
32
|
|
- sortBox.addItem("Roasted Coffee Z-A");
|
33
|
|
- sortBox.addItem("Weekly Use Ascending");
|
34
|
|
- sortBox.addItem("Weekly Use Descending");
|
|
31
|
+ sortBox.addItem(TTR("productionreport", "Roasted Coffee A-Z"));
|
|
32
|
+ sortBox.addItem(TTR("productionreport", "Roasted Coffee Z-A"));
|
|
33
|
+ sortBox.addItem(TTR("productionreport", "Weekly Use Ascending"));
|
|
34
|
+ sortBox.addItem(TTR("productionreport", "Weekly Use Descending"));
|
35
|
35
|
sortBox.currentIndex = QSettings.value("rwacp_sort", 3);
|
36
|
36
|
var unitBox = findChildObject(this, 'unit');
|
37
|
|
- unitBox.addItem("Kg");
|
38
|
|
- unitBox.addItem("Lb");
|
|
37
|
+ unitBox.addItem(TTR("productionreport", "Kg"));
|
|
38
|
+ unitBox.addItem(TTR("productionreport", "Lb"));
|
39
|
39
|
unitBox.currentIndex = QSettings.value("script/report_unit", 1);
|
40
|
40
|
var batchType = findChildObject(this, 'batchtype');
|
41
|
|
- batchType.addItem("Any");
|
42
|
|
- batchType.addItem("Production Roasts");
|
43
|
|
- batchType.addItem("Sample Roasts");
|
|
41
|
+ batchType.addItem(TTR("productionreport", "Any"));
|
|
42
|
+ batchType.addItem(TTR("productionreport", "Production Roasts"));
|
|
43
|
+ batchType.addItem(TTR("productionreport", "Sample Roasts"));
|
44
|
44
|
batchType.currentIndex = QSettings.value("script/racpreport/batchtypefilter", 1);
|
45
|
45
|
batchType['currentIndexChanged(int)'].connect(function() {
|
46
|
46
|
QSettings.setValue("script/racpreport/batchtypefilter",
|
|
@@ -74,17 +74,21 @@
|
74
|
74
|
output.writeStartElement("html");
|
75
|
75
|
output.writeAttribute("xmlns", "http://www.w3.org/1999/xhtml");
|
76
|
76
|
output.writeStartElement("head");
|
77
|
|
- output.writeTextElement("title", "Recent Average Coffee Production");
|
|
77
|
+ output.writeTextElement("title", TTR("productionreport", "Recent Average Coffee Production"));
|
78
|
78
|
output.writeEndElement();
|
79
|
79
|
output.writeStartElement("body");
|
80
|
|
- output.writeTextElement("h1", "Recent Average Coffee Production");
|
|
80
|
+ output.writeTextElement("h1", TTR("productionreport", "Recent Average Coffee Production"));
|
81
|
81
|
switch(unitBox.currentIndex)
|
82
|
82
|
{
|
83
|
83
|
case 0:
|
84
|
|
- output.writeTextElement("p", "This is a report of average coffee production per " + scaleBox.text + " days in kilograms over the past " + daysBox.text + " days.");
|
|
84
|
+ output.writeTextElement("p", TTR("productionreport", "This is a report of average coffee production per ") + scaleBox.text +
|
|
85
|
+ TTR("productionreport", " days in kilograms over the past ") + daysBox.text +
|
|
86
|
+ TTR("productionreport", " days."));
|
85
|
87
|
break;
|
86
|
88
|
case 1:
|
87
|
|
- output.writeTextElement("p", "This is a report of average coffee production per " + scaleBox.text + " days in pounds over the past " + daysBox.text + " days.");
|
|
89
|
+ output.writeTextElement("p", TTR("productionreport", "This is a report of average coffee production per ") + scaleBox.text +
|
|
90
|
+ TTR("productionreport", " days in pounds over the past ") + daysBox.text +
|
|
91
|
+ TTR("productionreport", " days."));
|
88
|
92
|
break;
|
89
|
93
|
}
|
90
|
94
|
output.writeStartElement("table");
|
|
@@ -92,8 +96,8 @@
|
92
|
96
|
output.writeAttribute("cellpadding", "3px");
|
93
|
97
|
output.writeStartElement("thead");
|
94
|
98
|
output.writeStartElement("tr");
|
95
|
|
- output.writeTextElement("th", "Roasted Coffee");
|
96
|
|
- output.writeTextElement("th", "Weekly Use");
|
|
99
|
+ output.writeTextElement("th", TTR("productionreport", "Roasted Coffee"));
|
|
100
|
+ output.writeTextElement("th", TTR("productionreport", "Weekly Use"));
|
97
|
101
|
output.writeEndElement();
|
98
|
102
|
output.writeEndElement();
|
99
|
103
|
output.writeStartElement("tbody");
|
|
@@ -144,7 +148,7 @@
|
144
|
148
|
}
|
145
|
149
|
output.writeEndElement();
|
146
|
150
|
output.writeStartElement("tfoot")
|
147
|
|
- output.writeTextElement("th", "Total");
|
|
151
|
+ output.writeTextElement("th", TTR("productionreport", "Total:"));
|
148
|
152
|
query.prepare("SELECT ((sum(roasted_quantity) / :scale) / :conversion)::numeric(18,2) FROM roasting_log WHERE time > current_date - integer '" + daysBox.text + "' AND roasted_quantity > 0 " + batchClause);
|
149
|
153
|
switch(unitBox.currentIndex)
|
150
|
154
|
{
|
|
@@ -173,10 +177,10 @@
|
173
|
177
|
QSettings.setValue("rwacp_sort", sortBox.currentIndex);
|
174
|
178
|
refresh();
|
175
|
179
|
});
|
176
|
|
- unitBox['currentIndexChanged(int)'].connect(function() {
|
177
|
|
- QSettings.setValue("script/report_unit", unitBox.currentIndex);
|
178
|
|
- refresh();
|
179
|
|
- });
|
|
180
|
+ unitBox['currentIndexChanged(int)'].connect(function() {
|
|
181
|
+ QSettings.setValue("script/report_unit", unitBox.currentIndex);
|
|
182
|
+ refresh();
|
|
183
|
+ });
|
180
|
184
|
]]>
|
181
|
185
|
</program>
|
182
|
186
|
</window>
|