X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fir.pl;h=810e06a4783a0b1943df243a51b1df26f3ecf3cb;hb=e16e1f36dec1679b1defb5efc5acd7290cc9de85;hp=2ace9a7b434c58c380b4e810f8846f4376b0887b;hpb=2879330bd173831981bdd8b25fc1900292efaeac;p=kivitendo-erp.git diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 2ace9a7b4..810e06a47 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -283,8 +283,7 @@ sub form_header { my @old_project_ids = ($form->{"globalproject_id"}); map { push @old_project_ids, $form->{"project_id_$_"} if $form->{"project_id_$_"}; } 1..$form->{"rowcount"}; - $form->get_lists("contacts" => "ALL_CONTACTS", - "shipto" => "ALL_SHIPTO", + $form->get_lists("shipto" => "ALL_SHIPTO", "projects" => { "key" => "ALL_PROJECTS", "all" => 0, "old_id" => \@old_project_ids }, @@ -295,9 +294,17 @@ sub form_header { "departments" => "all_departments", "price_factors" => "ALL_PRICE_FACTORS"); + $TMPL_VAR{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all(query => [ + or => [ + cp_cv_id => $::form->{"$::form->{vc}_id"} * 1, + and => [ + cp_cv_id => undef, + cp_id => $::form->{cp_id} * 1 + ] + ] + ]); $TMPL_VAR{sales_employee_labels} = sub { $_[0]->{name} || $_[0]->{login} }; # $TMPL_VAR{shipto_labels} = sub { join "; ", grep { $_ } map { $_[0]->{"shipto${_}" } } qw(name department_1 street city) }; - $TMPL_VAR{contact_labels} = sub { join(', ', $_[0]->{"cp_name"}, $_[0]->{"cp_givenname"}) . ($_[0]->{cp_abteilung} ? " ($_[0]->{cp_abteilung})" : "") }; $TMPL_VAR{department_labels} = sub { "$_[0]->{description}--$_[0]->{id}" }; # customer @@ -463,10 +470,11 @@ sub update { $main::auth->assert('vendor_invoice_edit'); -# map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(exchangerate creditlimit creditremaining); - &check_name('vendor'); + if (!$form->{forex}) { # read exchangerate from input field (not hidden) + $form->{exchangerate} = $form->parse_amount(\%myconfig, $form->{exchangerate}); + } $form->{forex} = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, 'sell'); $form->{exchangerate} = $form->{forex} if $form->{forex};