Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 88dea78e

Von Moritz Bunkus vor etwa 8 Jahren hinzugefügt

  • ID 88dea78ecdb77761f71c5016ca97e53b2d55d9d3
  • Vorgänger abc7a54c
  • Nachfolger 061f4d6d

Einkaufs-/Verkaufssuchen: bei Textfeldern führende/anhängende Whitespaces entfernen

Unterschiede anzeigen:

SL/OE.pm
50 50
use SL::HTML::Restrict;
51 51
use SL::IC;
52 52
use SL::TransNumber;
53
use SL::Util qw(trim);
53 54
use Text::ParseWords;
54 55

  
55 56
use strict;
......
172 173

  
173 174
  } elsif ($form->{$vc}) {
174 175
    $query .= " AND ct.name ILIKE ?";
175
    push(@values, '%' . $form->{$vc} . '%');
176
    push(@values, '%' . trim($form->{$vc}) . '%');
176 177
  }
177 178

  
178 179
  if ($form->{"cp_name"}) {
179 180
    $query .= " AND (cp.cp_name ILIKE ? OR cp.cp_givenname ILIKE ?)";
180
    push(@values, ('%' . $form->{"cp_name"} . '%')x2);
181
    push(@values, ('%' . trim($form->{"cp_name"}) . '%')x2);
181 182
  }
182 183

  
183 184
  if (!$main::auth->assert('sales_all_edit', 1)) {
......
208 209

  
209 210
  if ($form->{$ordnumber}) {
210 211
    $query .= qq| AND o.$ordnumber ILIKE ?|;
211
    push(@values, '%' . $form->{$ordnumber} . '%');
212
    push(@values, '%' . trim($form->{$ordnumber}) . '%');
212 213
  }
213 214

  
214 215
  if ($form->{cusordnumber}) {
215 216
    $query .= qq| AND o.cusordnumber ILIKE ?|;
216
    push(@values, '%' . $form->{cusordnumber} . '%');
217
    push(@values, '%' . trim($form->{cusordnumber}) . '%');
217 218
  }
218 219

  
219 220
  if($form->{transdatefrom}) {
......
248 249

  
249 250
  if ($form->{shippingpoint}) {
250 251
    $query .= qq| AND o.shippingpoint ILIKE ?|;
251
    push(@values, '%' . $form->{shippingpoint} . '%');
252
    push(@values, '%' . trim($form->{shippingpoint}) . '%');
252 253
  }
253 254

  
254 255
  if ($form->{taxzone_id} ne '') { # taxzone_id could be 0
......
258 259

  
259 260
  if ($form->{transaction_description}) {
260 261
    $query .= qq| AND o.transaction_description ILIKE ?|;
261
    push(@values, '%' . $form->{transaction_description} . '%');
262
    push(@values, '%' . trim($form->{transaction_description}) . '%');
262 263
  }
263 264

  
264 265
  if ($form->{periodic_invoices_active} ne $form->{periodic_invoices_inactive}) {
......
273 274
  if (($form->{order_probability_value} || '') ne '') {
274 275
    my $op  = $form->{order_probability_value} eq 'le' ? '<=' : '>=';
275 276
    $query .= qq| AND (o.order_probability ${op} ?)|;
276
    push @values, $form->{order_probability_value};
277
    push @values, trim($form->{order_probability_value});
277 278
  }
278 279

  
279 280
  if ($form->{expected_billing_date_from}) {

Auch abrufbar als: Unified diff