X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/1132e5ed817c03abbe55fe57b98f815ccafb8a3c..bc40bcabc425b99f3b79a5544684a6fe8674adfe:/SL/Form.pm diff --git a/SL/Form.pm b/SL/Form.pm index 5b868ec5e..41cb8612d 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -2499,10 +2499,10 @@ sub get_name { my $where; if ($self->{customernumber} ne "") { $where = qq|(vc.customernumber ILIKE ?)|; - push(@values, '%' . $self->{customernumber} . '%'); + push(@values, like($self->{customernumber})); } else { $where = qq|(vc.name ILIKE ?)|; - push(@values, '%' . $self->{$table} . '%'); + push(@values, like($self->{$table})); } $query = @@ -2519,7 +2519,7 @@ sub get_name { JOIN $table vc ON (a.${table}_id = vc.id) WHERE NOT (a.amount = a.paid) AND (vc.name ILIKE ?) ORDER BY vc.name~; - push(@values, '%' . $self->{$table} . '%'); + push(@values, like($self->{$table})); } $self->{name_list} = selectall_hashref_query($self, $dbh, $query, @values); @@ -2744,7 +2744,7 @@ sub create_links { $sth = $dbh->prepare($query); - do_statement($self, $sth, $query, '%' . $module . '%'); + do_statement($self, $sth, $query, like($module)); $self->{accounts} = ""; while ($ref = $sth->fetchrow_hashref("NAME_lc")) { @@ -2819,7 +2819,7 @@ sub create_links { ORDER BY c.accno|; $sth = $dbh->prepare($query); - do_statement($self, $sth, $query, "%$module%"); + do_statement($self, $sth, $query, like($module)); $self->{accounts} = ""; while ($ref = $sth->fetchrow_hashref("NAME_lc")) { @@ -3010,12 +3010,6 @@ sub current_date { return $thisdate; } -sub like { - my ($self, $string) = @_; - - return "%" . SL::Util::trim($string // '') . "%"; -} - sub redo_rows { $main::lxdebug->enter_sub();