$key = "all_contacts" unless ($key);
+ if (!$id) {
+ $self->{$key} = [];
+ $main::lxdebug->leave_sub();
+ return;
+ }
+
my $query =
qq|SELECT cp_id, cp_cv_id, cp_name, cp_givenname, cp_abteilung | .
qq|FROM contacts | .
$key = "all_shipto" unless ($key);
- # get shipping addresses
- my $query = qq|SELECT * FROM shipto WHERE trans_id = ?|;
+ if ($vc_id) {
+ # get shipping addresses
+ my $query = qq|SELECT * FROM shipto WHERE trans_id = ?|;
- $self->{$key} = selectall_hashref_query($self, $dbh, $query, $vc_id);
+ $self->{$key} = selectall_hashref_query($self, $dbh, $query, $vc_id);
+
+ } else {
+ $self->{$key} = [];
+ }
$main::lxdebug->leave_sub();
}