$dbh->disconnect();
$exchangerate = 1 if ($exchangerate == 0);
+ $exchangerate = 1 if ($exchangerate eq "");
$main::lxdebug->leave_sub();
$key = "all_customers" unless ($key);
- my $query = qq|SELECT * FROM customer ORDER BY name|;
+ my $query = qq|SELECT * FROM customer WHERE NOT obsolete ORDER BY name|;
$self->{$key} = selectall_hashref_query($self, $dbh, $query);
$key = "all_vendors" unless ($key);
- my $query = qq|SELECT * FROM vendor ORDER BY name|;
+ my $query = qq|SELECT * FROM vendor WHERE NOT obsolete ORDER BY name|;
$self->{$key} = selectall_hashref_query($self, $dbh, $query);
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();
}