From: Moritz Bunkus Date: Wed, 16 Oct 2013 12:01:46 +0000 (+0200) Subject: Wiederkehrende Rechnungen: Erste Startperiode nicht vergessen X-Git-Tag: release-3.2.0beta~476^2~8 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=66f46ee95d136a6815326740768d4d40ace5d579;p=kivitendo-erp.git Wiederkehrende Rechnungen: Erste Startperiode nicht vergessen --- diff --git a/SL/DB/PeriodicInvoicesConfig.pm b/SL/DB/PeriodicInvoicesConfig.pm index 45536752c..9bd5e1d7e 100644 --- a/SL/DB/PeriodicInvoicesConfig.pm +++ b/SL/DB/PeriodicInvoicesConfig.pm @@ -83,7 +83,7 @@ sub calculate_invoice_dates { my $cur_date = $self->first_billing_date || $self->start_date; my $end_date = $self->end_date || DateTime->today_local->add(years => 10); my $start_date = $params{past_dates} ? undef : $self->get_previous_invoice_date; - $start_date ||= $cur_date->clone->subtract(days => 1); + $start_date = $start_date ? $start_date->subtract(days => 1) : $cur_date->clone; $start_date = max($start_date, $params{start_date}) if $params{start_date}; $end_date = min($end_date, $params{end_date}) if $params{end_date}; @@ -91,7 +91,7 @@ sub calculate_invoice_dates { my @dates; while ($cur_date <= $end_date) { - push @dates, $cur_date->clone if $cur_date > $start_date; + push @dates, $cur_date->clone if $cur_date >= $start_date; $cur_date->add(months => $period_len); }