From 2536b717d4c7ce36e0bd2a85a6fba9e81d980955 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 26 Jun 2014 15:10:08 +0200 Subject: [PATCH] 2 Warnungen in den Tests beseitigen --- SL/DBUpgrade2/Base.pm | 4 +--- SL/Form.pm | 9 +++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) 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"}); -- 2.20.1