X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/b36f0864f0304deb66f4215c52b68351f90b2309..6e0fe1dc46a643b80c36b21c4cb62c2f09227f45:/SL/IC.pm diff --git a/SL/IC.pm b/SL/IC.pm index f202e8ef3..2cf7996fb 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -85,7 +85,6 @@ sub get_part { # retrieve assembly items $query = qq|SELECT p.id, p.partnumber, p.description, - p.classification_id, p.sellprice, p.lastcost, p.weight, a.qty, a.bom, p.unit, pg.partsgroup, p.price_factor_id, pfac.factor AS price_factor FROM parts p @@ -102,8 +101,6 @@ sub get_part { foreach my $key (keys %{$ref}) { $form->{"${key}_$form->{assembly_rows}"} = $ref->{$key}; } - $form->{"type_and_classific_$form->{assembly_rows}"} = $::request->presenter->type_abbreviation($ref->{part_type}). - $::request->presenter->classification_abbreviation($ref->{classification_id}); } $sth->finish; @@ -337,7 +334,6 @@ sub _save { partnumber = ?, description = ?, makemodel = ?, - classification_id = ?, listprice = ?, sellprice = ?, lastcost = ?, @@ -371,7 +367,6 @@ sub _save { @values = ($form->{partnumber}, $form->{description}, $makemodel ? 't' : 'f', - $form->{classification_id}, $form->{listprice}, $form->{sellprice}, $form->{lastcost}, @@ -647,7 +642,6 @@ sub assembly_item { my $query = qq|SELECT p.id, p.partnumber, p.description, p.sellprice, - p.classification_id, p.weight, p.onhand, p.unit, pg.partsgroup, p.lastcost, p.price_factor_id, pfac.factor AS price_factor, p.notes as longdescription FROM parts p @@ -729,7 +723,7 @@ sub all_parts { # my @other_flags = qw(onhand); # ToDO: implement these # my @inactive_flags = qw(l_subtotal short l_linetotal); - my @select_tokens = qw(id factor part_type classification_id); + my @select_tokens = qw(id factor); my @where_tokens = qw(1=1); my @group_tokens = (); my @bind_vars = (); @@ -806,7 +800,7 @@ sub all_parts { insertdate => 'itime::DATE', ); - if ($form->{l_assembly} && $form->{l_lastcost}) { + if (($form->{searchitems} eq 'assembly') && $form->{l_lastcost}) { @simple_l_switches = grep { $_ ne 'lastcost' } @simple_l_switches; } @@ -896,23 +890,10 @@ sub all_parts { push @select_tokens, $_; } - # Oder Bedingungen fuer Ware Dienstleistung Erzeugnis: - if ($form->{l_part} || $form->{l_assembly} || $form->{l_service} || $form->{l_assortment}) { - my @or_tokens = (); - push @or_tokens, "p.part_type = 'service'" if $form->{l_service}; - push @or_tokens, "p.part_type = 'assembly'" if $form->{l_assembly}; - push @or_tokens, "p.part_type = 'part'" if $form->{l_part}; - push @or_tokens, "p.part_type = 'assortment'" if $form->{l_assortment}; - push @where_tokens, join ' OR ', map { "($_)" } @or_tokens; - } - else { - # gar keine Teile - push @where_tokens, q|'F' = 'T'|; - } - - if ( $form->{classification_id} > 0 ) { - push @where_tokens, "p.classification_id = ?"; - push @bind_vars, $form->{classification_id}; + for ($form->{searchitems}) { + push @where_tokens, "p.part_type = 'part'" if /part/; + push @where_tokens, "p.part_type = 'service'" if /service/; + push @where_tokens, "p.part_type = 'assembly'" if /assembly/; } for ($form->{itemstatus}) { @@ -970,7 +951,7 @@ sub all_parts { push @select_tokens, @qsooqr_flags, 'quotation', 'cv', 'ioi.id', 'ioi.ioi' if $bsooqr; push @select_tokens, @deliverydate_flags if $bsooqr && $form->{l_deliverydate}; - push @select_tokens, $q_assembly_lastcost if $form->{l_assembly} && $form->{l_lastcost}; + push @select_tokens, $q_assembly_lastcost if ($form->{searchitems} eq 'assembly') && $form->{l_lastcost}; push @bsooqr_tokens, q|module = 'ir' AND NOT ioi.assemblyitem| if $form->{bought}; push @bsooqr_tokens, q|module = 'is' AND NOT ioi.assemblyitem| if $form->{sold}; push @bsooqr_tokens, q|module = 'oe' AND NOT quotation AND cv = 'customer'| if $form->{ordered}; @@ -1068,7 +1049,7 @@ sub all_parts { # post processing for assembly parts lists (bom) # for each part get the assembly parts and add them into the partlist. my @assemblies; - if ($form->{l_assembly} && $form->{bom}) { + if ($form->{searchitems} eq 'assembly' && $form->{bom}) { $query = qq|SELECT p.id, p.partnumber, p.description, a.qty AS onhand, p.unit, p.notes, p.itime::DATE as insertdate, @@ -1098,7 +1079,7 @@ sub all_parts { $form->{parts} = \@assemblies; } - if ($form->{l_pricegroups} && SL::DB::Manager::Price->get_all_count() > 0 ) { + if ($form->{l_pricegroups} ) { my $query = <finish; } - } + }; + $main::lxdebug->leave_sub(); @@ -1411,8 +1393,7 @@ sub get_parts { } my $query = - qq|SELECT id, partnumber, description, unit, sellprice, - classification_id + qq|SELECT id, partnumber, description, unit, sellprice FROM parts WHERE $where ORDER BY $order|; @@ -1425,8 +1406,6 @@ sub get_parts { } $j++; - $form->{"type_and_classific_$j"} = $::request->presenter->type_abbreviation($ref->{part_type}). - $::request->presenter->classification_abbreviation($ref->{classification_id}); $form->{"id_$j"} = $ref->{id}; $form->{"partnumber_$j"} = $ref->{partnumber}; $form->{"description_$j"} = $ref->{description}; @@ -1754,14 +1733,12 @@ sub prepare_parts_for_printing { for my $i (1..$rowcount) { my $id = $form->{"${prefix}${i}"}; next unless $id; - my $prt = $parts_by_id{$id}; - my $type_abbr = $::request->presenter->type_abbreviation($prt->part_type); - push @{ $template_arrays{part_type} }, $type_abbr; - push @{ $template_arrays{type_and_classific}}, $type_abbr.$::request->presenter->classification_abbreviation($prt->classification_id); + + push @{ $template_arrays{part_type} }, $parts_by_id{$id}->type; } - $main::lxdebug->leave_sub(); return %template_arrays; + $main::lxdebug->leave_sub(); } sub normalize_text_blocks { @@ -1783,4 +1760,5 @@ sub normalize_text_blocks { $main::lxdebug->leave_sub(); } + 1;