Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d16c1b3c

Von Moritz Bunkus vor mehr als 8 Jahren hinzugefügt

  • ID d16c1b3c67ee976a606993e76afc7f8eb3e79ae9
  • Vorgänger d74658f5
  • Nachfolger b3e58871

Lagersuchen: bei Textfeldern führende/anhängende Whitespaces entfernen

Unterschiede anzeigen:

SL/WH.pm
37 37
use SL::AM;
38 38
use SL::DBUtils;
39 39
use SL::Form;
40
use SL::Util qw(trim);
40 41

  
41 42
use SL::DB::Unit;
42 43
use SL::DB::Assembly;
......
329 330

  
330 331
  if ($filter{partnumber}) {
331 332
    push @filter_ary, "p.partnumber ILIKE ?";
332
    push @filter_vars, '%' . $filter{partnumber} . '%';
333
    push @filter_vars, $::form->like($filter{partnumber});
333 334
  }
334 335

  
335 336
  if ($filter{description}) {
336 337
    push @filter_ary, "(p.description ILIKE ?)";
337
    push @filter_vars, '%' . $filter{description} . '%';
338
    push @filter_vars, $::form->like($filter{description});
338 339
  }
339 340

  
340 341
  if ($filter{chargenumber}) {
341 342
    push @filter_ary, "i1.chargenumber ILIKE ?";
342
    push @filter_vars, '%' . $filter{chargenumber} . '%';
343
    push @filter_vars, $::form->like($filter{chargenumber});
343 344
  }
344 345

  
345
  if ($form->{bestbefore}) {
346
  if (trim($form->{bestbefore})) {
346 347
    push @filter_ary, "?::DATE = i1.bestbefore::DATE";
347
    push @filter_vars, $form->{bestbefore};
348
    push @filter_vars, trim($form->{bestbefore});
348 349
  }
349 350

  
350
  if ($form->{fromdate}) {
351
  if (trim($form->{fromdate})) {
351 352
    push @filter_ary, "? <= i1.shippingdate";
352
    push @filter_vars, $form->{fromdate};
353
    push @filter_vars, trim($form->{fromdate});
353 354
  }
354 355

  
355
  if ($form->{todate}) {
356
  if (trim($form->{todate})) {
356 357
    push @filter_ary, "? >= i1.shippingdate";
357
    push @filter_vars, $form->{todate};
358
    push @filter_vars, trim($form->{todate});
358 359
  }
359 360

  
360 361
  if ($form->{l_employee}) {
......
631 632

  
632 633
  if ($filter{partnumber}) {
633 634
    push @filter_ary,  "p.partnumber ILIKE ?";
634
    push @filter_vars, '%' . $filter{partnumber} . '%';
635
    push @filter_vars, $::form->like($filter{partnumber});
635 636
  }
636 637

  
637 638
  if ($filter{description}) {
638 639
    push @filter_ary,  "p.description ILIKE ?";
639
    push @filter_vars, '%' . $filter{description} . '%';
640
    push @filter_vars, $::form->like($filter{description});
640 641
  }
641 642

  
642 643
  if ($filter{partsid}) {
......
646 647

  
647 648
  if ($filter{chargenumber}) {
648 649
    push @filter_ary,  "i.chargenumber ILIKE ?";
649
    push @filter_vars, '%' . $filter{chargenumber} . '%';
650
    push @filter_vars, $::form->like($filter{chargenumber});
650 651
  }
651 652

  
652
  if ($form->{bestbefore}) {
653
  if (trim($form->{bestbefore})) {
653 654
    push @filter_ary, "?::DATE = i.bestbefore::DATE";
654
    push @filter_vars, $form->{bestbefore};
655
    push @filter_vars, trim($form->{bestbefore});
655 656
  }
656 657

  
657 658
  if ($filter{ean}) {
658 659
    push @filter_ary,  "p.ean ILIKE ?";
659
    push @filter_vars, '%' . $filter{ean} . '%';
660
    push @filter_vars, $::form->like($filter{ean});
660 661
  }
661 662

  
662
  if ($filter{date}) {
663
  if (trim($filter{date})) {
663 664
    push @filter_ary, "i.shippingdate <= ?";
664
    push @filter_vars, $filter{date};
665
    push @filter_vars, trim($filter{date});
665 666
  }
666 667
  if (!$filter{include_invalid_warehouses}){
667 668
    push @filter_ary,  "NOT (w.invalid)";

Auch abrufbar als: Unified diff