X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIR.pm;h=444dffceba7e4c40ee20d661cdf09da5a916fbbd;hb=20366719c9a10a765a7b1e852abd6ce0ddb11034;hp=d8569acaa9f2bd6b4da55c6730af045f55e09b66;hpb=7e7a13692ac4dd952cf85a972d2919eed80edca1;p=kivitendo-erp.git 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;