X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIR.pm;h=edf55f16a978361715f8ac839a6783558e0003b2;hb=b948bb619c8086b8f05aac962d44d075aea17822;hp=7f4389ffa0f5124166db3246bb9e0c0da3882877;hpb=d3f36130edba973c28347249be8d88133dc9fff7;p=kivitendo-erp.git 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