Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision fcde4c20

Von Kivitendo Admin vor etwa 8 Jahren hinzugefügt

  • ID fcde4c2096c1494984940ddc4650e49933471dd9
  • Vorgänger 8b2c6778
  • Nachfolger 73b9848f

Ware/Erzeugnis/Dienstleistung per parts.part_type unterscheiden 2

kivitendo Code angepasst.

Unterschiede anzeigen:

SL/DB/Manager/Part.pm
33 33

  
34 34
  $prefix //= '';
35 35

  
36
  # this is to make selection like type => { part => 1, service => 1 } work
36
  # this is to make selections like part_type => { part => 1, service => 1 } work
37 37
  if ('HASH' eq ref $type) {
38 38
    $type = [ grep { $type->{$_} } keys %$type ];
39 39
  }
......
43 43

  
44 44
  for my $type (@types) {
45 45
    if ($type =~ m/^part/) {
46
      push @filter, (and => [ or                             => [ $prefix . assembly => 0, $prefix . assembly => undef ],
47
                              "!${prefix}inventory_accno_id" => 0,
48
                              "!${prefix}inventory_accno_id" => undef,
49
                     ]);
46
      push @filter, ($prefix . part_type => 'part');
50 47
    } elsif ($type =~ m/^service/) {
51
      push @filter, (and => [ or => [ $prefix . assembly           => 0, $prefix . assembly           => undef ],
52
                              or => [ $prefix . inventory_accno_id => 0, $prefix . inventory_accno_id => undef ],
53
                     ]);
54
    } elsif ($type =~ m/^assembl/) {
55
      push @filter, ($prefix . assembly => 1);
48
      push @filter, ($prefix . part_type => 'service');
49
    } elsif ($type =~ m/^assembly/) {
50
      push @filter, ($prefix . part_type => 'assembly');
56 51
    }
57 52
  }
58 53

  

Auch abrufbar als: Unified diff