Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Apr 2, 2019
1 parent 796625c commit e6560f8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions app/Listeners/Updates/V13/Version1316.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use App\Listeners\Updates\Listener;
use App\Models\Common\Company;
use App\Utilities\Overrider;
use App\Models\Banking\Account;
use Artisan;
use Date;

Expand Down Expand Up @@ -93,6 +94,14 @@ protected function setSettings()
setting([$key => $value]);
}

if (empty(setting('general.default_account'))) {
$account = Account::where('company_id', $company->id)->first();

if ($account) {
setting()->set('general.default_account', $account->id);
}
}

setting()->save();
}

Expand Down
1 change: 1 addition & 0 deletions database/seeds/Accounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ private function create()
{
$company_id = $this->command->argument('company');

setting()->forgetAll();
setting()->setExtraColumns(['company_id' => $company_id]);

$rows = [
Expand Down
1 change: 0 additions & 1 deletion database/seeds/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ private function create()
{
$company_id = $this->command->argument('company');

setting()->forgetAll();
setting()->setExtraColumns(['company_id' => $company_id]);

setting()->set([
Expand Down

0 comments on commit e6560f8

Please sign in to comment.