sub create_links {
$main::lxdebug->enter_sub();
- my ($self, $module, $myconfig, $table) = @_;
+ my ($self, $module, $myconfig, $table, $provided_dbh) = @_;
my ($fld, $arap);
if ($table eq "customer") {
# get last customers or vendors
my ($query, $sth, $ref);
- my $dbh = $self->dbconnect($myconfig);
+ my $dbh = $provided_dbh ? $provided_dbh : $self->dbconnect($myconfig);
my %xkeyref = ();
if (!$self->{id}) {
}
- $dbh->disconnect;
+ $dbh->disconnect() unless $provided_dbh;
$main::lxdebug->leave_sub();
}