projects
/
infodrom.org
/
service.infodrom.org
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a564078
)
Set billing_date when directly paying an item
author
Joey Schulze
<joey@infodrom.org>
Tue, 3 May 2016 19:58:44 +0000
(21:58 +0200)
committer
Joey Schulze
<joey@infodrom.org>
Tue, 3 May 2016 19:58:44 +0000
(21:58 +0200)
src/InfoCon/buch/infocon
patch
|
blob
|
history
diff --git
a/src/InfoCon/buch/infocon
b/src/InfoCon/buch/infocon
index
341489c
..
76e0b40
100755
(executable)
--- a/
src/InfoCon/buch/infocon
+++ b/
src/InfoCon/buch/infocon
@@
-1,7
+1,7
@@
#! /usr/bin/perl
# infocon - Administration tool for InfoCon
#! /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
#
# 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
@@
-17,8
+17,6
@@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
# 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;
use strict;
use warnings;
@@
-448,7
+446,8
@@
sub buchung_input
$term = new Term::ReadLine '' unless $term;
$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]/) {
print "Buchungseingabe\n\n";
while ($weiter =~ /[JjYy1]/) {
@@
-456,6
+455,13
@@
sub buchung_input
if ($f eq 'tax_assigned' && $answers->{'tax_percent'} == 0) {
$answers->{$f} = 0;
next;
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;
}
$ans = read_input($f, $fields->{$f});
$answers->{$f} = $ans;
@@
-470,6
+476,7
@@
sub buchung_input
$answers->{tax_percent},
$answers->{tax_assigned},
$answers->{price},
$answers->{tax_percent},
$answers->{tax_assigned},
$answers->{price},
+ $answers->{billing_date},
$answers->{paid});
$weiter = $answers->{weiter};
$answers->{paid});
$weiter = $answers->{weiter};