Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5067d7bd

Von Martin Helmling martin.helmling@octosoft.eu vor mehr als 7 Jahren hinzugefügt

  • ID 5067d7bd31514962af9730b33323b831d87164f8
  • Vorgänger 351de256
  • Nachfolger 815c3639

Artikel-Klassifizierung

Die ursprünglich als "Artikeltyp" bezeichnete Klassifizierung von Artikeln
Sie dient einer weiteren Gliederung um zum Beispiel den Einkauf vom Verkauf zu trennen, etc.

Gekennzeichnet durch eine Beschreibung (z.B. "Einkauf") und ein Kürzel (z.B. "E")
Flexibel änderbar und erweiterbar.

- Neue Datenbanktablle und Rose-Objekte, sowie Controller zum Bearbeiten der Tabelle

- Zwei-Zeichen Abkürzung:

Der Typ des Artikel und die Klassifizierung werden durch zwei Buchstaben dargestellt.
Der erste Buchstabe ist eine Lokalisierung des Typs des Artikel ('P','A','S') ,
deutch 'W', 'E', und 'D' für Ware Erzeugnis oder Dienstleistung, ggf. weitere Typen.
Der zweite Buchstabe ist eine Lokalisierung der Klassifizierungsabkürzung (abbreviation).

Die Abkürzungen sind aus dem Part Presenter abholbar:
- SL::Presenter::Part->type_abbreviation($part_type)
- SL::Presenter::Part->classification_abbreviation($classification_id)

Wenn im ERP-Dokument nach einer Artikelnummer oder Beschreibung gesucht wird,
diese in den Stammdaten vorhanden ist,
aber der Artikeltyp leer oder falsch ist, bzw im Typ for_purchase bzw for_sale nicht gesetzt ist,
wird die Fehlermeldung "Gesuchter Artikel ist nicht für den Einkauf bzw Verkauf" gemeldet

Anpassung des CSV Import,
nun wird alternativ zur 'type'-Spalte die 'pclass'-Spalte mit zwei Buchstaben geparsed und entsprechend
classification_id,assembly sowie inventory_accno_id gesetzt (oder type_id falls neue Implementierung eingebaut).

Unterschiede anzeigen:

SL/IC.pm
85 85
    # retrieve assembly items
86 86
    $query =
87 87
      qq|SELECT p.id, p.partnumber, p.description,
88
           p.classification_id,
88 89
           p.sellprice, p.lastcost, p.weight, a.qty, a.bom, p.unit,
89 90
           pg.partsgroup, p.price_factor_id, pfac.factor AS price_factor
90 91
         FROM parts p
......
101 102
      foreach my $key (keys %{$ref}) {
102 103
        $form->{"${key}_$form->{assembly_rows}"} = $ref->{$key};
103 104
      }
105
      $form->{"type_and_classific_$form->{assembly_rows}"} = $::request->presenter->type_abbreviation($ref->{part_type}).
106
                                                             $::request->presenter->classification_abbreviation($ref->{classification_id});
104 107
    }
105 108
    $sth->finish;
106 109

  
......
334 337
         partnumber = ?,
335 338
         description = ?,
336 339
         makemodel = ?,
340
         classification_id = ?,
337 341
         listprice = ?,
338 342
         sellprice = ?,
339 343
         lastcost = ?,
......
367 371
  @values = ($form->{partnumber},
368 372
             $form->{description},
369 373
             $makemodel ? 't' : 'f',
374
             $form->{classification_id},
370 375
             $form->{listprice},
371 376
             $form->{sellprice},
372 377
             $form->{lastcost},
......
642 647

  
643 648
  my $query =
644 649
    qq|SELECT p.id, p.partnumber, p.description, p.sellprice,
650
       p.classification_id,
645 651
       p.weight, p.onhand, p.unit, pg.partsgroup, p.lastcost,
646 652
       p.price_factor_id, pfac.factor AS price_factor, p.notes as longdescription
647 653
       FROM parts p
......
723 729
#  my @other_flags          = qw(onhand); # ToDO: implement these
724 730
#  my @inactive_flags       = qw(l_subtotal short l_linetotal);
725 731

  
726
  my @select_tokens = qw(id factor);
732
  my @select_tokens = qw(id factor part_type classification_id);
727 733
  my @where_tokens  = qw(1=1);
728 734
  my @group_tokens  = ();
729 735
  my @bind_vars     = ();
......
800 806
    insertdate         => 'itime::DATE',
801 807
  );
802 808

  
803
  if (($form->{searchitems} eq 'assembly') && $form->{l_lastcost}) {
809
  if ($form->{l_assembly} && $form->{l_lastcost}) {
804 810
    @simple_l_switches = grep { $_ ne 'lastcost' } @simple_l_switches;
805 811
  }
806 812

  
......
890 896
    push @select_tokens, $_;
891 897
  }
