Skip to content

Commit

Permalink
Merge pull request #14690 from marcusmoore/import-settings-properly
Browse files Browse the repository at this point in the history
Load settings in `SendUpcomingAuditReport` command
  • Loading branch information
snipe authored May 7, 2024
2 parents 3594ed6 + 7e9c8ba commit fd929f5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/Console/Commands/SendUpcomingAuditReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@ public function __construct()
*/
public function handle()
{

$settings = Setting::getSettings();
$interval = $settings->audit_warning_days ?? 0;
$today = Carbon::now();
$interval_date = $today->copy()->addDays($interval);

$settings = Setting::getSettings();
$assets = Asset::whereNull('deleted_at')->DueOrOverdueForAudit($settings)->orderBy('assets.next_audit_date', 'desc')->get();
$this->info($assets->count().' assets must be audited in on or before '.$interval_date.' is deadline');

Expand Down

0 comments on commit fd929f5

Please sign in to comment.