Support assigning a billing_date when paying a statement
[infodrom.org/service.infodrom.org] / src / InfoCon / buch / index.wml
index a0685e2..6e2fe54 100644 (file)
@@ -1,6 +1,7 @@
 #include <infocon.style>
 
 <page func=InfoCon title="Buchhaltung">
+<calendar_init -5>
 
 <style type="text/css">
 span.in { color: green; }
@@ -8,7 +9,7 @@ span.out { color: red; }
 span.in:hover, span.out:hover { background: yellow; border: 1px solid #ccc; }
 </style>
 
-<h3>Nicht bezahlte Rechnungen</h3>
+<h3>Übersichten</h3>
 
 <?
   $dbh = pg_pconnect ("<dbhost>", "<dbport>", "<dbname>")
@@ -62,8 +63,9 @@ span.in:hover, span.out:hover { background: yellow; border: 1px solid #ccc; }
   for ($nr=0; $nr <pg_NumRows ($sth); $nr++) {
     $row = pg_fetch_array ($sth, $nr);
     $date = substr ($row['date'],6,2) . "." . substr ($row['date'],4,2) . "." . substr ($row['date'],0,4);
-    printf (" <input type=\"checkbox\" name=\"pay_dm_%d\" value=\"1\">", $row['nr']);
-    printf ("%d. %s %s (%.2f&nbsp;DM)<br>", $row['nr'], $date, $row['description'], $row['price']);
+    printf (" <input type=\"text\" id=\"date_%d\" name=\"date_%d\" size=\"6\" value=\"\">", $row['nr'], $row['nr']);
+    printf (" <img class=\"calendar\" src=\"<root_prefix>pix/calendar.gif\" onclick=\"event.cancelBubble=true;popcalendar('date_%d');\" alt=\"\">", $row['nr']);
+    printf (" %d. %s %s (%.2f&nbsp;DM)<br>", $row['nr'], $date, $row['description'], $row['price']);
   }
 
   $query = "SELECT nr,date,description,price FROM sales WHERE paid=0 ORDER BY date,nr";
@@ -78,8 +80,9 @@ span.in:hover, span.out:hover { background: yellow; border: 1px solid #ccc; }
   for ($nr=0; $nr <pg_NumRows ($sth); $nr++) {
     $row = pg_fetch_array ($sth, $nr);
     $date = substr ($row['date'],6,2) . "." . substr ($row['date'],4,2) . "." . substr ($row['date'],0,4);
-    printf (" <input type=\"checkbox\" name=\"pay_%d\" value=\"1\">", $row['nr']);
-    printf ('<span class="%s">%d. %s %s (%.2f&nbsp;&euro;)</span><br>',
+    printf (" <input type=\"text\" id=\"date_%d\" name=\"date_%d\" size=\"6\" value=\"\">", $row['nr'], $row['nr']);
+    printf (" <img class=\"calendar\" src=\"<root_prefix>pix/calendar.gif\" onclick=\"event.cancelBubble=true;popcalendar('date_%d');\" alt=\"\">", $row['nr']);
+    printf (' <span class="%s">%d. %s %s (%.2f&nbsp;&euro;)</span><br>',
            $row['price'] < 0 ? 'out' : 'in',
            $row['nr'], $date, $row['description'], $row['price']);
   }