1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Sending reminders command: Trying to get property of non-object #1806

This commit is contained in:
Hillel Coren 2018-01-14 15:20:45 +02:00
parent 9d1cb37835
commit ee03ae7003

View File

@ -1208,9 +1208,14 @@ class InvoiceRepository extends BaseRepository
public function findNeedingEndlessReminding(Account $account)
{
$frequencyId = $account->account_email_settings->frequency_id_reminder4;
$frequency = Utils::getFromCache($frequencyId, 'frequencies');
$settings = $account->account_email_settings;
$frequencyId = $settings->frequency_id_reminder4;
if (! $frequencyId || ! $account->enable_reminder4) {
return [];
}
$frequency = Utils::getFromCache($frequencyId, 'frequencies');
$lastSentDate = date_create();
$lastSentDate->sub(date_interval_create_from_date_string($frequency->date_interval));