X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FFinancialOverview.pm;h=e8ed1401a7eece88acedbed4f1e4ba4564588f42;hb=e24e328414e830c8f0bdff437c82bdc67a1d8367;hp=25717d3e8e9ea64f79b67f8a2cbc01960a3624fc;hpb=1734e1ad21eea72ffe4f3ac606cc4a33f97bd5f5;p=kivitendo-erp.git diff --git a/SL/Controller/FinancialOverview.pm b/SL/Controller/FinancialOverview.pm index 25717d3e8..e8ed1401a 100644 --- a/SL/Controller/FinancialOverview.pm +++ b/SL/Controller/FinancialOverview.pm @@ -14,8 +14,8 @@ use SL::Controller::Helper::ReportGenerator; use SL::Locale::String; use Rose::Object::MakeMethods::Generic ( - scalar => [ qw(report number_columns year current_year objects data subtotals_per_quarter salesman_id) ], - 'scalar --get_set_init' => [ qw(employees types) ], + scalar => [ qw(report number_columns year current_year objects subtotals_per_quarter salesman_id) ], + 'scalar --get_set_init' => [ qw(employees types data) ], ); __PACKAGE__->run_before(sub { $::auth->assert('report'); }); @@ -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} } ]; @@ -145,7 +145,7 @@ sub calculate_periodic_invoices { sub calculate_one_periodic_invoice { my ($self, %params) = @_; - my @dates = $params{config}->calculate_invoice_dates(start_date => $params{start_date}, end_date => $params{end_date}); + my @dates = $params{config}->calculate_invoice_dates(start_date => $params{start_date}, end_date => $params{end_date}, past_dates => 1); my $first_date = $dates[0]; return if !$first_date;