From: Sven Schöling Date: Thu, 26 Jun 2014 13:10:08 +0000 (+0200) Subject: 2 Warnungen in den Tests beseitigen X-Git-Tag: release-3.2.0beta~411^2~1 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=2536b717d4c7ce36e0bd2a85a6fba9e81d980955;p=kivitendo-erp.git 2 Warnungen in den Tests beseitigen --- diff --git a/SL/DBUpgrade2/Base.pm b/SL/DBUpgrade2/Base.pm index 100652e15..34afeae54 100644 --- a/SL/DBUpgrade2/Base.pm +++ b/SL/DBUpgrade2/Base.pm @@ -90,11 +90,9 @@ sub add_print_templates { croak "File '${src_dir}/$_' does not exist" unless -f "${src_dir}/$_"; } - my $template_dir = $::instance_conf->reload->get_templates; + return 1 unless my $template_dir = $::instance_conf->reload->get_templates; $::lxdebug->message(LXDebug::DEBUG1(), "add_print_templates: template_dir $template_dir"); - return 1 if !$template_dir; - foreach my $src_file (@files) { my $dest_file = $template_dir . '/' . $src_file; diff --git a/SL/Form.pm b/SL/Form.pm index f35327873..7030454d6 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -2365,8 +2365,13 @@ sub get_lists { my $dbh = $self->get_standard_dbh(\%main::myconfig); my ($sth, $query, $ref); - my $vc = $self->{"vc"} eq "customer" ? "customer" : "vendor"; - my $vc_id = $self->{"${vc}_id"}; + my ($vc, $vc_id); + if ($params{contacts} || $params{shipto}) { + $vc = 'customer' if $self->{"vc"} eq "customer"; + $vc = 'vendor' if $self->{"vc"} eq "vendor"; + die "invalid use of get_lists, need 'vc'"; + $vc_id = $self->{"${vc}_id"}; + } if ($params{"contacts"}) { $self->_get_contacts($dbh, $vc_id, $params{"contacts"});