X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/93bbc35bb2ceb067c28e807f7946b73ed31f4a49..211de9e3a7748d80cada65e5dde13a41b9e3f749:/SL/IR.pm diff --git a/SL/IR.pm b/SL/IR.pm index 7f4389ffa..edf55f16a 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -207,9 +207,9 @@ sub post_invoice { next if $payments_only; - # update parts table + # 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 = ($form->{"sellprice_$i"}, conv_i($form->{"id_$i"})); + @values = (abs($form->{"sellprice_$i"}), conv_i($form->{"id_$i"})); do_query($form, $dbh, $query, @values); # check if we sold the item already and