Support PDF receipts
[infodrom.org/service.infodrom.org] / src / InfoCon / buch / infocon
index ff7a043..d4224da 100755 (executable)
@@ -276,7 +276,7 @@ sub get_next_nr
 
 sub buchung_input
 {
-    my @fieldname = ('Datum','Year','Category','Description','Ein/Aus','Tax percent','Tax assigned','Price','Paid');
+    my @fieldname = ('Datum','PDF','Year','Category','Description','Ein/Aus','Tax percent','Tax assigned','Price','Paid');
     my @input = ();
     my $weiter = 'y';
     my $i;
@@ -296,7 +296,7 @@ sub buchung_input
 
     my $attribs = $term->Attribs;
 
-    my $sth = $dbh->prepare ("INSERT INTO $table (nr,date,year,category,description,tax_percent,tax_assigned,price,paid) VALUES (?,?,?,?,?,?,?,?,?)");
+    my $sth = $dbh->prepare ("INSERT INTO $table (nr,date,pdf,year,category,description,tax_percent,tax_assigned,price,paid) VALUES (?,?,?,?,?,?,?,?,?,?)");
 
     print "Buchungseingabe\n\n";
     while ($weiter =~ /[JjYy1]/) {
@@ -336,7 +336,7 @@ sub buchung_input
                    $input[$i] = $ans;
                    $i++;
                }
-           } elsif ($fieldname[$i] eq "Paid") {
+           } elsif ($fieldname[$i] eq "Paid" || $fieldname[$i] eq "PDF") {
                if ($ans =~ /[1jJyY]/) {
                    $input[$i] = 1;
                } else {
@@ -362,8 +362,8 @@ sub buchung_input
            $input[7] *= -1 if ($input[7] > 0);
        }
 
-       $sth->execute (get_next_nr(), date_to_string($input[0]), $input[1], $input[2], $input[3],
-                      $input[5], $input[6], $input[7], $input[8]);
+       $sth->execute (get_next_nr(), date_to_string($input[0]), $input[1], $input[2], $input[3], $input[4],
+                      $input[6], $input[7], $input[8], $input[9]);
        $weiter = read_input("Weiter",'j');
        $input[6] = 0.0;
     }