diff options
Diffstat (limited to 'bin/arapprn.pl')
-rw-r--r-- | bin/arapprn.pl | 58 |
1 files changed, 22 insertions, 36 deletions
diff --git a/bin/arapprn.pl b/bin/arapprn.pl index 0d256c28..845d829a 100644 --- a/bin/arapprn.pl +++ b/bin/arapprn.pl @@ -285,24 +285,17 @@ sub print_check { $form->{fileid} = $invnumber; $form->{fileid} =~ s/(\s|\W)+//g; - if ( ( $form->{'media'} eq 'screen' ) and ( $form->{'format'} eq 'html' ) ) - { - my $template = - LedgerSMB::Template->new( - user => \%myconfig, template => $form->{'formname'}, - format => 'HTML' ); - try { - $template->render($form); - $form->header; - print $template->{'output'}; - exit; - } - catch Error::Simple with { - my $E = shift; - $form->error( $E->stacktrace ); - }; - } - $form->parse_template( \%myconfig ); + my $template = LedgerSMB::Template->new( + user => \%myconfig, template => $form->{'formname'}, + format => uc $form->{'format'} ); + try { + $template->render($form); + $template->output($form->{'media'}); + } + catch Error::Simple with { + my $E = shift; + $form->error( $E->stacktrace ); + }; if ( $form->{previousform} ) { @@ -560,24 +553,17 @@ sub print_transaction { $form->{fileid} = $form->{invnumber}; $form->{fileid} =~ s/(\s|\W)+//g; - if ( ( $form->{'media'} eq 'screen' ) and ( $form->{'format'} eq 'html' ) ) - { - my $template = - LedgerSMB::Template->new( - user => \%myconfig, template => $form->{'formname'}, - format => 'HTML' ); - try { - $template->render($form); - $form->header; - print $template->{'output'}; - exit; - } - catch Error::Simple with { - my $E = shift; - $form->error( $E->stacktrace ); - }; - } - $form->parse_template( \%myconfig ); + my $template = LedgerSMB::Template->new( + user => \%myconfig, template => $form->{'formname'}, + format => uc $form->{format} ); + try { + $template->render($form); + $template->output($form->{media}); + } + catch Error::Simple with { + my $E = shift; + $form->error( $E->stacktrace ); + }; if (%$old_form) { $old_form->{invnumber} = $form->{invnumber}; |