return;
}
+ $form->{attachment_filename} ||= $form->generate_attachment_filename;
+
my $timestamp = get_current_formatted_time();
- my $new_file = File::Spec->catfile($form->{cwd}, $webdav_folder, $form->generate_attachment_filename());
+ my $new_file = File::Spec->catfile($form->{cwd}, $webdav_folder, $form->{attachment_filename});
$new_file =~ s{(.*)\.}{$1$timestamp\.};
if (!File::Copy::copy($current_file, $new_file)) {
# therefore copy to webdav, even if we do not have the webdav feature enabled (just archive)
my $copy_to_webdav = $::instance_conf->get_webdav_documents && !$self->{preview} && $self->{tmpdir} && $self->{tmpfile} && $self->{type}
&& $self->{type} ne 'statement';
+
+ $self->{attachment_filename} ||= $self->generate_attachment_filename;
+
if ( $ext_for_format eq 'pdf' && $self->doc_storage_enabled ) {
$self->append_general_pdf_attachments(filepath => $self->{tmpdir}."/".$self->{tmpfile},
type => $self->{type});
if (!$self->{preview} && $self->{attachment_type} !~ m{^dunning} && $self->doc_storage_enabled)
{
- $self->{attachment_filename} ||= $self->generate_attachment_filename;
$self->store_pdf($self);
}
$self->cleanup;
}
if ( !$self->{preview} && $ext_for_format eq 'pdf' && $self->{attachment_type} !~ m{^dunning} && $self->doc_storage_enabled) {
- $self->{attachment_filename} ||= $self->generate_attachment_filename;
my $file_obj = $self->store_pdf($self);
$self->{print_file_id} = $file_obj->id if $file_obj;
}