X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FBackgroundJob%2FCreatePeriodicInvoices.pm;h=2df2a30aca07f90d034e660a34705808edf9b191;hb=8da71e6d954eed7f480dd2a64a81ff4dd11d237e;hp=651552a5f4cb39eec13a4a9483b4dfebe155eaf7;hpb=430216b97bf4096f8770626125127168ed63c5a0;p=kivitendo-erp.git diff --git a/SL/BackgroundJob/CreatePeriodicInvoices.pm b/SL/BackgroundJob/CreatePeriodicInvoices.pm index 651552a5f..2df2a30ac 100644 --- a/SL/BackgroundJob/CreatePeriodicInvoices.pm +++ b/SL/BackgroundJob/CreatePeriodicInvoices.pm @@ -107,7 +107,7 @@ sub _generate_time_period_variables { sub _replace_vars { my (%params) = @_; my $sub = $params{attribute}; - my $str = $params{object}->$sub; + my $str = $params{object}->$sub // ''; my $sub_fmt = lc($params{attribute_format} // 'text'); my ($start_tag, $end_tag) = $sub_fmt eq 'html' ? ('<%', '%>') : ('<%', '%>'); @@ -200,6 +200,7 @@ sub _create_periodic_invoice { $invoice->assign_attributes(deliverydate => $period_start_date, intnotes => $intnotes, employee => $order->employee, # new_from sets employee to import user + direct_debit => $config->direct_debit, ); _replace_vars(object => $invoice, vars => $time_period_vars, attribute => $_, attribute_format => ($_ eq 'notes' ? 'html' : 'text')) for qw(notes intnotes transaction_description); @@ -316,6 +317,14 @@ sub _print_invoice { $form->{OUT} = $config->printer->printer_command; $form->{OUT_MODE} = '|-'; + $form->{TEMPLATE_DRIVER_OPTIONS} = { + variable_content_types => { + longdescription => 'html', + partnotes => 'html', + notes => 'html', + }, + }; + $form->prepare_for_printing; $form->throw_on_error(sub {