fixed fix #1795.(exchange)
authorRolf Fluehmann <rolf.fluehmann@revamp-it.ch>
Wed, 8 Jan 2014 09:32:00 +0000 (10:32 +0100)
committerRolf Fluehmann <rolf.fluehmann@revamp-it.ch>
Wed, 8 Jan 2014 09:37:32 +0000 (10:37 +0100)
SL/IR.pm

index b3c99b8..e5e02f5 100644 (file)
--- a/SL/IR.pm
+++ b/SL/IR.pm
@@ -210,7 +210,7 @@ sub post_invoice {
 
       # update parts table by setting lastcost to current price, don't allow negative values by using abs
       $query = qq|UPDATE parts SET lastcost = ? WHERE id = ?|;
-      @values = (abs($fxsellprice / $basefactor), conv_i($form->{"id_$i"}));
+      @values = (abs($fxsellprice * $form->{exchangerate} / $basefactor), conv_i($form->{"id_$i"}));
       do_query($form, $dbh, $query, @values);
 
       # check if we sold the item already and