X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/7e7a13692ac4dd952cf85a972d2919eed80edca1..ee932f3f74983a16977a6d89314a3ab09df20faa:/SL/IR.pm diff --git a/SL/IR.pm b/SL/IR.pm index d8569acaa..444dffceb 100644 --- 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($form->{"sellprice_$i"}), conv_i($form->{"id_$i"})); + @values = (abs($form->{"sellprice_$i"} / $basefactor), conv_i($form->{"id_$i"})); do_query($form, $dbh, $query, @values); # check if we sold the item already and @@ -338,7 +338,7 @@ sub post_invoice { # update lastcost $query = qq|UPDATE parts SET lastcost = ? WHERE id = ?|; - do_query($form, $dbh, $query, $form->{"sellprice_$i"}, conv_i($form->{"id_$i"})); + do_query($form, $dbh, $query, $form->{"sellprice_$i"} / $basefactor, conv_i($form->{"id_$i"})); } next if $payments_only;