From 66280da7f9a3536251910aa6053724ea63d8ac5e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 5 May 2009 08:59:28 +0000 Subject: [PATCH] sicherer Algorithmus. --- SL/OE.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SL/OE.pm b/SL/OE.pm index 924ebd6d5..a2759f066 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -938,8 +938,11 @@ sub order_details { } # lookup department - # hallo sven, ich bekomme hier einen internal server error, sehr wahrscheinlich weil bei meinen mandanten keine Abteilungen konfiguriert sind - # $form->{department} = ( first { $_->{id} eq $form->{department_id} } @{ $form->{ALL_DEPARTMENTS} } )->{description} || ''; + foreach my $dept (@{ $form->{ALL_DEPARTMENTS} }) { + next unless $dept->{id} eq $form->{department_id}; + $form->{department} = $dept->{description}; + last; + } # sort items by partsgroup for $i (1 .. $form->{rowcount}) { -- 2.20.1