X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FIR.pm;h=931df6b4487849d59318ca6814843200f7f7df65;hb=0152cc2e4e1e451cb51d4d3fd8a0e450eff5efcb;hp=e5e02f5bed4ce480dd0adc25d67e1f353cc296b1;hpb=efb9a24f2252104ab4af5c25334119d7c5c70a8c;p=kivitendo-erp.git diff --git a/SL/IR.pm b/SL/IR.pm index e5e02f5be..931df6b44 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}; @@ -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"}, @@ -717,9 +720,10 @@ sub post_invoice { } - # add shipto $form->{name} = $form->{vendor}; $form->{name} =~ s/--\Q$form->{vendor_id}\E//; + + # add shipto $form->add_shipto($dbh, $form->{id}, "AP"); # delete zero entries @@ -1123,16 +1127,6 @@ sub get_vendor { } $sth->finish(); - # get shipto if we do not convert an order or invoice - if (!$params->{shipto}) { - delete @{$params}{qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax shiptoemail)}; - - $query = qq|SELECT * FROM shipto WHERE (trans_id = ?) AND (module= 'CT')|; - $ref = selectfirst_hashref_query($form, $dbh, $query, $vid); - @{$params}{keys %$ref} = @{$ref}{keys %$ref}; - map { $params->{$_} = $ref->{$_} } keys %$ref; - } - if (!$params->{id} && $params->{type} !~ /_(order|quotation)/) { # setup last accounts used $query =