X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/621a9c99b6f79437c69510d2bbd63c3184daf4d2..88dea78ecdb77761f71c5016ca97e53b2d55d9d3:/SL/DO.pm diff --git a/SL/DO.pm b/SL/DO.pm index 7db091011..b098f71e0 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -46,6 +46,7 @@ use SL::HTML::Restrict; use SL::RecordLinks; use SL::IC; use SL::TransNumber; +use SL::Util qw(trim); use strict; @@ -110,12 +111,12 @@ sub transactions { } elsif ($form->{$vc}) { push @where, qq|ct.name ILIKE ?|; - push @values, '%' . $form->{$vc} . '%'; + push @values, '%' . trim($form->{$vc}) . '%'; } if ($form->{"cp_name"}) { push @where, "(cp.cp_name ILIKE ? OR cp.cp_givenname ILIKE ?)"; - push @values, ('%' . $form->{"cp_name"} . '%')x2; + push @values, ('%' . trim($form->{"cp_name"}) . '%')x2; } foreach my $item (qw(employee_id salesman_id)) { @@ -131,7 +132,7 @@ sub transactions { foreach my $item (qw(donumber ordnumber cusordnumber transaction_description)) { next unless ($form->{$item}); push @where, qq|dord.$item ILIKE ?|; - push @values, '%' . $form->{$item} . '%'; + push @values, '%' . trim($form->{$item}) . '%'; } if (($form->{open} || $form->{closed}) && @@ -146,7 +147,7 @@ sub transactions { if ($form->{serialnumber}) { push @where, 'dord.id IN (SELECT doi.delivery_order_id FROM delivery_order_items doi WHERE doi.serialnumber LIKE ?)'; - push @values, '%' . $form->{serialnumber} . '%'; + push @values, '%' . trim($form->{serialnumber}) . '%'; } if($form->{transdatefrom}) { @@ -477,6 +478,8 @@ SQL conv_i($form->{id})); do_query($form, $dbh, $query, @values); + $form->new_lastmtime('delivery_orders'); + $form->{name} = $form->{ $form->{vc} }; $form->{name} =~ s/--$form->{"$form->{vc}_id"}//; @@ -605,6 +608,7 @@ sub close_orders { do_query($form, $dbh, $query, map { conv_i($_) } @{ $params{ids} }); $dbh->commit() unless ($params{dbh}); + $form->new_lastmtime('delivery_orders'); $main::lxdebug->leave_sub(); }