push(@assemblies, $ref);
}
$sth->finish;
-
- push(@assemblies, { id => $item->{id} });
-
}
# copy assemblies to $form->{parts}
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") {
} 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};
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"});