Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ab80e40b

Von Bernd Bleßmann vor mehr als 1 Jahr hinzugefügt

  • ID ab80e40b28092259b68dca599c3c60db3427b32c
  • Vorgänger ed44b787
  • Nachfolger 79d1a2cd

Erweiterung für Artikelnummern nach Kunden-/Lieferanten-Typ (business).

Suche im Bericht und Import sind (noch) nicht implementiert.

Unterschiede anzeigen:

SL/IC.pm
909 909

  
910 910
  $sth->finish();
911 911

  
912

  
913
  $query            = qq|SELECT bm.parts_id,
914
                         bm.model                AS business_model,
915
                         bm.part_description     AS bm_part_description,
916
                         bm.part_longdescription AS bm_part_longdescription,
917
                         b.description           AS business_make
918
                         FROM business_models bm
919
                         LEFT JOIN business b ON (bm.business_id = b.id)
920
                         WHERE bm.parts_id IN ($placeholders)|;
921

  
922
  my %businessmodel = ();
923

  
924
  $sth              = prepare_execute_query($form, $dbh, $query, @part_ids);
925

  
926
  while (my $ref = $sth->fetchrow_hashref()) {
927
    $businessmodel{$ref->{parts_id}} ||= [];
928
    push @{ $businessmodel{$ref->{parts_id}} }, $ref;
929
  }
930

  
931
  $sth->finish();
932

  
912 933
  $query           = qq|SELECT
913 934
                        cp.parts_id,
914 935
                        cp.customer_partnumber  AS customer_model,
......
939 960
  my %data    = selectall_as_map($form, $dbh, $query, 'id', \@columns, @part_ids);
940 961

  
941 962
  my %template_arrays;
942
  map { $template_arrays{$_} = [] } (qw(make model mm_part_description mm_part_longdescription customer_make customer_model cm_part_description cm_part_longdescription), @columns);
963
  map { $template_arrays{$_} = [] } (qw(make model mm_part_description mm_part_longdescription business_make business_model bm_part_description bm_part_longdescription customer_make customer_model cm_part_description cm_part_longdescription), @columns);
943 964

  
944 965
  foreach my $i (1 .. $rowcount) {
945 966
    my $id = $form->{"${prefix}${i}"};
......
961 982
      }
962 983
    }
963 984

  
985
    push @{ $template_arrays{business_make} },           [];
986
    push @{ $template_arrays{business_model} },          [];
987
    push @{ $template_arrays{bm_part_description} },     [];
988
    push @{ $template_arrays{bm_part_longdescription} }, [];
989

  
990
    if ($businessmodel{$id}) {
991
      foreach my $ref (@{ $businessmodel{$id} }) {
992
        map { push @{ $template_arrays{$_}->[-1] }, $ref->{$_} } qw(business_make business_model bm_part_description bm_part_longdescription);
993
      }
994
    }
995

  
964 996
    push @{ $template_arrays{customer_make} },  [];
965 997
    push @{ $template_arrays{customer_model} }, [];
966 998
    push @{ $template_arrays{cm_part_description} },     [];

Auch abrufbar als: Unified diff