Neal Wilson 9 år sedan
förälder
incheckning
1bcb3f638f
1 ändrade filer med 16 tillägg och 1 borttagningar
  1. 16
    1
      config/Reports/greensales.xml

+ 16
- 1
config/Reports/greensales.xml Visa fil

@@ -46,7 +46,6 @@
46 46
 				var buffer = new QBuffer;
47 47
 				buffer.open(3);
48 48
 				var output = new XmlWriter(buffer);
49
-				var output = new XmlWriter(buffer);
50 49
 				output.writeStartDocument("1.0");
51 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 51
 				output.writeStartElement("html");
@@ -96,6 +95,22 @@
96 95
 					output.writeEndElement();
97 96
 				}
98 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 114
 				output.writeEndElement();
100 115
 				output.writeEndElement();
101 116
 				output.writeEndElement();

Laddar…
Avbryt
Spara