fixed balance bug (expire date)
This commit is contained in:
@@ -611,8 +611,13 @@ class user_kid extends user_parent {
|
|||||||
else {
|
else {
|
||||||
$_de->set_de_balance($balance);
|
$_de->set_de_balance($balance);
|
||||||
}
|
}
|
||||||
|
//var_dump($_de->get_de_date());
|
||||||
|
//var_dump(date('Y-m-d 23:59:59', strtotime($actualExpireDate)));
|
||||||
|
if ($_de->get_de_date() > date('Y-m-d 23:59:59', strtotime($actualExpireDate))) {
|
||||||
|
$_de->set_de_expired(true);
|
||||||
|
}
|
||||||
|
|
||||||
if ($_de->get_de_date() > $actualExpireDate) {
|
if ($_de->get_de_date() > date('Y-m-d 23:59:59', strtotime($actualExpireDate)) && $_de->get_de_balance() > 0) {
|
||||||
$_de->set_de_balance(0);
|
$_de->set_de_balance(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -634,11 +639,17 @@ class user_kid extends user_parent {
|
|||||||
elseif ($_de->get_de_type() == 'money_deposit') {
|
elseif ($_de->get_de_type() == 'money_deposit') {
|
||||||
$actualExpireDate = $_de->get_de_money_deposit()->get_mod_expire_date();
|
$actualExpireDate = $_de->get_de_money_deposit()->get_mod_expire_date();
|
||||||
$_de->set_de_transaction($_de->get_de_money_deposit()->get_mod_money_income()->get_mi_sum());
|
$_de->set_de_transaction($_de->get_de_money_deposit()->get_mod_money_income()->get_mi_sum());
|
||||||
if (!$_de->get_de_expired() || !$update) {
|
|
||||||
|
//ha ez a befizetés az utolsó és lejárt, akkor ne adjuk hozzá a balancehoz
|
||||||
|
if ($i < (count($_de_obj_array) -1 ) || !$_de->get_de_expired()) {
|
||||||
|
$_de->set_de_balance($_de->get_de_balance()+$_de->get_de_transaction());
|
||||||
|
}
|
||||||
|
|
||||||
|
/*if (!$_de->get_de_expired() || !$update) {
|
||||||
$_de->set_de_balance($_de->get_de_balance()+$_de->get_de_transaction());
|
$_de->set_de_balance($_de->get_de_balance()+$_de->get_de_transaction());
|
||||||
} elseif($update) {
|
} elseif($update) {
|
||||||
$_de->set_de_balance(0);
|
$_de->set_de_balance(0);
|
||||||
}
|
}*/
|
||||||
//$balance += $_de->get_de_money_deposit()->get_mod_sum();
|
//$balance += $_de->get_de_money_deposit()->get_mod_sum();
|
||||||
//echo $_de->get_de_date() . " plussz " . $_de->get_de_money_deposit()->get_mod_sum() . "<br><br>";
|
//echo $_de->get_de_date() . " plussz " . $_de->get_de_money_deposit()->get_mod_sum() . "<br><br>";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user