From: Moritz Bunkus Date: Fri, 26 Apr 2013 12:11:51 +0000 (+0200) Subject: Wiederkehrende Rechnungen: Job täglich ausführen lassen X-Git-Tag: release-3.1.0beta1~458 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e44bc27a90e6df22cff8142041c8e3e679530a7a;p=kivitendo-erp.git Wiederkehrende Rechnungen: Job täglich ausführen lassen Damit ist es problemlos möglich, Rechnungen immer am x. eines Monats zu erzeugen (z.B. immer am 15., indem das Startdatum auf den 15. eines Monats gesetzt wird). --- diff --git a/sql/Pg-upgrade2/background_job_change_create_periodic_invoices_to_daily.pl b/sql/Pg-upgrade2/background_job_change_create_periodic_invoices_to_daily.pl new file mode 100644 index 000000000..ace35be49 --- /dev/null +++ b/sql/Pg-upgrade2/background_job_change_create_periodic_invoices_to_daily.pl @@ -0,0 +1,23 @@ +# @tag: background_job_change_create_periodic_invoices_to_daily +# @description: Hintergrundjob zum Erzeugen periodischer Rechnungen täglich ausführen +# @depends: release_3_0_0 +package SL::DBUpgrade2::background_job_change_create_periodic_invoices_to_daily; + +use strict; +use utf8; + +use parent qw(SL::DBUpgrade2::Base); + +use SL::DB::BackgroundJob; + +sub run { + my ($self) = @_; + + foreach my $job (@{ SL::DB::Manager::BackgroundJob->get_all(where => [ package_name => 'CreatePeriodicInvoices' ]) }) { + $job->update_attributes(cron_spec => '0 3 * * *', next_run_at => undef); + } + + return 1; +} + +1;