mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Fix for scheduled reports
This commit is contained in:
parent
d268b29a61
commit
f01cf35a92
@ -172,6 +172,9 @@ class SendReminders extends Command
|
||||
$config = (array) json_decode($scheduledReport->config);
|
||||
$reportType = $config['report_type'];
|
||||
|
||||
// send email as user
|
||||
auth()->onceUsingId($user->id);
|
||||
|
||||
$report = dispatch(new RunReport($scheduledReport->user, $reportType, $config, true));
|
||||
$file = dispatch(new ExportReportResults($scheduledReport->user, $config['export_format'], $reportType, $report->exportParams));
|
||||
|
||||
@ -180,6 +183,8 @@ class SendReminders extends Command
|
||||
}
|
||||
|
||||
$scheduledReport->updateSendDate();
|
||||
|
||||
auth()->logout();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,11 +61,6 @@ class RunReport extends Job
|
||||
$endDate = $config['end_date'];
|
||||
}
|
||||
|
||||
// send email as user
|
||||
if (App::runningInConsole() && $this->user) {
|
||||
auth()->onceUsingId($this->user->id);
|
||||
}
|
||||
|
||||
$report = new $reportClass($startDate, $endDate, $isExport, $config);
|
||||
$report->run();
|
||||
|
||||
@ -77,10 +72,6 @@ class RunReport extends Job
|
||||
|
||||
$report->exportParams = array_merge($params, $report->results());
|
||||
|
||||
if (App::runningInConsole() && $this->user) {
|
||||
auth()->logout();
|
||||
}
|
||||
|
||||
return $report;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user