diff --git a/system/autoload/Balance.php b/system/autoload/Balance.php
index f6557a3f..208551c1 100644
--- a/system/autoload/Balance.php
+++ b/system/autoload/Balance.php
@@ -19,12 +19,7 @@ class Balance
     {
         global $config;
         if (Balance::min($id_customer, $amount)) {
-            if (Balance::plusByPhone($phoneTarget, $amount)) {
-                return true;
-            } else {
-                Balance::plus($id_customer, $amount);
-                return false;
-            }
+            return Balance::plusByPhone($phoneTarget, $amount);
         } else {
             return false;
         }
diff --git a/system/controllers/home.php b/system/controllers/home.php
index 851a7a16..e2ecaaac 100644
--- a/system/controllers/home.php
+++ b/system/controllers/home.php
@@ -72,7 +72,17 @@ if (_post('send') == 'balance') {
             r2(U . 'home', 's', Lang::T('Sending balance success'));
         }
     } else {
-        r2(U . 'home', 'd', 'Failed, balance is not available');
+        r2(U . 'home', 'd', Lang::T('Failed, balance is not available'));
+    }
+}else if (_post('send') == 'plan') {
+    $active = ORM::for_table('tbl_user_recharges')
+        ->where('username', _post('username'))
+        ->find_one();
+    $router = ORM::for_table('tbl_routers') ->where('name', $active['routers'])->find_one();
+    if($router){
+        r2(U . "order/send/$router[id]/$active[plan_id]&u=".trim(_post('username')), 's', Lang::T('Review package before recharge'));
+    }else{
+        r2(U . 'package/order', 'w', Lang::T('Your friend do not have active package'));
     }
 }
 
diff --git a/system/controllers/order.php b/system/controllers/order.php
index d665889b..b87137fa 100644
--- a/system/controllers/order.php
+++ b/system/controllers/order.php
@@ -98,7 +98,7 @@ switch ($action) {
             }
         }
         if (empty($trx)) {
-            r2(U . "order", 'e', Lang::T("Transaction Not found"));
+            r2(U . "order/package", 'e', Lang::T("Transaction Not found"));
         }
         $router = ORM::for_table('tbl_routers')->find_one($trx['routers_id']);
         $plan = ORM::for_table('tbl_plans')->find_one($trx['plan_id']);
@@ -111,8 +111,8 @@ switch ($action) {
         $ui->display('user-orderView.tpl');
         break;
     case 'pay':
-        if ($_c['enable_balance'] != 'yes'){
-            r2(U . "order", 'e', Lang::T("Balance not enabled"));
+        if ($_c['enable_balance'] != 'yes' && $config['allow_balance_transfer'] != 'yes') {
+            r2(U . "order/package", 'e', Lang::T("Balance not enabled"));
         }
         $plan = ORM::for_table('tbl_plans')->where('enabled', '1')->find_one($routes['3']);
         $router = ORM::for_table('tbl_routers')->where('enabled', '1')->find_one($routes['2']);
@@ -130,10 +130,91 @@ switch ($action) {
                     "\nRouter: " . $router_name .
                     "\nPrice: " . $p['price']);
             }
-        }else{
+        } else {
             echo "no renewall | plan enabled: $p[enabled] | User balance: $c[balance] | price $p[price]\n";
         }
         break;
