From: G. Richardson Date: Thu, 1 Dec 2016 14:08:31 +0000 (+0100) Subject: Part Controller - ic.pl und IC.pm Funktionen entfernt X-Git-Tag: release-3.5.4~1845 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=5239714c7d8af2d633ad05a91648b4dbe432a41e;p=kivitendo-erp.git Part Controller - ic.pl und IC.pm Funktionen entfernt --- diff --git a/SL/IC.pm b/SL/IC.pm index 2cf7996fb..2b3abf63b 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -48,138 +48,6 @@ use Carp; use strict; -sub get_part { - $main::lxdebug->enter_sub(); - - my ($self, $myconfig, $form) = @_; - - # connect to db - my $dbh = $form->get_standard_dbh; - - my $sth; - - my $query = - qq|SELECT p.*, - c1.accno AS inventory_accno, - c2.accno AS income_accno, - c3.accno AS expense_accno, - pg.partsgroup - FROM parts p - LEFT JOIN chart c1 ON (p.inventory_accno_id = c1.id) - LEFT JOIN chart c2 ON (p.income_accno_id = c2.id) - LEFT JOIN chart c3 ON (p.expense_accno_id = c3.id) - LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id) - WHERE p.id = ? |; - my $ref = selectfirst_hashref_query($form, $dbh, $query, conv_i($form->{id})); - - # copy to $form variables - map { $form->{$_} = $ref->{$_} } (keys %{$ref}); - - $form->{mtime} = $form->{itime} if !$form->{mtime}; - $form->{lastmtime} = $form->{mtime}; - $form->{onhand} *= 1; - - # part or service item - if ($form->{part_type} eq 'assembly') { - - # retrieve assembly items - $query = - qq|SELECT p.id, p.partnumber, p.description, - 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 - JOIN assembly a ON (a.parts_id = p.id) - LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id) - LEFT JOIN price_factors pfac ON pfac.id = p.price_factor_id - WHERE (a.id = ?) - ORDER BY a.oid|; - $sth = prepare_execute_query($form, $dbh, $query, conv_i($form->{id})); - - $form->{assembly_rows} = 0; - while (my $ref = $sth->fetchrow_hashref("NAME_lc")) { - $form->{assembly_rows}++; - foreach my $key (keys %{$ref}) { - $form->{"${key}_$form->{assembly_rows}"} = $ref->{$key}; - } - } - $sth->finish; - - } - - # setup accno hash for