Browse code

Erlaube das Ausgeben des Reports für beliebige Jahre

Bernd Wurst authored on 05/04/2019 15:39:02
Showing 1 changed files
... ...
@@ -6,6 +6,9 @@ $title = 'Report';
6 6
 
7 7
 
8 8
 $year = date("Y")-1;
9
+if (isset($_GET['year'])) {
10
+    $year = (int) $_GET['year'];
11
+}
9 12
 
10 13
 $typeresult = db_query("SELECT id, description, investment FROM buchhaltung.types");
11 14
 $dataresult = db_query("SELECT id, date, description, invoice_id, direction, type, amount, tax_rate, gross FROM buchhaltung.transactions WHERE date BETWEEN :from and :to ORDER BY date", array(":from" => $year."-01-01", ":to" => $year."-12-31"));