From 25e6578102b4f369ef4f52dec49a91a932609dcc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Thu, 4 Sep 2014 12:46:23 +0200 Subject: [PATCH] =?utf8?q?hotfix=20f=C3=BCr=20#10=20Ansprechpartner=20auf?= =?utf8?q?=20ung=C3=BCltig=20setzen=20l=C3=B6st=20leeres=20Adressfeld=20be?= =?utf8?q?im=20Drucken=20aus=20behebt=20(teilweise)=20#9=20ggf.=20w=C3=A4r?= =?utf8?q?e=20es=20prinzipiell=20besser=20die=20customer=5Fdetails=20auf?= =?utf8?q?=20rose=20umzuschreiben?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/IS.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/SL/IS.pm b/SL/IS.pm index 6c5aa9ffe..f6115a81d 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -492,7 +492,18 @@ sub customer_details { ORDER BY cp.cp_id LIMIT 1|; my $ref = selectfirst_hashref_query($form, $dbh, $query, @values); - + # we have no values, probably a invalid contact person. hotfix and first idea for issue #9 + if (!$ref) { + my $customer = SL::DB::Manager::Customer->find_by(id => $::form->{customer_id}); + $ref->{name} = $customer->name; + $ref->{street} = $customer->street; + $ref->{zipcode} = $customer->zipcode; + $ref->{country} = $customer->country; + my $contact = SL::DB::Manager::Contact->find_by(cp_id => $::form->{cp_id}); + $ref->{cp_name} = $contact->cp_name; + $ref->{cp_givenname} = $contact->cp_givenname; + $ref->{cp_gender} = $contact->cp_gender; + } # remove id and taxincluded before copy back delete @$ref{qw(id taxincluded)}; -- 2.20.1