Open new tab for editing items
authorJoey Schulze <joey@infodrom.org>
Sun, 8 May 2016 11:42:07 +0000 (13:42 +0200)
committerJoey Schulze <joey@infodrom.org>
Sun, 8 May 2016 11:42:07 +0000 (13:42 +0200)
src/InfoCon/account/list.wml
src/InfoCon/buch/infocon

index 46b86e2..adf4c54 100644 (file)
@@ -70,7 +70,7 @@ function filter_account()
     $out .= sprintf ("<tr class=\"t%d\">", $color);
     $out .= sprintf ("<td width=\"10%%\" align=\"right\">%s</td>", $date);
     $out .= sprintf ("<td width=\"10%%\" align=\"center\">%s</td>", $row['category']);
-    $out .= sprintf ("<td width=\"70%%\"><a href=\"edit.php?id=%d%s\">%s</a></td>",
+    $out .= sprintf ("<td width=\"70%%\"><a href=\"edit.php?id=%d%s\" target=\"_new\">%s</a></td>",
            $row['id'], $add, $descr[0]);
     $out .= sprintf ("<td width=\"10%%\" align=\"right\" class=\"%s\">%5.2f</td>",
       $row[$value]>0?"in":"out", $row[$value]);
index 76e0b40..d049fd6 100755 (executable)
@@ -39,6 +39,7 @@ my $term = undef;
 my $opt_all = 0;
 my $opt_verbose = 0;
 my $opt_year = 0;
+my $opt_date = undef;
 my $opt_direction = undef;
 
 sub sdate
@@ -94,9 +95,10 @@ sub pay_invoice
     my $sth;
 
     if ($pay) {
-       $query  = "UPDATE sales SET paid=1,billing_date=now() WHERE nr = $nr";
+       $query  = sprintf("UPDATE sales SET paid=1,billing_date=%s WHERE nr = %d",
+                         defined $opt_date ? $dbh->quote($opt_date) : 'now()', $nr);
     } else {
-       $query  = "UPDATE sales SET paid=0,billing_date=NULL WHERE nr = $nr";
+       $query  = sprintf("UPDATE sales SET paid=0,billing_date=NULL WHERE nr = %d", $nr);
     }
     $sth = $dbh->do($query);
 }
@@ -509,6 +511,7 @@ sub usage
     print "  --buchung-input|-bi\n";
     print "  --buchung-unpaid\n";
     print "  --buchung-hidden\n";
+    print "  --date yyyy-mm-dd (for --pay)\n";
     print "  --pay <nr> | --unpay <nr>\n";
     print "  --hide <nr> | --unhide <nr>\n";
     print "  --list-categories|-lc\n";
@@ -541,6 +544,7 @@ my %options = (
     'hide=s' => \$data{hide},
     'unhide=s' => \$data{unhide},
     'year=i' => \$opt_year,
+    'date=s' => \$opt_date,
     'direction|d=s' => \$opt_direction,
     'mailto:s' => \$data{mailto},
     'all' => \$opt_all,