From e44bc27a90e6df22cff8142041c8e3e679530a7a Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 26 Apr 2013 14:11:51 +0200 Subject: [PATCH] =?utf8?q?Wiederkehrende=20Rechnungen:=20Job=20t=C3=A4glic?= =?utf8?q?h=20ausf=C3=BChren=20lassen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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). --- ...hange_create_periodic_invoices_to_daily.pl | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 sql/Pg-upgrade2/background_job_change_create_periodic_invoices_to_daily.pl 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; -- 2.20.1