$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 {
--- /dev/null
+[%- USE T8 %]
+[%- USE LxERP %]
+[%- USE L %]
+[%- USE HTML %]
+[%- USE Dumper %]
+
+<div id="invoice_statistic">
+ <table width="100%">
+ <tbody>
+ <tr>
+ <td class="listheading">[% 'Date' | $T8 %]</td>
+ <td class="listheading">[% 'Subject' | $T8 %]</td>
+ <td class="listheading">[% 'Letternumber' | $T8 %]</td>
+ <td class="listheading">[% 'Contact' | $T8 %]</td>
+ <td class="listheading">[% 'Author' | $T8 %]</td>
+ </tr>
+
+ [%- FOREACH row = letters %]
+ [% IF row.customer_id %]
+ [% SET is_sales = 1 %]
+ [% ELSE %]
+ [% SET is_sales = 0 %]
+ [% END %]
+ <tr class="listrow[% loop.count % 2 %]">
+ <td>[% row.date.to_kivitendo | html %]</td>
+ <td>
+ <a href="[% SELF.url_for(controller='controller.pl', action => 'Letter/edit', 'letter.id' => row.id, is_sales=is_sales, back_to => SELF.get_callback) %]">
+ [%- HTML.escape(row.subject) %]
+ </a>
+ </td>
+ <td>
+ <a href="[% SELF.url_for(controller='controller.pl', action => 'Letter/edit', 'letter.id' => row.id, is_sales=is_sales, back_to => SELF.get_callback) %]">
+ [% row.letternumber | html %]
+ </a>
+ </td>
+ <td>[% row.contact.cp_givenname %] [% row.contact.cp_name %]</td>
+ <td>[% row.employee.name %]</td>
+ </tr>
+ [% END %]
+ </tbody>
+ </table>
+
+
+ </tbody>
+ </table>
+</div>