]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Controller/CustomerVendorTurnover.pm
S:C:CustomerVendorTurnover: unnütze Zeile weg
[mfinanz.git] / SL / Controller / CustomerVendorTurnover.pm
index 5356a73a071c324ecac6d979150ef145439e9fb3..e1267dd1d67cb9afcf511b911feaf2fef4707a3a 100644 (file)
@@ -9,6 +9,7 @@ use SL::DB::EmailJournal;
 use SL::DB::Letter;
 use SL::DB;
 
+__PACKAGE__->run_before('check_auth');
 
 sub action_list_turnover {
   my ($self) = @_;
@@ -42,7 +43,6 @@ sub action_list_turnover {
   }
   my $open_items;
   if (@{$open_invoices}) {
-    return $self->render(\'', { type => 'json' }) unless scalar @{$open_invoices};
     $open_items = $self->_list_open_items($open_invoices);
   }
   my $open_orders = $self->_get_open_orders;
@@ -95,7 +95,7 @@ sub action_count_open_items_by_month {
 
   my $cv = $::form->{id};
 
-  my $query = <<SQL
+  my $query = <<SQL;
    SELECT CONCAT(EXTRACT (MONTH FROM d.transdate),'/',EXTRACT (YEAR FROM d.transdate)) AS date_part,
           count(d.id),
           max(d.dunning_level)
@@ -440,6 +440,10 @@ sub action_get_letters {
     $self->render('customer_vendor_turnover/letter_statistic', { layout => 0 }, letters => $letters);
 }
 
+sub check_auth {
+  $::auth->assert('show_extra_record_tab_customer | show_extra_record_tab_vendor');
+}
+
 1;
 
 __END__
@@ -456,8 +460,6 @@ Gets all kinds of records like orders, request orders, quotations, invoices, ema
 
 wich belong to customer/vendor and displays them in an extra tab "Records".
 
-=back
-
 =head1 URL ACTIONS
 
 =over 4
@@ -522,4 +524,4 @@ None yet. :)
 
 W. Hahn E<lt>wh@futureworldsearch.netE<gt>
 
-=back
+=cut