mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-08-04 10:15:03 +02:00
Fix Auto Renewall Cronjob
This commit is contained in:
parent
62cc7bf8a5
commit
e23b2464b8
8 changed files with 41 additions and 24 deletions
|
@ -19,17 +19,17 @@ class Balance
|
|||
{
|
||||
global $config;
|
||||
if ($config['allow_balance_transfer'] == 'yes') {
|
||||
if(Balance::min($id_customer, $amount)){
|
||||
if(Balance::plusByPhone($phoneTarget, $amount)){
|
||||
if (Balance::min($id_customer, $amount)) {
|
||||
if (Balance::plusByPhone($phoneTarget, $amount)) {
|
||||
return true;
|
||||
}else{
|
||||
} else {
|
||||
Balance::plus($id_customer, $amount);
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class Balance
|
|||
{
|
||||
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
|
||||
if ($c && $c['balance'] >= $amount) {
|
||||
$c->balance = $amount - $c['balance'];
|
||||
$c->balance = $c['balance'] - $amount;
|
||||
$c->save();
|
||||
return true;
|
||||
} else {
|
||||
|
@ -49,7 +49,7 @@ class Balance
|
|||
public static function plusByPhone($phone_customer, $amount)
|
||||
{
|
||||
$c = ORM::for_table('tbl_customers')->where('username', $phone_customer)->find_one();
|
||||
if($c){
|
||||
if ($c) {
|
||||
$c->balance = $amount + $c['balance'];
|
||||
$c->save();
|
||||
return true;
|
||||
|
@ -61,7 +61,7 @@ class Balance
|
|||
{
|
||||
$c = ORM::for_table('tbl_customers')->where('username', $phone_customer)->find_one();
|
||||
if ($c && $c['balance'] >= $amount) {
|
||||
$c->balance = $amount - $c['balance'];
|
||||
$c->balance = $c['balance'] - $amount;
|
||||
$c->save();
|
||||
return true;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue