$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;
my @old_project_ids = ($form->{"globalproject_id"});
map { push @old_project_ids, $form->{"project_id_$_"} if $form->{"project_id_$_"}; } 1..$form->{"rowcount"};
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 },
"projects" => { "key" => "ALL_PROJECTS",
"all" => 0,
"old_id" => \@old_project_ids },
"departments" => "all_departments",
"price_factors" => "ALL_PRICE_FACTORS");
"departments" => "all_departments",
"price_factors" => "ALL_PRICE_FACTORS");
$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{sales_employee_labels} = sub { $_[0]->{name} || $_[0]->{login} };
$TMPL_VAR{shipto_labels} = sub { join "; ", grep { $_ } map { $_[0]->{"shipto${_}" } } qw(name department_1 street city) };
$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,
$form->{print_and_post} = 0 if $form->{second_run};
my $taxincluded = $form->{taxincluded} ? "checked" : '';
$form->{update} = 1;
$form->{print_and_post} = 0 if $form->{second_run};
my $taxincluded = $form->{taxincluded} ? "checked" : '';
$form->{update} = 1;
$form->{forex} = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, 'buy');
$form->{exchangerate} = $form->{forex} if $form->{forex};
$form->{forex} = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, 'buy');
$form->{exchangerate} = $form->{forex} if $form->{forex};