X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/7783c24d2a5f3f7413dc18d5b96b8a98995ac7da..ab96e204a2beec2302b1850df50f45a6e67a13c4:/SL/IC.pm?ds=sidebyside diff --git a/SL/IC.pm b/SL/IC.pm index ca37bcb8e..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} @@ -1541,7 +1538,7 @@ sub retrieve_accounts { $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"});