|
@@ -14,7 +14,7 @@
|
14
|
14
|
</menu>
|
15
|
15
|
<program>
|
16
|
16
|
<![CDATA[
|
17
|
|
- this.windowTitle = "Typica - Green Coffee Sales";
|
|
17
|
+ this.windowTitle = TTR("greensales", "Typica - Green Coffee Sales");
|
18
|
18
|
var dateSelect = findChildObject(this, 'dates');
|
19
|
19
|
var dateQuery = new QSqlQuery();
|
20
|
20
|
dateQuery.exec("SELECT time::date FROM sale WHERE time = (SELECT min(time) FROM sale) OR time = (SELECT max(time) FROM sale) ORDER BY time ASC");
|
|
@@ -29,8 +29,8 @@
|
29
|
29
|
dateSelect.setLifetimeRange(lifetimeStartDate, lifetimeEndDate);
|
30
|
30
|
dateQuery = dateQuery.invalidate();
|
31
|
31
|
var unitBox = findChildObject(this, 'unit');
|
32
|
|
- unitBox.addItem("Kg");
|
33
|
|
- unitBox.addItem("Lb");
|
|
32
|
+ unitBox.addItem(TTR("greensales", "Kg"));
|
|
33
|
+ unitBox.addItem(TTR("greensales", "Lb"));
|
34
|
34
|
unitBox.currentIndex = QSettings.value("script/report_unit", 1);
|
35
|
35
|
unitBox['currentIndexChanged(int)'].connect(function() {
|
36
|
36
|
QSettings.setValue("script/report_unit", unitBox.currentIndex);
|
|
@@ -51,18 +51,18 @@
|
51
|
51
|
output.writeStartElement("html");
|
52
|
52
|
output.writeAttribute("xmlns", "http://www.w3.org/1999/xhtml");
|
53
|
53
|
output.writeStartElement("head");
|
54
|
|
- output.writeTextElement("title", "Green Coffee Sales");
|
|
54
|
+ output.writeTextElement("title", TTR("greensales", "Green Coffee Sales"));
|
55
|
55
|
output.writeEndElement();
|
56
|
56
|
output.writeStartElement("body");
|
57
|
57
|
var dateRange = dateSelect.currentRange();
|
58
|
58
|
var startDate = dateRange[0];
|
59
|
59
|
var endDate = dateRange[dateRange.length - 1];
|
60
|
|
- output.writeTextElement("h1", "Green Coffee Sales: " + startDate + " - " + endDate);
|
|
60
|
+ output.writeTextElement("h1", TTR("greensales", "Green Coffee Sales: ") + startDate + " - " + endDate);
|
61
|
61
|
var conversion = 1;
|
62
|
|
- var unitText = 'Lb';
|
|
62
|
+ var unitText = TTR("greensales", "Lb");
|
63
|
63
|
if(unitBox.currentIndex == 0) {
|
64
|
64
|
conversion = 2.2;
|
65
|
|
- unitText = 'Kg';
|
|
65
|
+ unitText = TTR("greensales", "Kg");
|
66
|
66
|
}
|
67
|
67
|
var query = new QSqlQuery();
|
68
|
68
|
query.prepare("SELECT item, (SELECT name FROM coffees WHERE id = item) AS name, (SELECT origin FROM coffees WHERE id = item) AS origin, (SELECT reference FROM coffees WHERE id = item) AS reference, (SUM(quantity)/:conversion)::numeric(12,3) FROM sale WHERE time < :ed ::date + interval '1 day' AND time >= :sd GROUP BY item ORDER BY name ASC");
|
|
@@ -75,11 +75,11 @@
|
75
|
75
|
output.writeAttribute("cellpadding", "3px");
|
76
|
76
|
output.writeStartElement("thead");
|
77
|
77
|
output.writeStartElement("tr");
|
78
|
|
- output.writeTextElement("th", "ID"); // 0
|
79
|
|
- output.writeTextElement("th", "Coffee"); // 1
|
80
|
|
- output.writeTextElement("th", "Origin"); // 2
|
81
|
|
- output.writeTextElement("th", "Reference"); // 3
|
82
|
|
- output.writeTextElement("th", "Quantity"); // 4
|
|
78
|
+ output.writeTextElement("th", TTR("greensales", "ID")); // 0
|
|
79
|
+ output.writeTextElement("th", TTR("greensales", "Coffee")); // 1
|
|
80
|
+ output.writeTextElement("th", TTR("greensales", "Origin")); // 2
|
|
81
|
+ output.writeTextElement("th", TTR("greensales", "Reference")); // 3
|
|
82
|
+ output.writeTextElement("th", TTR("greensales", "Quantity")); // 4
|
83
|
83
|
output.writeEndElement();
|
84
|
84
|
output.writeEndElement();
|
85
|
85
|
output.writeStartElement("tbody");
|
|
@@ -106,7 +106,7 @@
|
106
|
106
|
output.writeEmptyElement("td");
|
107
|
107
|
output.writeEmptyElement("td");
|
108
|
108
|
output.writeEmptyElement("td");
|
109
|
|
- output.writeTextElement("th", "Total:");
|
|
109
|
+ output.writeTextElement("th", TTR("greensales", "Total:"));
|
110
|
110
|
output.writeTextElement("td", query.value(0));
|
111
|
111
|
output.writeEndElement();
|
112
|
112
|
}
|