diff --git a/app/Http/Controllers/CompanyController.php b/app/Http/Controllers/CompanyController.php index a7900a3f173c..61777161bb11 100644 --- a/app/Http/Controllers/CompanyController.php +++ b/app/Http/Controllers/CompanyController.php @@ -412,7 +412,8 @@ class CompanyController extends BaseController $company = $this->company_repo->save($request->all(), $company); - $company->saveSettings($request->input('settings'), $company); + /** We save the settings in the repository - this is duplicated */ + // $company->saveSettings($request->input('settings'), $company); if ($request->has('documents')) { $this->saveDocuments($request->input('documents'), $company, false); diff --git a/app/Jobs/Cron/RecurringInvoicesCron.php b/app/Jobs/Cron/RecurringInvoicesCron.php index 2e1e53ee218f..edd57acf265d 100644 --- a/app/Jobs/Cron/RecurringInvoicesCron.php +++ b/app/Jobs/Cron/RecurringInvoicesCron.php @@ -73,7 +73,6 @@ class RecurringInvoicesCron /* Special check if we should generate another invoice is the previous one is yet to be paid */ if ($recurring_invoice->company->stop_on_unpaid_recurring && $recurring_invoice->invoices()->whereIn('status_id', [2, 3])->where('is_deleted', 0)->where('balance', '>', 0)->exists()) { nlog('Existing invoice exists, skipping'); - return; } diff --git a/app/Utils/Traits/CompanySettingsSaver.php b/app/Utils/Traits/CompanySettingsSaver.php index 6f0c3217df8f..4d93281140e8 100644 --- a/app/Utils/Traits/CompanySettingsSaver.php +++ b/app/Utils/Traits/CompanySettingsSaver.php @@ -77,6 +77,18 @@ trait CompanySettingsSaver $entity->settings = $company_settings; + if(array_key_exists('settings', $entity->getDirty())) + { + $old_settings = $entity->getOriginal()['settings']; + + if($settings->name != $old_settings->name) { + + nlog("name change {$old_settings->name} -> {$settings->name} "); + + } + } + + $entity->save(); }