mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 01:34:35 -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();
|
$offset = $this->company->timezone_offset();
|
||||||
|
|
||||||
switch ($this->frequency_id) {
|
switch ($this->frequency_id) {
|
||||||
|
case 0: //used only for email entities
|
||||||
|
$next_run = now()->startOfDay();
|
||||||
|
break;
|
||||||
case RecurringInvoice::FREQUENCY_DAILY:
|
case RecurringInvoice::FREQUENCY_DAILY:
|
||||||
$next_run = now()->startOfDay()->addDay();
|
$next_run = now()->startOfDay()->addDay();
|
||||||
break;
|
break;
|
||||||
|
@ -25,14 +25,19 @@ class SchedulerRepository extends BaseRepository
|
|||||||
*/
|
*/
|
||||||
public function save(array $data, Scheduler $scheduler): Scheduler
|
public function save(array $data, Scheduler $scheduler): Scheduler
|
||||||
{
|
{
|
||||||
|
nlog($data);
|
||||||
|
|
||||||
$scheduler->fill($data);
|
$scheduler->fill($data);
|
||||||
|
|
||||||
$scheduler->save();
|
$scheduler->save();
|
||||||
|
|
||||||
|
nlog($scheduler->withoutRelations()->toArray());
|
||||||
|
|
||||||
/** 18-5-2023 set client specific send times. */
|
/** 18-5-2023 set client specific send times. */
|
||||||
$scheduler->calculateNextRun();
|
$scheduler->calculateNextRun();
|
||||||
|
|
||||||
|
nlog($scheduler->withoutRelations()->toArray());
|
||||||
|
|
||||||
return $scheduler->fresh();
|
return $scheduler->fresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user