diff --git a/system/cron.php b/system/cron.php index 9cc55190..e722a9d8 100644 --- a/system/cron.php +++ b/system/cron.php @@ -61,6 +61,13 @@ foreach ($d as $ds) { // autorenewal from deposit if ($config['enable_balance'] == 'yes' && $c['auto_renewal']) { + $add_rem = User::getAttribute("Additional Remaining", $ds['customer_id']); + if ($add_rem != 0) { + $add_cost = User::getAttribute("Additional Cost", $ds['customer_id']); + if (!empty($add_cost)) { + $p['price'] += $add_cost; + } + } if ($p && $p['enabled'] && $c['balance'] >= $p['price']) { if (Package::rechargeUser($ds['customer_id'], $p['routers'], $p['id'], 'Customer', 'Balance')) { // if success, then get the balance @@ -116,6 +123,13 @@ foreach ($d as $ds) { // autorenewal from deposit if ($config['enable_balance'] == 'yes' && $c['auto_renewal']) { + $add_rem = User::getAttribute("Additional Remaining", $ds['customer_id']); + if ($add_rem != 0) { + $add_cost = User::getAttribute("Additional Cost", $ds['customer_id']); + if (!empty($add_cost)) { + $p['price'] += $add_cost; + } + } if ($p && $p['enabled'] && $c['balance'] >= $p['price']) { if (Package::rechargeUser($ds['customer_id'], $p['routers'], $p['id'], 'Customer', 'Balance')) { // if success, then get the balance diff --git a/system/cron_reminder.php b/system/cron_reminder.php index cc8260b5..82d2b611 100644 --- a/system/cron_reminder.php +++ b/system/cron_reminder.php @@ -38,6 +38,13 @@ foreach ($d as $ds) { $u = ORM::for_table('tbl_user_recharges')->where('id', $ds['id'])->find_one(); $p = ORM::for_table('tbl_plans')->where('id', $u['plan_id'])->find_one(); $c = ORM::for_table('tbl_customers')->where('id', $ds['customer_id'])->find_one(); + $add_rem = User::getAttribute("Additional Remaining", $ds['customer_id']); + if ($add_rem != 0) { + $add_cost = User::getAttribute("Additional Cost", $ds['customer_id']); + if (!empty($add_cost)) { + $p['price'] += $add_cost; + } + } if ($p['validity_unit'] == 'Period') { // Postpaid price from field $add_inv = User::getAttribute("Invoice", $ds['customer_id']);