X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/2b6b46fefd21ebee3ddd76b499ddc0f72b893fed..a422e87f5acc0cb9ecbc76f46b416c6d99f27a38:/bin/mozilla/dn.pl diff --git a/bin/mozilla/dn.pl b/bin/mozilla/dn.pl index 3124362e2..8f8efc5b6 100644 --- a/bin/mozilla/dn.pl +++ b/bin/mozilla/dn.pl @@ -38,8 +38,10 @@ use SL::IS; use SL::DN; use SL::DB::Department; use SL::DB::Dunning; +use SL::File; use SL::Helper::Flash qw(flash); use SL::Locale::String qw(t8); +use SL::Presenter::FileObject; use SL::ReportGenerator; require "bin/mozilla/common.pl"; @@ -378,6 +380,7 @@ sub show_dunning { 'fee' => { 'text' => $locale->text('Total Fees') }, 'interest' => { 'text' => $locale->text('Interest') }, 'salesman' => { 'text' => $locale->text('Salesperson'), 'visible' => $form->{l_salesman} ? 1 : 0 }, + 'documents' => { 'text' => $locale->text('Documents') , 'visible' => $::instance_conf->get_doc_storage ? 1 : 0 }, ); $report->set_columns(%column_defs); @@ -444,6 +447,19 @@ sub show_dunning { $row->{language} = { }; } + if ($::instance_conf->get_doc_storage) { + my @files = SL::File->get_all_versions(object_id => $ref->{id}, + object_type => 'dunning' . $ref->{dunning_level}, + file_type => 'document',); + if (scalar @files) { + my $html = join '
', map { SL::Presenter::FileObject::file_object($_) } @files; + my $text = join "\n", map { $_->file_name } @files; + $row->{documents} = { 'raw_data' => $html, data => $text }; + } else { + $row->{documents} = { }; + } + } + push @{ $current_dunning_rows }, $row; $previous_dunning_id = $ref->{dunning_id};