Revision 42bf1ae9
Von Moritz Bunkus vor mehr als 8 Jahren hinzugefügt
SL/BackgroundJob/CreatePeriodicInvoices.pm | ||
---|---|---|
92 | 92 |
sub _generate_time_period_variables { |
93 | 93 |
my $config = shift; |
94 | 94 |
my $period_start_date = shift; |
95 |
my $period_end_date = $period_start_date->clone->truncate(to => 'month')->add(months => $config->get_billing_period_length)->subtract(days => 1);
|
|
95 |
my $period_end_date = $period_start_date->clone->add(months => $config->get_billing_period_length)->subtract(days => 1); |
|
96 | 96 |
|
97 | 97 |
my @month_names = ('', |
98 | 98 |
$::locale->text('January'), $::locale->text('February'), $::locale->text('March'), $::locale->text('April'), $::locale->text('May'), $::locale->text('June'), |
... | ... | |
115 | 115 |
previous_year => [ $period_start_date->clone->truncate(to => 'year')->subtract(years => 1), sub { $_[0]->year } ], |
116 | 116 |
next_year => [ $period_start_date->clone->truncate(to => 'year')->add( years => 1), sub { $_[0]->year } ], |
117 | 117 |
|
118 |
period_start_date => [ $period_start_date->clone->truncate(to => 'month'), sub { $::locale->format_date(\%::myconfig, $_[0]) } ],
|
|
119 |
period_end_date => [ $period_end_date, sub { $::locale->format_date(\%::myconfig, $_[0]) } ],
|
|
118 |
period_start_date => [ $period_start_date->clone, sub { $::locale->format_date(\%::myconfig, $_[0]) } ], |
|
119 |
period_end_date => [ $period_end_date, sub { $::locale->format_date(\%::myconfig, $_[0]) } ], |
|
120 | 120 |
}; |
121 | 121 |
|
122 | 122 |
return $vars; |
Auch abrufbar als: Unified diff
Wiederkehrende Rechnungen: Variablen Periodenstart-/-enddatum richtig setzen
Die Perioden beginnen nicht mehr immer nur am 1. des Monats, sondern an
dem Tag, der über das Vertragsstartdatum angegeben ist. Daher müssen
auch die Variablen <%period_start_date%> und <%period_end_date%> anhand
des Vertragsstartdatums gesetzt und dürfen nicht auf den Monatsbeginn
beschnitten werden.