fix change plan when customer plan not active
This commit is contained in:
parent
1fbd393fa3
commit
f08d8e127e
@ -322,11 +322,12 @@ switch ($action) {
|
||||
$d->status = 'on';
|
||||
}
|
||||
}
|
||||
if ($d['status'] == 'on' && $oldPlanID != $id_plan) {
|
||||
if ($oldPlanID != $id_plan) {
|
||||
$d->plan_id = $newPlan['id'];
|
||||
$d->namebp = $newPlan['name_plan'];
|
||||
$customer = User::_info($d['customer_id']);
|
||||
//remove from old plan
|
||||
if ($d['status'] == 'on') {
|
||||
$p = ORM::for_table('tbl_plans')->find_one($oldPlanID);
|
||||
$dvc = Package::getDevice($p);
|
||||
if ($_app_stage != 'demo') {
|
||||
@ -348,6 +349,7 @@ switch ($action) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$d->save();
|
||||
_log('[' . $admin['username'] . ']: ' . 'Edit Plan for Customer ' . $d['username'] . ' to [' . $d['namebp'] . '][' . Lang::moneyFormat($p['price']) . ']', $admin['user_type'], $admin['id']);
|
||||
r2(U . 'plan/list', 's', Lang::T('Data Updated Successfully'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user