X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIR.pm;h=301fe3b646e8ebc5e9cbe82f95e031c32d289658;hb=a607a2d0854ef2b2e85bff4ab9657166236129c0;hp=b3c99b829514a7a413caded520a2b62cca8eb206;hpb=b53c93926a26aeca51e097d2599841e33a1da6a3;p=kivitendo-erp.git diff --git a/SL/IR.pm b/SL/IR.pm index b3c99b829..301fe3b64 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -42,6 +42,7 @@ use SL::DATEV qw(:CONSTANTS); use SL::DBUtils; use SL::DO; use SL::GenericTranslations; +use SL::HTML::Restrict; use SL::IO; use SL::MoreCommon; use SL::DB::Default; @@ -56,6 +57,8 @@ sub post_invoice { # connect to database, turn off autocommit my $dbh = $provided_dbh ? $provided_dbh : $form->dbconnect_noauto($myconfig); + my $restricter = SL::HTML::Restrict->create; + $form->{defaultcurrency} = $form->get_default_currency($myconfig); my $defaultcurrency = $form->{defaultcurrency}; @@ -210,7 +213,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 @@ -378,7 +381,7 @@ sub post_invoice { project_id, serialnumber, price_factor_id, price_factor, marge_price_factor) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, (SELECT factor FROM price_factors WHERE id = ?), ?)|; @values = ($invoice_id, conv_i($form->{id}), conv_i($form->{"id_$i"}), - $form->{"description_$i"}, $form->{"longdescription_$i"}, $form->{"qty_$i"} * -1, + $form->{"description_$i"}, $restricter->process($form->{"longdescription_$i"}), $form->{"qty_$i"} * -1, $baseqty * -1, $form->{"sellprice_$i"}, $fxsellprice, $form->{"discount_$i"}, $allocated, $form->{"unit_$i"}, conv_date($form->{deliverydate}), conv_i($form->{"project_id_$i"}), $form->{"serialnumber_$i"},