X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/03d3d025ea4c8bea085fc7cdf1fe7be0b513eb63..71d1fccd416499c24500f33d04651ac83a8d232c:/bin/mozilla/is.pl diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index b8851ff6a..cf3ac5768 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; @@ -377,6 +378,7 @@ sub form_header { shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax shiptoemail shiptodepartment_1 shiptodepartment_2 shiptocp_gender message email subject cc bcc taxaccounts cursor_fokus convert_from_do_ids convert_from_oe_ids + show_details ), @custom_hiddens, map { $_.'_rate', $_.'_description', $_.'_taxnumber' } split / /, $form->{taxaccounts}]; @@ -842,6 +844,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 +862,7 @@ sub storno { $form->{storno} = 1; $form->{id} = ""; $form->{invnumber} = "Storno zu " . $form->{invnumber}; + $form->{invdate} = DateTime->today->to_lxoffice; $form->{rowcount}++; post();