Konten neu anlegen repariert
[kivitendo-erp.git] / SL / OE.pm
index 1e6a47c..4599443 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -653,7 +653,10 @@ SQL
     $exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{transdate}, ($form->{vc} eq 'customer') ? 'buy' : 'sell');
   }
 
-  $form->{exchangerate} = $exchangerate || $form->parse_amount($myconfig, $form->{exchangerate});
+  # from inputfield (exchangerate) or hidden (forex)
+  my $exchangerate_from_form = $form->{forex} || $form->parse_amount($myconfig, $form->{exchangerate});
+
+  $form->{exchangerate} = $exchangerate || $exchangerate_from_form;
 
   my $quotation = $form->{type} =~ /_order$/ ? 'f' : 't';
 
@@ -693,6 +696,8 @@ SQL
              conv_i($form->{id}));
   do_query($form, $dbh, $query, @values);
 
+  $form->new_lastmtime('oe');
+
   $form->{ordtotal} = $amount;
 
   $form->{name} = $form->{ $form->{vc} };