X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fis.pl;h=489a6d936112e4bb5db30286b2d2628505cc3518;hb=06eebe9868a3890f47d128eeeded938441df8f21;hp=737d46143faba080642fa3a00778e8986096242e;hpb=f45b296fb0bb9491d86d80e9f7a7d79c3e0295ba;p=kivitendo-erp.git diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 737d46143..489a6d936 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -146,7 +146,7 @@ sub invoice_links { my $editing = $form->{id}; - $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded cp_id intnotes id shipto_id)); + $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded currency cp_id intnotes id shipto_id)); IS->get_customer(\%myconfig, \%$form); @@ -158,7 +158,7 @@ sub invoice_links { $form->restore_vars(qw(id)); IS->retrieve_invoice(\%myconfig, \%$form); - $form->restore_vars(qw(payment_id language_id taxzone_id intnotes cp_id shipto_id)); + $form->restore_vars(qw(payment_id language_id taxzone_id currency intnotes cp_id shipto_id)); $form->restore_vars(qw(taxincluded)) if $form->{id}; $form->restore_vars(qw(salesman_id)) if $editing; @@ -285,7 +285,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('invoice_edit'); @@ -297,10 +297,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"}; @@ -335,8 +331,10 @@ sub form_header { my %labels = map { $_ => $_ } @{ $form->{ALL_CURRENCIES} }; $form->{currency} = $form->{defaultcurrency} unless $form->{currency}; $form->{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; + $TMPL_VAR{currencies} = NTI($::request->{cgi}->popup_menu('-name' => 'currency', '-default' => $form->{"currency"}, + '-values' => \@values, '-labels' => \%labels, + '-onchange' => "document.getElementById('update_button').click();" + )) if scalar @values; push @custom_hiddens, "forex"; push @custom_hiddens, "exchangerate" if $form->{forex}; @@ -435,7 +433,7 @@ sub form_footer { $form->{"changeable_$i"} = ($form->{"acc_trans_id_$i"})? 0 : 1; } elsif ($::lx_office_conf{features}->{payments_changeable} == 2) { # on the same day - $form->{"changeable_$i"} = (($form->{"gldate_$i"} eq '') || + $form->{"changeable_$i"} = (($form->{"gldate_$i"} eq '') || ($form->current_date(\%myconfig) eq $form->{"gldate_$i"})); } @@ -489,7 +487,7 @@ sub update { $form->{exchangerate} = $form->parse_amount(\%myconfig, $form->{exchangerate}) unless $recursive_call; $form->{print_and_post} = 0 if $form->{second_run}; - my $taxincluded = "checked" if $form->{taxincluded}; + my $taxincluded = $form->{taxincluded} ? "checked" : ''; $form->{update} = 1; &check_name("customer");