exchangerate bei Order erst nach transdate und currency_id setzen
authorFelix Eichler <felix.eichler@opendynamic.de>
Mon, 15 Apr 2019 08:57:46 +0000 (10:57 +0200)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Mon, 27 Jul 2020 13:24:59 +0000 (15:24 +0200)
(cherry picked from commit 7d76676faf4c3a4d71fc5df449365374a9997995)
(cherry pick von odyn)

SL/Controller/Order.pm

index 5419847..5363e18 100644 (file)
@@ -1372,6 +1372,7 @@ sub make_order {
 
   my $form_orderitems               = delete $::form->{order}->{orderitems};
   my $form_periodic_invoices_config = delete $::form->{order}->{periodic_invoices_config};
+  my $exchangerate                  = delete $::form->{order}->{exchangerate};
 
   $order->assign_attributes(%{$::form->{order}});
 
@@ -1380,6 +1381,9 @@ sub make_order {
     $periodic_invoices_config->assign_attributes(%$periodic_invoices_config_attrs);
   }
 
+  # set exchangerate after transdate and currency_id
+  $order->assign_attributes(exchangerate => $exchangerate);
+
   # remove deleted items
   $self->item_ids_to_delete([]);
   foreach my $idx (reverse 0..$#{$order->orderitems}) {