X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FBackgroundJob%2FCreatePeriodicInvoices.pm;h=3b19811df25165123edc46a1cb52e6194b6e2f65;hb=f171e7ac72b29da5dae511cc3cdaf446bcae1b32;hp=dc740cc30b892e9da07deb54ef71fb4864c205a2;hpb=766f5705ecb9cd56adfbffd94c871959bb64c6fd;p=kivitendo-erp.git diff --git a/SL/BackgroundJob/CreatePeriodicInvoices.pm b/SL/BackgroundJob/CreatePeriodicInvoices.pm index dc740cc30..3b19811df 100644 --- a/SL/BackgroundJob/CreatePeriodicInvoices.pm +++ b/SL/BackgroundJob/CreatePeriodicInvoices.pm @@ -89,6 +89,10 @@ sub _generate_time_period_variables { previous_month => [ $period_start_date->clone->truncate(to => 'month')->subtract(months => 1), sub { $_[0]->month } ], next_month => [ $period_start_date->clone->truncate(to => 'month')->add( months => 1), sub { $_[0]->month } ], + current_month_long => [ $period_start_date->clone->truncate(to => 'month'), sub { $month_names[ $_[0]->month ] } ], + previous_month_long => [ $period_start_date->clone->truncate(to => 'month')->subtract(months => 1), sub { $month_names[ $_[0]->month ] } ], + next_month_long => [ $period_start_date->clone->truncate(to => 'month')->add( months => 1), sub { $month_names[ $_[0]->month ] } ], + current_year => [ $period_start_date->clone->truncate(to => 'year'), sub { $_[0]->year } ], previous_year => [ $period_start_date->clone->truncate(to => 'year')->subtract(years => 1), sub { $_[0]->year } ], next_year => [ $period_start_date->clone->truncate(to => 'year')->add( years => 1), sub { $_[0]->year } ], @@ -97,8 +101,6 @@ sub _generate_time_period_variables { period_end_date => [ $period_end_date ->clone->truncate(to => 'month'), sub { $::locale->format_date(\%::myconfig, $_[0]) } ], }; - map { $vars->{"${_}_month_long"} = $month_names[ $vars->{"${_}_month"} ] } qw(current previous next); - return $vars; } @@ -189,7 +191,7 @@ sub _create_periodic_invoice { sub _calculate_dates { my ($config) = @_; - return $config->calculate_invoice_dates(end_date => DateTime->today_local->add(days => 1)); + return $config->calculate_invoice_dates(end_date => DateTime->today_local); } sub _send_email { @@ -213,7 +215,7 @@ sub _send_email { return unless $template; my $email_template = $config{periodic_invoices}->{email_template}; - my $filename = $email_template || ( (SL::DB::Default->get->templates || "templates/webpages") . "/periodic_invoices_email.txt" ); + my $filename = $email_template || ( (SL::DB::Default->get->templates || "templates/webpages") . "/oe/periodic_invoices_email.txt" ); my %params = ( POSTED_INVOICES => $posted_invoices, PRINTED_INVOICES => $printed_invoices );