X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/03d3d025ea4c8bea085fc7cdf1fe7be0b513eb63..451ad2fcf0c051f1b0c3b1a12b6b27ef45a3e7a9:/bin/mozilla/is.pl diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index b8851ff6a..d67aac59d 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -36,6 +36,7 @@ use SL::IS; use SL::PE; use SL::OE; use Data::Dumper; +use DateTime; use List::Util qw(max sum); use SL::DB::Default; @@ -842,6 +843,9 @@ sub storno { if (IS->has_storno(\%myconfig, $form, "ar")) { $form->error($locale->text("Invoice has already been storno'd!")); } + if ($form->datetonum($form->{invdate}, \%myconfig) <= $form->datetonum($form->{closedto}, \%myconfig)) { + $form->error($locale->text('Cannot storno invoice for a closed period!')); + } map({ my $key = $_; delete($form->{$key}) unless (grep({ $key eq $_ } qw(id login password type))); } keys(%{ $form })); @@ -857,6 +861,7 @@ sub storno { $form->{storno} = 1; $form->{id} = ""; $form->{invnumber} = "Storno zu " . $form->{invnumber}; + $form->{invdate} = DateTime->today->to_lxoffice; $form->{rowcount}++; post();