X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/60de0703a74f40f6b49ba7f47fc2b5e54937e5d3..d0a22ba8bf8e2016ab378a27dd149fdd97ecc057:/SL/AP.pm diff --git a/SL/AP.pm b/SL/AP.pm index 08dd54224..e3dc7b31d 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -39,6 +39,7 @@ use SL::DBUtils; use SL::IO; use SL::MoreCommon; use SL::DB::Default; +use SL::Util qw(trim); use Data::Dumper; use strict; @@ -457,7 +458,7 @@ sub ap_transactions { } if ($form->{"cp_name"}) { $where .= " AND (cp.cp_name ILIKE ? OR cp.cp_givenname ILIKE ?)"; - push(@values, ('%' . $form->{"cp_name"} . '%')x2); + push(@values, ('%' . trim($form->{"cp_name"}) . '%')x2); } if ($form->{department}) { # ähnlich wie commit 0bbfb33b6aa8e38bb6c81d1684ab7d08e5b5c5af abteilung @@ -493,11 +494,11 @@ sub ap_transactions { if ($form->{transdatefrom}) { $where .= " AND a.transdate >= ?"; - push(@values, $form->{transdatefrom}); + push(@values, trim($form->{transdatefrom})); } if ($form->{transdateto}) { $where .= " AND a.transdate <= ?"; - push(@values, $form->{transdateto}); + push(@values, trim($form->{transdateto})); } if ($form->{open} || $form->{closed}) { unless ($form->{open} && $form->{closed}) { @@ -811,6 +812,8 @@ sub storno { $query = qq|UPDATE ap SET paid = amount + paid, storno = 't' WHERE id = ?|; do_query($form, $dbh, $query, $id); + $form->new_lastmtime('ap') if $id == $form->{id}; + # now copy acc_trans entries $query = qq|SELECT a.*, c.link FROM acc_trans a LEFT JOIN chart c ON a.chart_id = c.id WHERE a.trans_id = ? ORDER BY a.acc_trans_id|; my $rowref = selectall_hashref_query($form, $dbh, $query, $id);