From: Moritz Bunkus Date: Tue, 23 Sep 2014 15:30:09 +0000 (+0200) Subject: Finanzübersicht: wied. Rechnungen für ganzes Jahr auf einmal berücksichtigen X-Git-Tag: release-3.2.0~25 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=54444528588043e961e098ebd013dc553329b852;p=kivitendo-erp.git Finanzübersicht: wied. Rechnungen für ganzes Jahr auf einmal berücksichtigen --- diff --git a/SL/Controller/FinancialOverview.pm b/SL/Controller/FinancialOverview.pm index 6d3fc10ab..cd153d23f 100644 --- a/SL/Controller/FinancialOverview.pm +++ b/SL/Controller/FinancialOverview.pm @@ -145,13 +145,11 @@ 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}, past_dates => 1); - my $first_date = $dates[0]; + return if $params{config}->start_date > $params{end_date}; - return if !$first_date; - - my $net = $params{config}->order->netamount * scalar(@dates); - my $sord = $self->data->{sales_orders}; + my $first_date = $params{config}->start_date->clone->set_year($self->year); + my $net = $params{config}->order->netamount * (12 / $params{config}->get_period_length); + my $sord = $self->data->{sales_orders}; $sord->{months }->[ $first_date->month - 1 ] += $net; $sord->{quarters}->[ $first_date->quarter - 1 ] += $net;