From: Werner Hahn Date: Mon, 10 Sep 2018 13:44:23 +0000 (+0200) Subject: Kundenstatistik: Briefe X-Git-Tag: release-3.5.4~295 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8233ba0bdaed4ba7312e9180d772385ff221d9b3;p=kivitendo-erp.git Kundenstatistik: Briefe --- diff --git a/SL/Controller/CustomerVendorTurnover.pm b/SL/Controller/CustomerVendorTurnover.pm index d02fb76ed..e7aea0a49 100644 --- a/SL/Controller/CustomerVendorTurnover.pm +++ b/SL/Controller/CustomerVendorTurnover.pm @@ -370,6 +370,28 @@ SQL $self->render('customer_vendor_turnover/email_statistic', { layout => 0 }, emails => $emails); } +sub action_get_letters { + my ($self) = @_; + + return $self->render('generic/error', { layout => 0 }, label_error => "list_transactions needs a trans_id") unless $::form->{id}; + + my $cv = $::form->{id} || {}; + my $letters; + my $type = $::form->{type}; + if ( $::form->{db} eq 'customer' ) { + $letters = SL::DB::Manager::Letter->get_all( + query => [ customer_id => $cv, ], + sort_by => 'date DESC', + ); + } else { + $letters = SL::DB::Manager::Letter->get_all( + query => [ vendor_id => $cv, ], + sort_by => 'date DESC', + ); + } + $self->render('customer_vendor_turnover/letter_statistic', { layout => 0 }, letters => $letters); +} + sub _list_articles_by_invoice { } sub _list_count_articles_by_year { diff --git a/templates/webpages/customer_vendor_turnover/letter_statistic.html b/templates/webpages/customer_vendor_turnover/letter_statistic.html new file mode 100644 index 000000000..c320884b7 --- /dev/null +++ b/templates/webpages/customer_vendor_turnover/letter_statistic.html @@ -0,0 +1,46 @@ +[%- USE T8 %] +[%- USE LxERP %] +[%- USE L %] +[%- USE HTML %] +[%- USE Dumper %] + +
+ + + + + + + + + + + [%- FOREACH row = letters %] + [% IF row.customer_id %] + [% SET is_sales = 1 %] + [% ELSE %] + [% SET is_sales = 0 %] + [% END %] + + + + + + + + [% END %] + +
[% 'Date' | $T8 %][% 'Subject' | $T8 %][% 'Letternumber' | $T8 %][% 'Contact' | $T8 %][% 'Author' | $T8 %]
[% row.date.to_kivitendo | html %] + + [%- HTML.escape(row.subject) %] + + + + [% row.letternumber | html %] + + [% row.contact.cp_givenname %] [% row.contact.cp_name %][% row.employee.name %]
+ + + + +