#! /usr/bin/perl
# infocon - Administration tool for InfoCon
-# Copyright (c) 1998-2003,2005-8,10,11,12,14,15 Martin Schulze <joey@infodrom.org>
+# Copyright (c) 1998-2003,2005-8,10,11,12,14,15,16 Martin Schulze <joey@infodrom.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
-# $Id$
-
use strict;
use warnings;
$term = new Term::ReadLine '' unless $term;
- my $sth = $dbh->prepare ("INSERT INTO $table (nr,date,pdf,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,billing_date,paid) " .
+ "VALUES (?,?,?,?,?,?,?,?,?,?,?)");
print "Buchungseingabe\n\n";
while ($weiter =~ /[JjYy1]/) {
if ($f eq 'tax_assigned' && $answers->{'tax_percent'} == 0) {
$answers->{$f} = 0;
next;
+ } elsif ($f eq 'paid') {
+ if ($answers->{paid}) {
+ my @now = localtime(time);
+ $answers->{billing_date} = sprintf('%04d-%02d-%02d', $now[5]+1900, $now[4]+1, $now[3]);
+ } else {
+ $answers->{billing_date} = undef;
+ }
}
$ans = read_input($f, $fields->{$f});
$answers->{$f} = $ans;
$answers->{tax_percent},
$answers->{tax_assigned},
$answers->{price},
+ $answers->{billing_date},
$answers->{paid});
$weiter = $answers->{weiter};