diff --git a/system/controllers/home.php b/system/controllers/home.php index 37147063..85e85836 100644 --- a/system/controllers/home.php +++ b/system/controllers/home.php @@ -25,6 +25,9 @@ if (_post('send') == 'balance') { if ($user['balance'] < $balance) { r2(U . 'home', 'd', Lang::T('insufficient balance')); } + if (intval($config['minimum_transfer']) >= intval($balance)) { + r2(U . 'home', 'd', Lang::T('Minimum Transfer') . ' ' . Lang::moneyFormat($config['minimum_transfer'])); + } if ($user['username'] == $target['username']) { r2(U . 'home', 'd', Lang::T('Cannot send to yourself')); } @@ -46,7 +49,6 @@ if (_post('send') == 'balance') { $d->pg_url_payment = 'balance'; $d->status = 2; $d->save(); - Message::sendBalanceNotification($user['phonenumber'], $target['fullname'] . ' (' . $target['username'] . ')', $balance, Lang::getNotifText('balance_send'), $config['user_notification_reminder']); //receiver $d = ORM::for_table('tbl_payment_gateway')->create(); $d->username = $target['username']; @@ -64,7 +66,8 @@ if (_post('send') == 'balance') { $d->pg_url_payment = 'balance'; $d->status = 2; $d->save(); - Message::sendBalanceNotification($target['phonenumber'], $user['fullname'] . ' (' . $user['username'] . ')', $balance, Lang::getNotifText('balance_received'), $config['user_notification_reminder']); + Message::sendBalanceNotification($user['phonenumber'], $target['fullname'] . ' (' . $target['username'] . ')', $balance, Lang::getNotifText('balance_send'), $config['user_notification_payment']); + Message::sendBalanceNotification($target['phonenumber'], $user['fullname'] . ' (' . $user['username'] . ')', $balance, Lang::getNotifText('balance_received'), $config['user_notification_payment']); Message::sendTelegram("#u$user[username] send balance to #u$target[username] \n" . Lang::moneyFormat($balance)); r2(U . 'home', 's', Lang::T('Sending balance success')); } diff --git a/system/controllers/settings.php b/system/controllers/settings.php index 5b0d94e4..c764a33f 100644 --- a/system/controllers/settings.php +++ b/system/controllers/settings.php @@ -213,6 +213,7 @@ switch ($action) { $telegram_target_id = _post('telegram_target_id'); $sms_url = _post('sms_url'); $wa_url = _post('wa_url'); + $minimum_transfer = _post('minimum_transfer'); $user_notification_expired = _post('user_notification_expired'); $user_notification_reminder = _post('user_notification_reminder'); $user_notification_payment = _post('user_notification_payment'); @@ -281,6 +282,17 @@ switch ($action) { $d->save(); } + $d = ORM::for_table('tbl_appconfig')->where('setting', 'minimum_transfer')->find_one(); + if($d){ + $d->value = $minimum_transfer; + $d->save(); + }else{ + $d = ORM::for_table('tbl_appconfig')->create(); + $d->setting = 'minimum_transfer'; + $d->value = $minimum_transfer; + $d->save(); + } + $d = ORM::for_table('tbl_appconfig')->where('setting', 'telegram_bot')->find_one(); if($d){ $d->value = $telegram_bot; diff --git a/system/lan/english/common.lan.php b/system/lan/english/common.lan.php index b8340e4a..4a65d646 100644 --- a/system/lan/english/common.lan.php +++ b/system/lan/english/common.lan.php @@ -382,3 +382,5 @@ $_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'; diff --git a/ui/ui/app-settings.tpl b/ui/ui/app-settings.tpl index 02e44903..566849df 100644 --- a/ui/ui/app-settings.tpl +++ b/ui/ui/app-settings.tpl @@ -107,6 +107,13 @@
{Lang::T('Allow balance transfer between customers')}
+