- my ($self, $myconfig, $form, $rows, $userspath, $spool) = @_;
+ my ($self, $myconfig, $form, $rows) = @_;
- my $inputfiles = join " ", map { "${main::spool}/$_ " x $copies } @{ $form->{DUNNING_PDFS} };
+ my $spool = $::lx_office_conf{paths}->{spool};
+ my $inputfiles = join " ", map { "$spool/$_ " x $copies } @{ $form->{DUNNING_PDFS} };
$form->error($main::locale->text('Could not spawn ghostscript.')) unless $in;
if ($form->{media} eq 'printer') {
$form->error($main::locale->text('Could not spawn ghostscript.')) unless $in;
if ($form->{media} eq 'printer') {
ar.transdate, ar.duedate, ar.customer_id,
ar.invnumber, ar.ordnumber, ar.cp_id,
ar.amount, ar.netamount, ar.paid,
ar.transdate, ar.duedate, ar.customer_id,
ar.invnumber, ar.ordnumber, ar.cp_id,
ar.amount, ar.netamount, ar.paid,
ar.amount - ar.paid AS open_amount,
ar.amount - ar.paid + da.fee + da.interest AS linetotal
ar.amount - ar.paid AS open_amount,
ar.amount - ar.paid + da.fee + da.interest AS linetotal
c.country, c.department_1, c.department_2, c.email, c.customernumber,
c.greeting, c.contact, c.phone, c.fax, c.homepage,
c.email, c.taxincluded, c.business_id, c.taxnumber, c.iban,
c.country, c.department_1, c.department_2, c.email, c.customernumber,
c.greeting, c.contact, c.phone, c.fax, c.homepage,
c.email, c.taxincluded, c.business_id, c.taxnumber, c.iban,
co.*
FROM dunning d
LEFT JOIN ar ON (d.trans_id = ar.id)
LEFT JOIN customer c ON (ar.customer_id = c.id)
LEFT JOIN contacts co ON (ar.cp_id = co.cp_id)
co.*
FROM dunning d
LEFT JOIN ar ON (d.trans_id = ar.id)
LEFT JOIN customer c ON (ar.customer_id = c.id)
LEFT JOIN contacts co ON (ar.cp_id = co.cp_id)
WHERE (d.dunning_id = ?)
LIMIT 1|;
my $ref = selectfirst_hashref_query($form, $dbh, $query, $dunning_id);
WHERE (d.dunning_id = ?)
LIMIT 1|;
my $ref = selectfirst_hashref_query($form, $dbh, $query, $dunning_id);
$self->set_template_options($myconfig, $form);
my $filename = "dunning_${dunning_id}_" . Common::unique_id() . ".pdf";
$self->set_template_options($myconfig, $form);
my $filename = "dunning_${dunning_id}_" . Common::unique_id() . ".pdf";
$form->{keep_tmpfile} = 1;
delete $form->{tmpfile};
push @{ $form->{DUNNING_PDFS} }, $filename;
$form->{keep_tmpfile} = 1;
delete $form->{tmpfile};
push @{ $form->{DUNNING_PDFS} }, $filename;
$form->{keep_tmpfile} = 1;
delete $form->{tmpfile};
map { delete $form->{$_} } grep /^[a-z_]+_\d+$/, keys %{ $form };
$form->{keep_tmpfile} = 1;
delete $form->{tmpfile};
map { delete $form->{$_} } grep /^[a-z_]+_\d+$/, keys %{ $form };
restore_form($saved_form);
push @{ $form->{DUNNING_PDFS} }, $filename;
restore_form($saved_form);
push @{ $form->{DUNNING_PDFS} }, $filename;