X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FCustomerVendorTurnover.pm;h=8cfa9652e29fb1363e53db537dc2b72f29e71f00;hb=7ddb43c71b4aed9f23614141349592cb5785a400;hp=d02fb76ed11be7950245f7a03e4bc20ae4fb6b05;hpb=29318a627ee21ab0b324d329f78e3c4383af98c8;p=kivitendo-erp.git diff --git a/SL/Controller/CustomerVendorTurnover.pm b/SL/Controller/CustomerVendorTurnover.pm index d02fb76ed..8cfa9652e 100644 --- a/SL/Controller/CustomerVendorTurnover.pm +++ b/SL/Controller/CustomerVendorTurnover.pm @@ -9,7 +9,6 @@ use SL::DB::EmailJournal; use SL::DB::Letter; use SL::DB; -__PACKAGE__->run_before('check_auth'); sub action_list_turnover { my ($self) = @_; @@ -370,11 +369,104 @@ SQL $self->render('customer_vendor_turnover/email_statistic', { layout => 0 }, emails => $emails); } -sub _list_articles_by_invoice { -} -sub _list_count_articles_by_year { -} -sub check_auth { - $::auth->assert('general_ledger'); +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); } + 1; + +__END__ + +=encoding utf-8 + +=head1 NAME + +SL::Controller::CustomerVendorTurnover + +=head1 DESCRIPTION + +Gets all kinds of records like orders, request orders, quotations, invoices, emails, letters + +wich belong to customer/vendor and displays them in an extra tab "Records". + +=head1 URL ACTIONS + +=over 4 + +=item C + +Basic action wich displays open invoices and open orders if there are any and shows the tab menu for the other actions + +=item C + +gets and shows a dunning statistic of the customer by month + +=item C + +gets and shows a dunning statistic of the customer by year + +=item C + +gets and shows an invoice statistic of customer/vendor by month + +=item C + +gets and shows an invoice statistic of customer/vendor by year + +=item C + +get and shows all invoices from the customer/vendor in an extra tab + +=item C + +get and shows all orders from the customer/vendor in an extra tab + +=item C + +get and shows all letters from the customer/vendor in an extra tab + +=item C + +get and shows all mails from the customer/vendor in an extra tab + +=back + +=head1 Functions + +=over 4 + +=item C<_get_open_orders> + +retrieves the open orders for customer/vendor to display them + +=item C<_list_open_items> + +retrieves open invoices with their dunnings to display them + +=back + +=head1 BUGS + +None yet. :) + +=head1 AUTHOR + +W. Hahn Ewh@futureworldsearch.netE