]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Controller/FinancialOverview.pm
Finanzübersicht: auch zukünftige Jahre auswählen können
[mfinanz.git] / SL / Controller / FinancialOverview.pm
index 49c04698ce6638a9eb304a38d3f913cb095f0842..6d3fc10abb9c6ee869b6d79735e6d5d744f0c7ea 100644 (file)
@@ -61,7 +61,7 @@ sub prepare_report {
     std_column_visibility => 1,
     controller_class      => 'FinancialOverview',
     output_format         => 'HTML',
-    raw_top_info_text     => $self->render('financial_overview/report_top', { output => 0 }, YEARS_TO_LIST => [ reverse(2000..$self->current_year) ]),
+    raw_top_info_text     => $self->render('financial_overview/report_top', { output => 0 }, YEARS_TO_LIST => [ reverse(($self->current_year - 10)..($self->current_year + 5)) ]),
     title                 => t8('Financial overview for #1', $self->year),
     allow_pdf_export      => 1,
     allow_csv_export      => 1,
@@ -91,7 +91,7 @@ sub get_objects {
     purchase_orders        => SL::DB::Manager::Order->get_all(          where => [ and => [ @f_date, @f_salesman, SL::DB::Manager::Order->type_filter('purchase_order')    ]]),
     sales_invoices         => SL::DB::Manager::Invoice->get_all(        where => [ and => [ @f_date, @f_salesman, ]]),
     purchase_invoices      => SL::DB::Manager::PurchaseInvoice->get_all(where => [ and =>  \@f_date ]),
-    periodic_invoices_cfg  => SL::DB::Manager::PeriodicInvoicesConfig->get_all(where => [ active => 1 ]),
+    periodic_invoices_cfg  => SL::DB::Manager::PeriodicInvoicesConfig->get_all(where => [ active => 1, $self->salesman_id ? ('order.salesman_id' => $self->salesman_id) : () ], with_objects => [ qw(order) ]),
   });
 
   $self->objects->{sales_orders} = [ grep { !$_->periodic_invoices_config || !$_->periodic_invoices_config->active } @{ $self->objects->{sales_orders} } ];