} elsif ($form->{$vc}) {
push @where, qq|ct.name ILIKE ?|;
- push @values, '%' . trim($form->{$vc}) . '%';
+ push @values, like($form->{$vc});
}
if ($form->{"cp_name"}) {
push @where, "(cp.cp_name ILIKE ? OR cp.cp_givenname ILIKE ?)";
- push @values, ('%' . trim($form->{"cp_name"}) . '%')x2;
+ push @values, (like($form->{"cp_name"}))x2;
}
foreach my $item (qw(employee_id salesman_id)) {
foreach my $item (qw(donumber ordnumber cusordnumber transaction_description)) {
next unless ($form->{$item});
push @where, qq|dord.$item ILIKE ?|;
- push @values, '%' . trim($form->{$item}) . '%';
+ push @values, like($form->{$item});
}
if (($form->{open} || $form->{closed}) &&
if ($form->{serialnumber}) {
push @where, 'dord.id IN (SELECT doi.delivery_order_id FROM delivery_order_items doi WHERE doi.serialnumber LIKE ?)';
- push @values, '%' . trim($form->{serialnumber}) . '%';
+ push @values, like($form->{serialnumber});
}
if($form->{transdatefrom}) {