892 898

  
893
  for ($form->{searchitems}) {
894
    push @where_tokens, "p.part_type = 'part'"     if /part/;
895
    push @where_tokens, "p.part_type = 'service'"  if /service/;
896
    push @where_tokens, "p.part_type = 'assembly'" if /assembly/;
899
  # Oder Bedingungen fuer Ware Dienstleistung Erzeugnis:
900
  if ($form->{l_part} || $form->{l_assembly} || $form->{l_service}) {
901
      my @or_tokens = ();
902
      push @or_tokens, "p.part_type = 'service'"  if $form->{l_service};
903
      push @or_tokens, "p.part_type = 'assembly'" if $form->{l_assembly};
904
      push @or_tokens, "p.part_type = 'part'"     if $form->{l_part};
905
      push @where_tokens, join ' OR ', map { "($_)" } @or_tokens;
906
  }
907
  else {
908
      # gar keine Teile
909
      push @where_tokens, q|'F' = 'T'|;
910
  }
911

  
912
  if ( $form->{classification_id} > 0 ) {
913
    push @where_tokens, "p.classification_id = ?";
914
    push @bind_vars, $form->{classification_id};
897 915
  }
898 916

  
899 917
  for ($form->{itemstatus}) {
......
951 969

  
952 970
  push @select_tokens, @qsooqr_flags, 'quotation', 'cv', 'ioi.id', 'ioi.ioi'  if $bsooqr;
953 971
  push @select_tokens, @deliverydate_flags                                    if $bsooqr && $form->{l_deliverydate};
954
  push @select_tokens, $q_assembly_lastcost                                   if ($form->{searchitems} eq 'assembly') && $form->{l_lastcost};
972
  push @select_tokens, $q_assembly_lastcost                                   if $form->{l_assembly} && $form->{l_lastcost};
955 973
  push @bsooqr_tokens, q|module = 'ir' AND NOT ioi.assemblyitem|              if $form->{bought};
956 974
  push @bsooqr_tokens, q|module = 'is' AND NOT ioi.assemblyitem|              if $form->{sold};
957 975
  push @bsooqr_tokens, q|module = 'oe' AND NOT quotation AND cv = 'customer'| if $form->{ordered};
......
1049 1067
  # post processing for assembly parts lists (bom)
1050 1068
  # for each part get the assembly parts and add them into the partlist.
1051 1069
  my @assemblies;
1052
  if ($form->{searchitems} eq 'assembly' && $form->{bom}) {
1070
  if ($form->{l_assembly} && $form->{bom}) {
1053 1071
    $query =
1054 1072
      qq|SELECT p.id, p.partnumber, p.description, a.qty AS onhand,
1055 1073
           p.unit, p.notes, p.itime::DATE as insertdate,
......
1079 1097
    $form->{parts} = \@assemblies;
1080 1098
  }
1081 1099

  
1082
  if ($form->{l_pricegroups} ) {
1100
  if ($form->{l_pricegroups} && SL::DB::Manager::Price->get_all_count() > 0 ) {
1083 1101
    my $query = <<SQL;
1084 1102
       SELECT parts_id, price, pricegroup_id
1085 1103
       FROM prices
......
1096 1114
      }
1097 1115
      $sth->finish;
1098 1116
    }
1099
  };
1100

  
1117
  }
1101 1118

  
1102 1119
  $main::lxdebug->leave_sub();
1103 1120

  
......
1393 1410
  }
1394 1411

  
1395 1412
  my $query =
1396
    qq|SELECT id, partnumber, description, unit, sellprice
1413
    qq|SELECT id, partnumber, description, unit, sellprice,
1414
       classification_id
1397 1415
       FROM parts
1398 1416
       WHERE $where ORDER BY $order|;
1399 1417

  
......
1406 1424
    }
1407 1425

  
1408 1426
    $j++;
1427
    $form->{"type_and_classific_$j"} = $::request->presenter->type_abbreviation($ref->{part_type}).
1428
                                       $::request->presenter->classification_abbreviation($ref->{classification_id});
1409 1429
    $form->{"id_$j"}          = $ref->{id};
1410 1430
    $form->{"partnumber_$j"}  = $ref->{partnumber};
1411 1431
    $form->{"description_$j"} = $ref->{description};
......
1733 1753
  for my $i (1..$rowcount) {
1734 1754
    my $id = $form->{"${prefix}${i}"};
1735 1755
    next unless $id;
1736

  
1737
    push @{ $template_arrays{part_type} },  $parts_by_id{$id}->type;
1756
    my $prt = $parts_by_id{$id};
1757
    my $type_abbr = $::request->presenter->type_abbreviation($prt->part_type);
1758
    push @{ $template_arrays{part_type} }, $type_abbr;
1759
    push @{ $template_arrays{type_and_classific}},  $type_abbr.$::request->presenter->classification_abbreviation($prt->classification_id);
1738 1760
  }
1739 1761

  
1740
  return %template_arrays;
1741 1762
  $main::lxdebug->leave_sub();
1763
  return %template_arrays;
1742 1764
}
1743 1765

  
1744 1766
sub normalize_text_blocks {
......
1760 1782
   $main::lxdebug->leave_sub();
1761 1783
}
1762 1784

  
1763

  
1764 1785
1;

Auch abrufbar als: Unified diff