X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/c79db65dcff75f58a09aaf3fe3a4b73624055c5d..4c4939d0:/bin/mozilla/ir.pl diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 780b8eac3..b550532ed 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -262,7 +262,7 @@ sub form_header { my $form = $main::form; my %myconfig = %main::myconfig; my $locale = $main::locale; - my $cgi = $main::cgi; + my $cgi = $::request->{cgi}; $main::auth->assert('vendor_invoice_edit'); @@ -274,10 +274,6 @@ sub form_header { $form->{defaultcurrency} = $form->get_default_currency(\%myconfig); - my $set_duedate_url = "$form->{script}?action=set_duedate"; - - push @ { $form->{AJAX} }, new CGI::Ajax( 'set_duedate' => $set_duedate_url ); - my @old_project_ids = ($form->{"globalproject_id"}); map { push @old_project_ids, $form->{"project_id_$_"} if $form->{"project_id_$_"}; } 1..$form->{"rowcount"}; @@ -312,7 +308,9 @@ sub form_header { $form->{currency} = $form->{defaultcurrency} unless $form->{currency}; $TMPL_VAR{show_exchangerate} = $form->{currency} ne $form->{defaultcurrency}; $TMPL_VAR{currencies} = NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"}, - '-values' => \@values, '-labels' => \%labels)) if scalar @values; + '-values' => \@values, '-labels' => \%labels, + '-onchange' => "document.getElementById('update_button').click();" + )) if scalar @values; push @custom_hiddens, "forex"; push @custom_hiddens, "exchangerate" if $form->{forex}; @@ -820,14 +818,15 @@ sub yes { $main::lxdebug->leave_sub(); } -sub set_duedate_vendor { - $main::lxdebug->enter_sub(); - - my $form = $main::form; +sub get_duedate_vendor { + $::lxdebug->enter_sub; - print $form->ajax_response_header(), IR->get_duedate('vendor_id' => $form->{vendor_id}, - 'invdate' => $form->{invdate}, - 'default' => $form->{old_duedate}); + my $result = IR->get_duedate( + vendor_id => $::form->{vendor_id}, + invdate => $::form->{invdate}, + default => $::form->{old_duedate}, + ); - $main::lxdebug->leave_sub(); + print $::form->ajax_response_header, $result; + $::lxdebug->leave_sub; }