|
|
|
|
8
|
<webview id="report" />
|
8
|
<webview id="report" />
|
9
|
</layout>
|
9
|
</layout>
|
10
|
<menu name="File">
|
10
|
<menu name="File">
|
11
|
- <item id="print" shortcut="Ctrl+P">Print</item>
|
|
|
|
|
11
|
+ <item id="print" shortcut="Ctrl+P">Print...</item>
|
12
|
</menu>
|
12
|
</menu>
|
13
|
<program>
|
13
|
<program>
|
14
|
<![CDATA[
|
14
|
<![CDATA[
|
15
|
- this.windowTitle = "Typica - Cost of Green Coffee for Roasted Coffee";
|
|
|
|
|
15
|
+ this.windowTitle = TTR("greencost", "Typica - Cost of Green Coffee for Roasted Coffee");
|
16
|
var report = findChildObject(this, 'report');
|
16
|
var report = findChildObject(this, 'report');
|
17
|
var printMenu = findChildObject(this, 'print');
|
17
|
var printMenu = findChildObject(this, 'print');
|
18
|
printMenu.triggered.connect(function() {
|
18
|
printMenu.triggered.connect(function() {
|
19
|
report.print();
|
19
|
report.print();
|
20
|
});
|
20
|
});
|
21
|
var unitBox = findChildObject(this, 'unit');
|
21
|
var unitBox = findChildObject(this, 'unit');
|
22
|
- unitBox.addItem("Kg");
|
|
|
23
|
- unitBox.addItem("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);
|
|
|
|
|
39
|
output.writeStartElement("html");
|
39
|
output.writeStartElement("html");
|
40
|
output.writeAttribute("xmlns", "http://www.w3.org/1999/xhtml");
|
40
|
output.writeAttribute("xmlns", "http://www.w3.org/1999/xhtml");
|
41
|
output.writeStartElement("head");
|
41
|
output.writeStartElement("head");
|
42
|
- output.writeTextElement("title", "Cost of Green Coffee for Roasted Coffee");
|
|
|
|
|
42
|
+ output.writeTextElement("title", TTR("greencost", "Cost of Green Coffee for Roasted Coffee"));
|
43
|
output.writeEndElement();
|
43
|
output.writeEndElement();
|
44
|
output.writeStartElement("body");
|
44
|
output.writeStartElement("body");
|
45
|
- var unit = (unitBox.currentIndex == 0 ? "Kg" : "Lb");
|
|
|
46
|
- output.writeTextElement("h1", "Cost of Green Coffee for Roasted Coffee");
|
|
|
47
|
- output.writeTextElement("p", "Cost of green coffee per " + unit + " of roasted coffee");
|
|
|
|
|
45
|
+ var unit = (unitBox.currentIndex == 0 ? TTR("greencost", "Kg") :
|
|
|
46
|
+ TTR("greencost", "Lb"));
|
|
|
47
|
+ output.writeTextElement("h1", TTR("greencost", "Cost of Green Coffee for Roasted Coffee"));
|
|
|
48
|
+ output.writeTextElement("p", TTR("greencost", "Cost of green coffee per ") +
|
|
|
49
|
+ unit + TTR("greencost", " of roasted coffee"));
|
48
|
var query = new QSqlQuery();
|
50
|
var query = new QSqlQuery();
|
49
|
query.exec("SELECT item, (SELECT name FROM items WHERE id = item) AS name FROM current_items ORDER BY name");
|
51
|
query.exec("SELECT item, (SELECT name FROM items WHERE id = item) AS name FROM current_items ORDER BY name");
|
50
|
var roastedItems = new Array();
|
52
|
var roastedItems = new Array();
|
|
|
|
|
140
|
output.writeAttribute("cellpadding", "3px");
|
142
|
output.writeAttribute("cellpadding", "3px");
|
141
|
output.writeStartElement("thead");
|
143
|
output.writeStartElement("thead");
|
142
|
output.writeStartElement("tr");
|
144
|
output.writeStartElement("tr");
|
143
|
- output.writeTextElement("th", "Coffee");
|
|
|
144
|
- output.writeTextElement("th", "Minimum Cost");
|
|
|
145
|
- output.writeTextElement("th", "Maximum Cost");
|
|
|
146
|
- output.writeTextElement("th", "Mean Cost");
|
|
|
|
|
145
|
+ output.writeTextElement("th", TTR("greencost", "Coffee"));
|
|
|
146
|
+ output.writeTextElement("th", TTR("greencost", "Minimum Cost"));
|
|
|
147
|
+ output.writeTextElement("th", TTR("greencost", "Maximum Cost"));
|
|
|
148
|
+ output.writeTextElement("th", TTR("greencost", "Mean Cost"));
|
147
|
output.writeEndElement();
|
149
|
output.writeEndElement();
|
148
|
output.writeEndElement();
|
150
|
output.writeEndElement();
|
149
|
output.writeStartElement("tbody");
|
151
|
output.writeStartElement("tbody");
|