mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Improve logic for migrating account plans from hosted and self hosted instances
This commit is contained in:
parent
78358f2e49
commit
76dfbddca3
@ -349,6 +349,26 @@ class Import implements ShouldQueue
|
||||
}
|
||||
|
||||
$account = $this->company->account;
|
||||
|
||||
/* If the user has upgraded their account, do not wipe their payment plan*/
|
||||
if($account->isPaid() || (isset($data['plan']) && $data['plan'] == 'white_label'))
|
||||
{
|
||||
if(isset($data['plan']))
|
||||
unset($data['plan']);
|
||||
|
||||
if(isset($data['plan_term']))
|
||||
unset($data['plan_term']);
|
||||
|
||||
if(isset($data['plan_paid']))
|
||||
unset($data['plan_paid']);
|
||||
|
||||
if(isset($data['plan_started']))
|
||||
unset($data['plan_started']);
|
||||
|
||||
if(isset($data['plan_expires']))
|
||||
unset($data['plan_expires']);
|
||||
}
|
||||
|
||||
$account->fill($data);
|
||||
$account->save();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user