Set the trial flag only once

This commit is contained in:
David Bomba 2023-01-15 19:05:52 +11:00
parent 3ce3187ec2
commit 7c3aaa4898
2 changed files with 3 additions and 2 deletions

View File

@ -437,7 +437,7 @@ class CreateTestData extends Command
'company_id' => $client->company->id,
]);
Document::factory()->count(5)->create([
Document::factory()->count(1)->create([
'user_id' => $client->user->id,
'company_id' => $client->company_id,
'documentable_type' => Vendor::class,

View File

@ -148,6 +148,7 @@ class NinjaPlanController extends Controller
$account->plan_term = 'month';
$account->plan_started = now();
$account->plan_expires = now()->addDays(14);
$account->is_trial=true;
$account->save();
}
@ -216,7 +217,7 @@ class NinjaPlanController extends Controller
if ($account) {
//offer the option to have a free trial
if (! $account->trial_started && ! $account->plan) {
if (!$account->is_trial) {
return $this->trial();
}