$form->{oldvcname} = $form->{"old$form->{vc}"};
$form->{oldvcname} =~ s/--.*//;
- if ($form->{resubmit}) {
- my $dispatch_to_popup = '';
- if ($form->{format} eq "html") {
- $dispatch_to_popup .= "window.open('about:blank','Beleg'); document.do.target = 'Beleg';";
- }
- # emulate click for resubmitting actions
- $dispatch_to_popup .= "document.do.${_}.click(); " for grep { /^action_/ } keys %$form;
+ my $dispatch_to_popup = '';
+ if ($form->{resubmit} && ($form->{format} eq "html")) {
+ $dispatch_to_popup = "window.open('about:blank','Beleg'); document.do.target = 'Beleg';";
$dispatch_to_popup .= "document.do.submit();";
- $::request->{layout}->add_javascripts_inline("\$(function(){$dispatch_to_popup})");
+ } elsif ($form->{resubmit}) {
+ # emulate click for resubmitting actions
+ $dispatch_to_popup = "document.do.${_}.click(); " for grep { /^action_/ } keys %$form;
}
+ $::request->{layout}->add_javascripts_inline("\$(function(){$dispatch_to_popup})");
+
my $follow_up_vc = $form->{ $form->{vc} eq 'customer' ? 'customer' : 'vendor' };
$follow_up_vc =~ s/--\d*\s*$//;