+    case 'send':
+        if ($_c['enable_balance'] != 'yes') {
+            r2(U . "order/package", 'e', Lang::T("Balance not enabled"));
+        }
+        $ui->assign('_title', Lang::T('Buy for friend'));
+        $ui->assign('_system_menu', 'package');
+        $plan = ORM::for_table('tbl_plans')->find_one($routes['3']);
+        if (empty($plan)) {
+            r2(U . "order/package", 'e', Lang::T("Plan Not found"));
+        }
+        if (isset($_POST['send']) && $_POST['send'] == 'plan') {
+            $target = ORM::for_table('tbl_customers')->where('username', _post('username'))->find_one();
+            if (!$target) {
+                r2(U . 'home', 'd', Lang::T('Username not found'));
+            }
+            if ($user['balance'] < $plan['price']) {
+                r2(U . 'home', 'd', Lang::T('insufficient balance'));
+            }
+            if ($user['username'] == $target['username']) {
+                r2(U . "order/pay/$routes[2]/$routes[3]", 's', '^_^ v');
+            }
+            $active = ORM::for_table('tbl_user_recharges')
+                ->where('username', _post('username'))
+                ->where('status', 'on')
+                ->find_one();
+
+            if ($active['plan_id'] != $plan['id']) {
+                r2(U . "order/package", 'e', Lang::T("Target has active plan, different with current plant.")." [ <b>$active[namebp]</b> ]");
+            }
+            if (Package::rechargeUser($target['id'], $plan['routers'], $plan['id'], $user['fullname'], 'Balance')) {
+                // if success, then get the balance
+                Balance::min($user['id'], $plan['price']);
+                //sender
+                $d = ORM::for_table('tbl_payment_gateway')->create();
+                $d->username = $user['username'];
+                $d->gateway = $target['username'];
+                $d->plan_id = $plan['id'];
+                $d->plan_name = $plan['name_plan'];
+                $d->routers_id = $routes['2'];
+                $d->routers = $plan['routers'];
+                $d->price = $plan['price'];
+                $d->payment_method = "Balance";
+                $d->payment_channel = "Send Plan";
+                $d->created_date = date('Y-m-d H:i:s');
+                $d->paid_date = date('Y-m-d H:i:s');
+                $d->expired_date = date('Y-m-d H:i:s');
+                $d->pg_url_payment = 'balance';
+                $d->status = 2;
+                $d->save();
+                $trx_id = $d->id();
+                //receiver
+                $d = ORM::for_table('tbl_payment_gateway')->create();
+                $d->username = $target['username'];
+                $d->gateway = $user['username'];
+                $d->plan_id = $plan['id'];
+                $d->plan_name = $plan['name_plan'];
+                $d->routers_id = $routes['2'];
+                $d->routers = $plan['routers'];
+                $d->price = $plan['price'];
+                $d->payment_method = "Balance";
+                $d->payment_channel = "Received Plan";
+                $d->created_date = date('Y-m-d H:i:s');
+                $d->paid_date = date('Y-m-d H:i:s');
+                $d->expired_date = date('Y-m-d H:i:s');
+                $d->pg_url_payment = 'balance';
+                $d->status = 2;
+                $d->save();
+                r2(U . "order/view/$trx_id", 's', Lang::T("Success to send package"));
+            } else {
+                r2(U . "order/package", 'e', Lang::T("Failed to Send package"));
+                Message::sendTelegram("Send Package with Balance Failed\n\n#u$user[username] #send \n" . $plan['name_plan'] .
+                    "\nRouter: " . $plan['routers'] .
+                    "\nPrice: " . $plan['price']);
+            }
+        }
+
+        $ui->assign('username', $_GET['u']);
+        $ui->assign('router', $router);
+        $ui->assign('plan', $plan);
+        $ui->display('user-sendPlan.tpl');
+        break;
     case 'buy':
         if (strpos($user['email'], '@') === false) {
             r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address"));
@@ -147,9 +228,9 @@ switch ($action) {
         run_hook('customer_buy_plan'); #HOOK
         include 'system/paymentgateway/' . $config['payment_gateway'] . '.php';
         call_user_func($config['payment_gateway'] . '_validate_config');
-        if ($routes['2']>0) {
+        if ($routes['2'] > 0) {
             $router = ORM::for_table('tbl_routers')->where('enabled', '1')->find_one($routes['2']);
-        }else{
+        } else {
             $router['id'] = 0;
             $router['name'] = 'balance';
         }
@@ -205,5 +286,5 @@ switch ($action) {
         }
         break;
     default:
-    r2(U . "order/package/", 's','');
+        r2(U . "order/package/", 's', '');
 }
diff --git a/system/lan/english/common.lan.php b/system/lan/english/common.lan.php
index ffa3f126..1988c935 100644
--- a/system/lan/english/common.lan.php
+++ b/system/lan/english/common.lan.php
@@ -375,18 +375,28 @@ $_L['Active'] = 'Active';
 $_L['Transfer_Balance'] = 'Transfer Balance';
 $_L['Send_your_balance'] = 'Send your balance?';
 $_L['Send'] = 'Send';
-$_L['Cannot_send_to_yourself'] = 'Cannot send to yourself';
-$_L['Sending_balance_success'] = 'Sending balance success';
-$_L['From'] = 'From';
-$_L['To'] = 'To';
-$_L['insufficient_balance'] = 'insufficient balance';
-$_L['Send_Balance'] = 'Send Balance';
-$_L['Received_Balance'] = 'Received Balance';
-$_L['Minimum_Balance_Transfer'] = 'Minimum Balance Transfer';
-$_L['Minimum_Transfer'] = 'Minimum Transfer';
-$_L['Company_Logo'] = 'Company Logo';
-$_L['Expired_IP_Pool'] = 'Expired IP Pool';
-$_L['Expired_IP_Pool'] = 'Expired IP Pool';
-$_L['Proxy'] = 'Proxy';
-$_L['Proxy_Server'] = 'Proxy Server';
-$_L['Proxy_Server_Login'] = 'Proxy Server Login';
+$_L['Cannot_send_to_yourself'] = 'Cannot send to yourself';
+$_L['Sending_balance_success'] = 'Sending balance success';
+$_L['From'] = 'From';
+$_L['To'] = 'To';
+$_L['insufficient_balance'] = 'insufficient balance';
+$_L['Send_Balance'] = 'Send Balance';
+$_L['Received_Balance'] = 'Received Balance';
+$_L['Minimum_Balance_Transfer'] = 'Minimum Balance Transfer';
+$_L['Minimum_Transfer'] = 'Minimum Transfer';
+$_L['Company_Logo'] = 'Company Logo';
+$_L['Expired_IP_Pool'] = 'Expired IP Pool';
+$_L['Expired_IP_Pool'] = 'Expired IP Pool';
+$_L['Proxy'] = 'Proxy';
+$_L['Proxy_Server'] = 'Proxy Server';
+$_L['Proxy_Server_Login'] = 'Proxy Server Login';
+$_L['Hotspot_Plan'] = 'Hotspot Plan';
+$_L['PPPOE_Plan'] = 'PPPOE Plan';
+$_L['UNKNOWN'] = 'UNKNOWN';
+$_L['Are_You_Sure'] = 'Are You Sure?';
+$_L['Success_to_send_package'] = 'Success to send package';
+$_L['Target_has_active_plan_different_with_current_plant'] = 'Target has active plan, different with current plant.';
+$_L['Recharge_a_friend'] = 'Recharge a friend';
+$_L['Buy_for_friend'] = 'Buy for friend';
+$_L['Buy_this_for_friend_account'] = 'Buy this for friend account?';
+$_L['Review_package_before_recharge'] = 'Review package before recharge';
diff --git a/ui/ui/sections/user-header.tpl b/ui/ui/sections/user-header.tpl
index e90f29bf..e5666a96 100644
--- a/ui/ui/sections/user-header.tpl
+++ b/ui/ui/sections/user-header.tpl
@@ -104,7 +104,7 @@
             </nav>
         </header>
 
-        <aside class="main-sidebar">
+        <aside class="main-sidebar" style="position:fixed;">
             <section class="sidebar">
                 <ul class="sidebar-menu" data-widget="tree">
                     <li {if $_system_menu eq 'home'}class="active" {/if}>
diff --git a/ui/ui/user-dashboard.tpl b/ui/ui/user-dashboard.tpl
index 28368ebf..35319640 100644
--- a/ui/ui/user-dashboard.tpl
+++ b/ui/ui/user-dashboard.tpl
@@ -167,7 +167,7 @@
                             </div>
                             <div class="form-group col-sm-2" align="center">
                                 <button class="btn btn-success btn-block" id="sendBtn" type="submit" name="send"
-                                    value="balance"><i class="glyphicon glyphicon-send"></i></button>
+                                    onclick="return confirm('{Lang::T("Are You Sure?")}')" value="balance"><i class="glyphicon glyphicon-send"></i></button>
                             </div>
                         </div>
                     </form>
@@ -183,6 +183,23 @@
                         }
                     </script>
                 </div>
+                <div class="box-header">
+                    <h4 class="box-title">{Lang::T("Recharge a friend")}</h4>
+                </div>
+                <div class="box-body p-0">
+                    <form method="post" role="form" action="{$_url}home">
+                        <div class="form-group">
+                            <div class="col-sm-10">
+                                <input type="text" id="username" name="username" class="form-control" required
+                                    placeholder="{$_L['Username']}">
+                            </div>
+                            <div class="form-group col-sm-2" align="center">
+                                <button class="btn btn-success btn-block" id="sendBtn" type="submit" name="send"
+                                    onclick="return confirm('{Lang::T("Are You Sure?")}')" value="plan"><i class="glyphicon glyphicon-send"></i></button>
+                            </div>
+                        </div>
+                    </form>
+                </div>
             </div>
         {/if}
         <br>
diff --git a/ui/ui/user-orderPlan.tpl b/ui/ui/user-orderPlan.tpl
index 29a384a6..96a5829d 100644
--- a/ui/ui/user-orderPlan.tpl
+++ b/ui/ui/user-orderPlan.tpl
@@ -43,7 +43,7 @@
                     </div>
                 {/if}
                 {if count($plans_hotspot)>0}
-                    <div class="box-header">Hotspot</div>
+                    <div class="box-header">{Lang::T('Hotspot Plan')}</div>
                     <div class="box-body row">
                         {foreach $plans_hotspot as $plan}
                             {if $router['name'] eq $plan['routers']}
@@ -79,6 +79,11 @@
                                                         class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
                                                 {/if}
                                             </div>
+                                            {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']}
+                                                <a href="{$_url}order/send/{$router['id']}/{$plan['id']}"
+                                                    onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
+                                                    class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
+                                            {/if}
                                         </div>
                                     </div>
                                 </div>
@@ -87,7 +92,7 @@
                     </div>
                 {/if}
                 {if count($plans_pppoe)>0}
-                    <div class="box-header text-sm">PPPOE</div>
+                    <div class="box-header text-sm">{Lang::T('PPPOE Plan')}</div>
                     <div class="box-body row">
                         {foreach $plans_pppoe as $plan}
                             {if $router['name'] eq $plan['routers']}
@@ -123,6 +128,11 @@
                                                         class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
                                                 {/if}
                                             </div>
+                                            {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']}
+                                                <a href="{$_url}order/send/{$router['id']}/{$plan['id']}"
+                                                    onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
+                                                    class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
+                                            {/if}
                                         </div>
                                     </div>
                                 </div>
diff --git a/ui/ui/user-sendPlan.tpl b/ui/ui/user-sendPlan.tpl
new file mode 100644
index 00000000..1e959da2
--- /dev/null
+++ b/ui/ui/user-sendPlan.tpl
@@ -0,0 +1,43 @@
+{include file="sections/user-header.tpl"}
+<!-- user-orderView -->
+<div class="row">
+    <div class="col-md-3"></div>
+    <div class="col-md-6">
+        <div class="box box-solid box-default">
+            <div class="box-header">{$plan['name_plan']}</div>
+            <div class="table-responsive">
+                <table class="table table-bordered table-striped">
+                    <tbody>
+                        <tr>
+                            <td>{Lang::T('Type')}</td>
+                            <td>{$plan['type']}</td>
+                        </tr>
+                        <tr>
+                            <td>{Lang::T('Price')}</td>
+                            <td>{Lang::moneyFormat($plan['price'])}</td>
+                        </tr>
+                        <tr>
+                            <td>{Lang::T('Validity')}</td>
+                            <td>{$plan['validity']} {$plan['validity_unit']}</td>
+                        </tr>
+                    </tbody>
+                </table>
+            </div>
+            <div class="box-footer">
+                <form method="post" onsubmit="return askConfirm()" role="form">
+                    <div class="form-group">
+                        <div class="col-sm-9">
+                            <input type="text" id="username" name="username" class="form-control" required value="{$username}"
+                                placeholder="{$_L['Username']}">
+                        </div>
+                        <div class="form-group col-sm-3" align="center">
+                            <button class="btn btn-success btn-block" id="sendBtn" type="submit" name="send" onclick="return confirm('{Lang::T("Are You Sure?")}')"
+                                value="plan"><i class="glyphicon glyphicon-send"></i></button>
+                        </div>
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
+</div>
+{include file="sections/user-footer.tpl"}
\ No newline at end of file