mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for scheduler
This commit is contained in:
parent
dd59cb6de6
commit
7099ab1c5d
@ -153,6 +153,9 @@ class Scheduler extends BaseModel
|
||||
$offset = $this->company->timezone_offset();
|
||||
|
||||
switch ($this->frequency_id) {
|
||||
case 0: //used only for email entities
|
||||
$next_run = now()->startOfDay();
|
||||
break;
|
||||
case RecurringInvoice::FREQUENCY_DAILY:
|
||||
$next_run = now()->startOfDay()->addDay();
|
||||
break;
|
||||
|
@ -25,13 +25,18 @@ class SchedulerRepository extends BaseRepository
|
||||
*/
|
||||
public function save(array $data, Scheduler $scheduler): Scheduler
|
||||
{
|
||||
nlog($data);
|
||||
|
||||
$scheduler->fill($data);
|
||||
|
||||
$scheduler->save();
|
||||
|
||||
nlog($scheduler->withoutRelations()->toArray());
|
||||
|
||||
/** 18-5-2023 set client specific send times. */
|
||||
$scheduler->calculateNextRun();
|
||||
|
||||
nlog($scheduler->withoutRelations()->toArray());
|
||||
|
||||
return $scheduler->fresh();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user