$form->restore_vars(qw(id));
IS->retrieve_invoice(\%myconfig, \%$form);
$form->restore_vars(qw(id));
IS->retrieve_invoice(\%myconfig, \%$form);
$form->restore_vars(qw(taxincluded)) if $form->{id};
$form->restore_vars(qw(salesman_id)) if $editing;
$form->restore_vars(qw(taxincluded)) if $form->{id};
$form->restore_vars(qw(salesman_id)) if $editing;
$form->{currency} = $form->{defaultcurrency} unless $form->{currency};
$form->{show_exchangerate} = $form->{currency} ne $form->{defaultcurrency};
$TMPL_VAR{currencies} = NTI($::request->{cgi}->popup_menu('-name' => 'currency', '-default' => $form->{"currency"},
$form->{currency} = $form->{defaultcurrency} unless $form->{currency};
$form->{show_exchangerate} = $form->{currency} ne $form->{defaultcurrency};
$TMPL_VAR{currencies} = NTI($::request->{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};
push @custom_hiddens, "forex";
push @custom_hiddens, "exchangerate" if $form->{forex};
print $form->parse_html_template('is/form_footer', {
is_type_credit_note => ($form->{type} eq "credit_note"),
totalpaid => $totalpaid,
print $form->parse_html_template('is/form_footer', {
is_type_credit_note => ($form->{type} eq "credit_note"),
totalpaid => $totalpaid,