Revision 8cd05ad6
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
SL/DN.pm | ||
---|---|---|
269 | 269 |
sub save_dunning { |
270 | 270 |
$main::lxdebug->enter_sub(); |
271 | 271 |
|
272 |
my ($self, $myconfig, $form, $rows, $userspath, $spool) = @_;
|
|
272 |
my ($self, $myconfig, $form, $rows) = @_; |
|
273 | 273 |
# connect to database |
274 | 274 |
my $dbh = $form->dbconnect_noauto($myconfig); |
275 | 275 |
|
... | ... | |
661 | 661 |
|
662 | 662 |
$copies *= 1; |
663 | 663 |
$copies = 1 unless $copies; |
664 |
my $inputfiles = join " ", map { "${main::spool}/$_ " x $copies } @{ $form->{DUNNING_PDFS} }; |
|
664 |
my $spool = $::lx_office_conf{paths}->{spool}; |
|
665 |
my $inputfiles = join " ", map { "$spool/$_ " x $copies } @{ $form->{DUNNING_PDFS} }; |
|
665 | 666 |
my $dunning_id = $form->{dunning_id}; |
666 | 667 |
|
667 | 668 |
$dunning_id =~ s|[^\d]||g; |
... | ... | |
690 | 691 |
|
691 | 692 |
$in->close(); |
692 | 693 |
|
693 |
map { unlink("${main::spool}/$_") } @{ $form->{DUNNING_PDFS} };
|
|
694 |
map { unlink("$spool/$_") } @{ $form->{DUNNING_PDFS} };
|
|
694 | 695 |
|
695 | 696 |
$main::lxdebug->leave_sub(); |
696 | 697 |
} |
... | ... | |
792 | 793 |
$self->set_template_options($myconfig, $form); |
793 | 794 |
|
794 | 795 |
my $filename = "dunning_${dunning_id}_" . Common::unique_id() . ".pdf"; |
795 |
$form->{OUT} = ">${main::spool}/$filename"; |
|
796 |
my $spool = $::lx_office_conf{paths}->{spool}; |
|
797 |
$form->{OUT} = ">${spool}/$filename"; |
|
796 | 798 |
$form->{keep_tmpfile} = 1; |
797 | 799 |
|
798 | 800 |
delete $form->{tmpfile}; |
799 | 801 |
|
800 | 802 |
push @{ $form->{DUNNING_PDFS} }, $filename; |
801 |
push @{ $form->{DUNNING_PDFS_EMAIL} }, { 'filename' => "${main::spool}/$filename",
|
|
803 |
push @{ $form->{DUNNING_PDFS_EMAIL} }, { 'filename' => "${spool}/$filename", |
|
802 | 804 |
'name' => "dunning_${dunning_id}.pdf" }; |
803 | 805 |
|
804 |
$form->parse_template($myconfig, $main::userspath);
|
|
806 |
$form->parse_template($myconfig); |
|
805 | 807 |
|
806 | 808 |
$dbh->disconnect() unless $provided_dbh; |
807 | 809 |
|
... | ... | |
885 | 887 |
|
886 | 888 |
my $filename = Common::unique_id() . "dunning_invoice_${dunning_id}.pdf"; |
887 | 889 |
|
888 |
$form->{OUT} = ">$main::spool/$filename"; |
|
890 |
my $spool = $::lx_office_conf{paths}->{spool}; |
|
891 |
$form->{OUT} = ">$spool/$filename"; |
|
889 | 892 |
$form->{keep_tmpfile} = 1; |
890 | 893 |
delete $form->{tmpfile}; |
891 | 894 |
|
892 | 895 |
map { delete $form->{$_} } grep /^[a-z_]+_\d+$/, keys %{ $form }; |
893 | 896 |
|
894 |
$form->parse_template($myconfig, $main::userspath);
|
|
897 |
$form->parse_template($myconfig); |
|
895 | 898 |
|
896 | 899 |
restore_form($saved_form); |
897 | 900 |
|
898 | 901 |
push @{ $form->{DUNNING_PDFS} }, $filename; |
899 |
push @{ $form->{DUNNING_PDFS_EMAIL} }, { 'filename' => "${main::spool}/$filename",
|
|
902 |
push @{ $form->{DUNNING_PDFS_EMAIL} }, { 'filename' => "${spool}/$filename", |
|
900 | 903 |
'name' => "dunning_invoice_${dunning_id}.pdf" }; |
901 | 904 |
|
902 | 905 |
$dbh->disconnect() unless $provided_dbh; |
Auch abrufbar als: Unified diff
Globale Variablen $::userspath, $::templates, $::membersfile nach %::lx_office_conf verschoben