X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/c6b2257945060625bcb86fa7e2efd27c737480ff..2e66dde525c12d064518c316d25a6b41ed727b39:/SL/DN.pm diff --git a/SL/DN.pm b/SL/DN.pm index 8eb407b60..2eeed6762 100644 --- a/SL/DN.pm +++ b/SL/DN.pm @@ -36,6 +36,7 @@ package DN; use SL::Common; use SL::DBUtils; +use SL::DB::Default; use SL::GenericTranslations; use SL::IS; use SL::Mailer; @@ -394,7 +395,9 @@ sub set_template_options { my ($self, $myconfig, $form) = @_; - $form->{templates} = "$myconfig->{templates}"; + my $defaults = SL::DB::Default->get; + $form->error($::locale->text('No print templates have been created for this client yet. Please do so in the client configuration.')) if !$defaults->templates; + $form->{templates} = $defaults->templates; $form->{language} = $form->get_template_language($myconfig); $form->{printer_code} = $form->get_printer_code($myconfig); @@ -433,7 +436,7 @@ sub set_template_options { $form->{IN} = undef; for my $filename (@template_files) { - if (-f "$form->{templates}/$filename") { + if (-f ($defaults->templates . "/$filename")) { $form->{IN} = $filename; last; }