Neal Wilson 9 vuotta sitten
vanhempi
commit
1bcb3f638f
1 muutettua tiedostoa jossa 16 lisäystä ja 1 poistoa
  1. 16
    1
      config/Reports/greensales.xml

+ 16
- 1
config/Reports/greensales.xml Näytä tiedosto

46
 				var buffer = new QBuffer;
46
 				var buffer = new QBuffer;
47
 				buffer.open(3);
47
 				buffer.open(3);
48
 				var output = new XmlWriter(buffer);
48
 				var output = new XmlWriter(buffer);
49
-				var output = new XmlWriter(buffer);
50
 				output.writeStartDocument("1.0");
49
 				output.writeStartDocument("1.0");
51
 				output.writeDTD('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg.dtd">');
50
 				output.writeDTD('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg.dtd">');
52
 				output.writeStartElement("html");
51
 				output.writeStartElement("html");
96
 					output.writeEndElement();
95
 					output.writeEndElement();
97
 				}
96
 				}
98
 				output.writeEndElement();
97
 				output.writeEndElement();
98
+                                output.writeStartElement("tfoot");
99
+                                query.prepare("SELECT (sum(quantity)/:conversion)::numeric(12,3) FROM sale WHERE time < :ed ::date + interval '1 day' AND time >= :sd");
100
+                                query.bind(":conversion", conversion);
101
+                                query.bind(":ed", endDate);
102
+                                query.bind(":sd", startDate);
103
+                                query.exec();
104
+                                if(query.next()) {
105
+                                    output.writeStartElement("tr");
106
+                                    output.writeEmptyElement("td");
107
+                                    output.writeEmptyElement("td");
108
+                                    output.writeEmptyElement("td");
109
+                                    output.writeTextElement("th", "Total:");
110
+                                    output.writeTextElement("td", query.value(0));
111
+                                    output.writeEndElement();
112
+                                }
113
+                                output.writeEndElement();
99
 				output.writeEndElement();
114
 				output.writeEndElement();
100
 				output.writeEndElement();
115
 				output.writeEndElement();
101
 				output.writeEndElement();
116
 				output.writeEndElement();

Loading…
Peruuta
Tallenna