Use column names and let the database default win
authorJoey Schulze <joey@infodrom.org>
Fri, 25 Feb 2011 22:29:35 +0000 (22:29 +0000)
committerJoey Schulze <joey@infodrom.org>
Fri, 25 Feb 2011 22:29:35 +0000 (22:29 +0000)
src/InfoCon/buch/infocon

index a8bfaca..d9f1530 100755 (executable)
@@ -299,7 +299,7 @@ sub buchung_input
 
     my $attribs = $term->Attribs;
 
-    my $sth = $dbh->prepare ("INSERT INTO $table VALUES (?,?,?,?,?,?,?,?,?)");
+    my $sth = $dbh->prepare ("INSERT INTO $table (nr,date,category,description,tax_percent,tax_assigned,price,paid) VALUES (?,?,?,?,?,?,?,?)");
 
     print "Buchungseingabe\n\n";
     while ($weiter =~ /[JjYy1]/) {
@@ -362,7 +362,7 @@ sub buchung_input
        }
 
        $sth->execute (get_next_nr(), date_to_string($input[0]), $input[1], $input[2], $input[4],
-                         $input[5], $input[6], 1, $input[7]);
+                         $input[5], $input[6], $input[7]);
        $weiter = read_input("Weiter",'j');
        $input[5] = 0.0;
     }