- push @{ $form->{DUNNING_PDFS} }, $filename;
- push @{ $form->{DUNNING_PDFS_EMAIL} }, { 'path' => "${spool}/$filename",
- 'name' => $attachment_filename };
-
- # save dunning fee pdf in filemanagement for each dunned invoice
- if ($::instance_conf->get_doc_storage) {
- $query = qq|SELECT trans_id FROM dunning WHERE dunning_id = ?|;
- my @dunned_invoice_ids = selectall_array_query($form, $dbh, $query, $dunning_id);
- foreach my $dunned_invoice_id (@dunned_invoice_ids) {
- SL::File->save(
- object_id => $dunned_invoice_id,
- object_type => 'dunning',
- mime_type => 'application/pdf',
- source => 'created',
- file_type => 'document',
- file_name => $attachment_filename,
- file_path => "${spool}/$filename",
- );
- }
- }
+ push @{ $form->{DUNNING_PDFS} }, $filename;
+ push @{ $form->{DUNNING_PDFS_EMAIL} }, { 'path' => "${spool}/$filename",
+ 'name' => $attachment_filename };
+ push @{ $form->{DUNNING_PDFS_STORAGE} }, { 'dunning_id' => $dunning_id,
+ 'path' => "${spool}/$filename",
+ 'name' => $attachment_filename };