Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d8acfbcb

Von Bernd Bleßmann vor mehr als 5 Jahren hinzugefügt

  • ID d8acfbcb665b4e13bbea1b90148b4088f55ffc93
  • Vorgänger 1824bb75
  • Nachfolger 489a0f5f

PartPicker nach Kunden- und Lieferanten-Artikel-Nr. suchen und filtern können

Unterschiede anzeigen:

SL/Controller/Part.pm
565 565
  # since we need a second get models instance with different filters for that,
566 566
  # we only modify the original filter temporarily in place
567 567
  if ($::form->{prefer_exact}) {
568
    local $::form->{filter}{'all::ilike'} = delete local $::form->{filter}{'all:substr:multi::ilike'};
568
    local $::form->{filter}{'all::ilike'}                          = delete local $::form->{filter}{'all:substr:multi::ilike'};
569
    local $::form->{filter}{'all_with_makemodel::ilike'}           = delete local $::form->{filter}{'all_with_makemodel:substr:multi::ilike'};
570
    local $::form->{filter}{'all_with_customer_partnumber::ilike'} = delete local $::form->{filter}{'all_with_customer_partnumber:substr:multi::ilike'};
569 571

  
570 572
    my $exact_models = SL::Controller::Helper::GetModels->new(
571 573
      controller   => $self,
js/kivi.Part.js
334 334
    },
335 335
    ajax_data: function(term) {
336 336
      var data = {
337
        'filter.all:substr:multi::ilike': term,
338 337
        current:  this.$real.val(),
339 338
      };
340 339

  
......
356 355
      if (this.o.convertible_unit)
357 356
        data['filter.unit_obj.convertible_to'] = this.o.convertible_unit;
358 357

  
358
      if (this.o.vendor_selector || this.o.customer_selector) {
359
        if (this.o.vendor_selector) {
360
          data['filter.all_with_makemodel:substr:multi::ilike'] = term;
361
          if ($(this.o.vendor_selector).val()) {
362
            data['filter.makemodels.make'] = $(this.o.vendor_selector).val().split(',');
363
          }
364
        }
365
        if (this.o.customer_selector) {
366
          data['filter.all_with_customer_partnumber:substr:multi::ilike'] = term;
367
          if ($(this.o.customer_selector).val()) {
368
            data['filter.customerprices.customer_id'] = $(this.o.customer_selector).val().split(',');
369
          }
370
        }
371
      } else {
372
        data['filter.all:substr:multi::ilike'] = term;
373
      }
374

  
359 375
      return data;
360 376
    },
361 377
    set_item: function(item) {
templates/webpages/part/test_page.html
6 6
<br>
7 7
Alle: <br>
8 8
[% P.part.picker('part_id') %] text<br>
9
Alle mit Lieferanten-Artikel-Nr aller Lieferanten: <br>
10
[% P.hidden_tag('vendor_ids_empty', '') %]
11
[% P.part.picker('part_id', undef, vendor_selector='#vendor_ids_empty') %] text<br>
12
Alle mit Lieferanten-Artikel-Nr bestimmter Lieferanten: <br>
13
[% P.hidden_tag('vendor_ids', '1015,11545') %]
14
[% P.part.picker('part_id', undef, vendor_selector='#vendor_ids') %] text<br>
15
Alle mit Kunden-Artikel-Nr bestimmter Kunden: <br>
16
[% P.hidden_tag('customer_ids', '1323') %]
17
[% P.part.picker('part_id', undef, customer_selector='[name="customer_ids"]') %] text<br>
9 18
Nur Waren: <br>
10 19
[% P.part.picker('part_id2', undef, part_type='part') %]<br>
11 20
Nur Dienstleistungen: <br>

Auch abrufbar als: Unified diff