Quellcode durchsuchen

Support lifetime range in inventory change summary report.

Neal Wilson vor 11 Jahren
Ursprung
Commit
ba9cb94495
1 geänderte Dateien mit 12 neuen und 0 gelöschten Zeilen
  1. 12
    0
      config/Reports/invchange.xml

+ 12
- 0
config/Reports/invchange.xml Datei anzeigen

@@ -16,6 +16,18 @@
16 16
 		<![CDATA[
17 17
 			this.windowTitle = "Typica - Inventory Change Summary";
18 18
 			var dateSelect = findChildObject(this, 'dates');
19
+			var dateQuery = new QSqlQuery();
20
+			dateQuery.exec("SELECT time::date FROM transactions WHERE time = (SELECT min(time) FROM transactions) OR time = (SELECT max(time) FROM transactions) ORDER BY time ASC");
21
+			dateQuery.next();
22
+			var lifetimeStartDate = dateQuery.value(0);
23
+			var lifetimeEndDate;
24
+			if(dateQuery.next()) {
25
+				lifetimeEndDate = dateQuery.value(0);
26
+			} else {
27
+				lifetimeEndDate = lifetimeStartDate;
28
+			}
29
+			dateSelect.setLifetimeRange(lifetimeStartDate, lifetimeEndDate);
30
+			dateQuery = dateQuery.invalidate();
19 31
 			var unitBox = findChildObject(this, 'unit');
20 32
 			unitBox.addItem("Kg");
21 33
 			unitBox.addItem("Lb");

Laden…
Abbrechen
Speichern