Bei Belegdruck nicht unkonditional auf Projekte zugreifen
authorSven Schöling <s.schoeling@linet-services.de>
Tue, 7 Jan 2014 15:42:09 +0000 (16:42 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Tue, 7 Jan 2014 15:42:09 +0000 (16:42 +0100)
behebt #2237 (wieder)

SL/DO.pm
SL/IS.pm
SL/OE.pm

index d0086fc..4190383 100644 (file)
--- a/SL/DO.pm
+++ b/SL/DO.pm
@@ -749,10 +749,10 @@ sub order_details {
     %projects_by_id = map { $_->id => $_ } @$projects;
   }
 
-  $form->{globalprojectnumber} = $projects_by_id{$form->{"globalproject_id"}}->projectnumber;
-  $form->{globalprojectdescription} = $projects_by_id{$form->{"globalproject_id"}}->description;
-
   if ($projects_by_id{$form->{"globalproject_id"}}) {
+    $form->{globalprojectnumber} = $projects_by_id{$form->{"globalproject_id"}}->projectnumber;
+    $form->{globalprojectdescription} = $projects_by_id{$form->{"globalproject_id"}}->description;
+
     for (@{ $projects_by_id{$form->{"globalproject_id"}}->cvars_by_config }) {
       $form->{"project_cvar_" . $_->config->name} = $_->value_as_text;
     }
index cd15325..b00e809 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -99,10 +99,10 @@ sub invoice_details {
     %projects_by_id = map { $_->id => $_ } @$projects;
   }
 
-  $form->{globalprojectnumber} = $projects_by_id{$form->{"globalproject_id"}}->projectnumber;
-  $form->{globalprojectdescription} = $projects_by_id{$form->{"globalproject_id"}}->description;
-
   if ($projects_by_id{$form->{"globalproject_id"}}) {
+    $form->{globalprojectnumber} = $projects_by_id{$form->{"globalproject_id"}}->projectnumber;
+    $form->{globalprojectdescription} = $projects_by_id{$form->{"globalproject_id"}}->description;
+
     for (@{ $projects_by_id{$form->{"globalproject_id"}}->cvars_by_config }) {
       $form->{"project_cvar_" . $_->config->name} = $_->value_as_text;
     }
index ae3ff08..797eb97 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -1070,10 +1070,10 @@ sub order_details {
     %projects_by_id = map { $_->id => $_ } @$projects;
   }
 
-  $form->{globalprojectnumber} = $projects_by_id{$form->{"globalproject_id"}}->projectnumber;
-  $form->{globalprojectdescription} = $projects_by_id{$form->{"globalproject_id"}}->description;
-
   if ($projects_by_id{$form->{"globalproject_id"}}) {
+    $form->{globalprojectnumber} = $projects_by_id{$form->{"globalproject_id"}}->projectnumber;
+    $form->{globalprojectdescription} = $projects_by_id{$form->{"globalproject_id"}}->description;
+
     for (@{ $projects_by_id{$form->{"globalproject_id"}}->cvars_by_config }) {
       $form->{"project_cvar_" . $_->config->name} = $_->value_as_text;
     }