Angebote/Aufträge drucken: in order_details übergebene form verwenden …
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Thu, 17 Sep 2015 09:17:55 +0000 (11:17 +0200)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Thu, 17 Sep 2015 09:17:55 +0000 (11:17 +0200)
… und beim Laden des Order-Objekts prüfen, ob eine id vorhanden ist.

SL/OE.pm

index f776d51..0c6d6fc 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -1518,7 +1518,7 @@ sub order_details {
   $form->{delivery_term} = SL::DB::Manager::DeliveryTerm->find_by(id => $form->{delivery_term_id} || undef);
   $form->{delivery_term}->description_long($form->{delivery_term}->translated_attribute('description_long', $form->{language_id})) if $form->{delivery_term} && $form->{language_id};
 
-  $::form->{order} = SL::DB::Manager::Order->find_by(id => $::form->{id});
+  $form->{order} = SL::DB::Manager::Order->find_by(id => $form->{id}) if $form->{id};
 
   $main::lxdebug->leave_sub();
 }