Revision bc40bcab
Von Moritz Bunkus vor mehr als 8 Jahren hinzugefügt
SL/DO.pm | ||
---|---|---|
111 | 111 |
|
112 | 112 |
} elsif ($form->{$vc}) { |
113 | 113 |
push @where, qq|ct.name ILIKE ?|; |
114 |
push @values, '%' . trim($form->{$vc}) . '%';
|
|
114 |
push @values, like($form->{$vc});
|
|
115 | 115 |
} |
116 | 116 |
|
117 | 117 |
if ($form->{"cp_name"}) { |
118 | 118 |
push @where, "(cp.cp_name ILIKE ? OR cp.cp_givenname ILIKE ?)"; |
119 |
push @values, ('%' . trim($form->{"cp_name"}) . '%')x2;
|
|
119 |
push @values, (like($form->{"cp_name"}))x2;
|
|
120 | 120 |
} |
121 | 121 |
|
122 | 122 |
foreach my $item (qw(employee_id salesman_id)) { |
... | ... | |
132 | 132 |
foreach my $item (qw(donumber ordnumber cusordnumber transaction_description)) { |
133 | 133 |
next unless ($form->{$item}); |
134 | 134 |
push @where, qq|dord.$item ILIKE ?|; |
135 |
push @values, '%' . trim($form->{$item}) . '%';
|
|
135 |
push @values, like($form->{$item});
|
|
136 | 136 |
} |
137 | 137 |
|
138 | 138 |
if (($form->{open} || $form->{closed}) && |
... | ... | |
147 | 147 |
|
148 | 148 |
if ($form->{serialnumber}) { |
149 | 149 |
push @where, 'dord.id IN (SELECT doi.delivery_order_id FROM delivery_order_items doi WHERE doi.serialnumber LIKE ?)'; |
150 |
push @values, '%' . trim($form->{serialnumber}) . '%';
|
|
150 |
push @values, like($form->{serialnumber});
|
|
151 | 151 |
} |
152 | 152 |
|
153 | 153 |
if($form->{transdatefrom}) { |
Auch abrufbar als: Unified diff
(I)LIKE-Argumente immer mit Funktion SL::DBUtils::like erstellen