mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 06:24:35 -04:00
Set the trial flag only once
This commit is contained in:
parent
3ce3187ec2
commit
7c3aaa4898
@ -437,7 +437,7 @@ class CreateTestData extends Command
|
|||||||
'company_id' => $client->company->id,
|
'company_id' => $client->company->id,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Document::factory()->count(5)->create([
|
Document::factory()->count(1)->create([
|
||||||
'user_id' => $client->user->id,
|
'user_id' => $client->user->id,
|
||||||
'company_id' => $client->company_id,
|
'company_id' => $client->company_id,
|
||||||
'documentable_type' => Vendor::class,
|
'documentable_type' => Vendor::class,
|
||||||
|
@ -148,6 +148,7 @@ class NinjaPlanController extends Controller
|
|||||||
$account->plan_term = 'month';
|
$account->plan_term = 'month';
|
||||||
$account->plan_started = now();
|
$account->plan_started = now();
|
||||||
$account->plan_expires = now()->addDays(14);
|
$account->plan_expires = now()->addDays(14);
|
||||||
|
$account->is_trial=true;
|
||||||
$account->save();
|
$account->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,7 +217,7 @@ class NinjaPlanController extends Controller
|
|||||||
|
|
||||||
if ($account) {
|
if ($account) {
|
||||||
//offer the option to have a free trial
|
//offer the option to have a free trial
|
||||||
if (! $account->trial_started && ! $account->plan) {
|
if (!$account->is_trial) {
|
||||||
return $this->trial();
|
return $this->trial();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user