X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/2efc8cbcc63c56094e0692067b7cb678c1583987..ab96e204a2beec2302b1850df50f45a6e67a13c4:/SL/IC.pm diff --git a/SL/IC.pm b/SL/IC.pm index f5a1db979..f69e98ce2 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -1174,9 +1174,6 @@ sub all_parts { push(@assemblies, $ref); } $sth->finish; - - push(@assemblies, { id => $item->{id} }); - } # copy assemblies to $form->{parts} @@ -1535,13 +1532,13 @@ sub follow_account_chain { sub retrieve_accounts { $main::lxdebug->enter_sub(2); - my ($self, $myconfig, $form, $parts_id, $index, $copy_accnos) = @_; + my ($self, $myconfig, $form, $parts_id, $index) = @_; my ($query, $sth, $dbh); $form->{"taxzone_id"} *= 1; - $dbh = $form->dbconnect($myconfig); + $dbh = $form->get_standard_dbh($myconfig); my $transdate = ""; if ($form->{type} eq "invoice") { @@ -1550,7 +1547,7 @@ sub retrieve_accounts { } else { $transdate = $form->{deliverydate}; } - } elsif ($form->{type} eq "credit_note") { + } elsif (($form->{type} eq "credit_note") || ($form->{script} eq 'ir.pl')) { $transdate = $form->{invdate}; } else { $transdate = $form->{transdate}; @@ -1579,10 +1576,7 @@ sub retrieve_accounts { qq|WHERE p.id = ?|; my $ref = selectfirst_hashref_query($form, $dbh, $query, $parts_id); - if (!$ref) { - $dbh->disconnect(); - return $main::lxdebug->leave_sub(2); - } + return $main::lxdebug->leave_sub(2) if (!$ref); $ref->{"inventory_accno_id"} = undef unless ($ref->{"is_part"});