Lieferdatum pro Zeile wurde nach Umstellung auf Template in Rechnungen nicht mehr...
[kivitendo-erp.git] / SL / OE.pm
index f9d5dab..72c11ed 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -415,11 +415,11 @@ sub save {
     $exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{transdate}, ($form->{vc} eq 'customer') ? 'buy' : 'sell');
   }
 
-  $form->{exchangerate} = ($exchangerate) ? $exchangerate : $form->parse_amount($myconfig, $form->{exchangerate});
+  $form->{exchangerate} = $exchangerate || $form->parse_amount($myconfig, $form->{exchangerate});
 
   my $quotation = $form->{type} =~ /_order$/ ? 'f' : 't';
 
-  ($null, $form->{department_id}) = split(/--/, $form->{department});
+  ($null, $form->{department_id}) = split(/--/, $form->{department}) if $form->{department};
 
   # save OE record
   $query =
@@ -620,7 +620,7 @@ sub retrieve {
   my $ref = selectfirst_hashref_query($form, $dbh, $query);
   map { $form->{$_} = $ref->{$_} } keys %$ref;
 
-  ($form->{currency}) = split(/:/, $form->{currencies});
+  ($form->{currency}) = split(/:/, $form->{currencies}) unless ($form->{currency});
 
   # set reqdate if this is an invoice->order conversion. If someone knows a better check to ensure
   # we come from invoices, feel free.