Patch für Bug 878.
authorSven Schöling <s.schoeling@linet-services.de>
Mon, 4 May 2009 11:59:18 +0000 (11:59 +0000)
committerSven Schöling <s.schoeling@linet-services.de>
Mon, 4 May 2009 11:59:18 +0000 (11:59 +0000)
Department jetzt in sämtlichen OE Masken als department_id und department verfügbar.

SL/OE.pm

index 10d7186..b72b35d 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -34,7 +34,7 @@
 
 package OE;
 
-use List::Util qw(max);
+use List::Util qw(max first);
 
 use SL::AM;
 use SL::Common;
@@ -928,7 +928,8 @@ sub order_details {
 
   push(@project_ids, $form->{"globalproject_id"}) if ($form->{"globalproject_id"});
 
-  $form->get_lists('price_factors' => 'ALL_PRICE_FACTORS');
+  $form->get_lists('price_factors' => 'ALL_PRICE_FACTORS',
+                   'departments'   => 'ALL_DEPARTMENTS');
   my %price_factors;
 
   foreach my $pfac (@{ $form->{ALL_PRICE_FACTORS} }) {
@@ -937,6 +938,9 @@ sub order_details {
     $pfac->{formatted_factor}    = $form->format_amount($myconfig, $pfac->{factor});
   }
 
+  # lookup department
+  $form->{department} = ( first { $_->{id} eq $form->{department_id} } @{ $form->{ALL_DEPARTMENTS} } )->{description} || '';
+
   # sort items by partsgroup
   for $i (1 .. $form->{rowcount}) {
     $partsgroup = "";