summaryrefslogtreecommitdiff
path: root/bin/pos.pl
diff options
context:
space:
mode:
Diffstat (limited to 'bin/pos.pl')
-rw-r--r--bin/pos.pl25
1 files changed, 9 insertions, 16 deletions
diff --git a/bin/pos.pl b/bin/pos.pl
index 87787d08..3071bf33 100644
--- a/bin/pos.pl
+++ b/bin/pos.pl
@@ -1001,23 +1001,16 @@ sub print_form {
delete $form->{stylesheet};
$form->{cd_open} = $pos_config{rp_cash_drawer_open};
- 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 );
- };
+ my $template = LedgerSMB::Template->new(user => \%myconfig,
+ template => $form->{'formname'}, format => uc $form->{format} );
+ try {
+ $template->render($form);
+ $template->output($form->{media});
}
- $form->parse_template( \%myconfig, ${LedgerSMB::Sysconfig::userspath} );
+ catch Error::Simple with {
+ my $E = shift;
+ $form->error( $E->stacktrace );
+ };
if ( $form->{printed} !~ /$form->{formname}/ ) {
$form->{printed} .= " $form->{formname}";