add nonZero lease type
This commit is contained in:
@@ -604,6 +604,8 @@ class user_kid extends user_parent {
|
||||
$balance = $this->get_uk_balance_transfer();
|
||||
}
|
||||
}
|
||||
|
||||
$nonZero = false;
|
||||
foreach ($_de_obj_array as $i => $_de) {
|
||||
//minden lépésben az balance-t be kell állítani az előző lépésben updatelt balance-ra
|
||||
if (isset($_de_obj_array[$i-1])) {
|
||||
@@ -627,16 +629,25 @@ class user_kid extends user_parent {
|
||||
$trainingPrice = $training->get_tr_price();
|
||||
$_de->set_de_transaction(-$trainingPrice); //beállítjuk, mennyivel csökken az egyenleg
|
||||
if (0 == $i) {
|
||||
$_de->set_de_balance($balance+$_de->get_de_transaction()); //beállítjuk az új egyenleget
|
||||
$newBalance = $balance+$_de->get_de_transaction();
|
||||
if (!$nonZero) {
|
||||
$_de->set_de_balance($newBalance); //beállítjuk az új egyenleget
|
||||
//$newBalance = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$_de->set_de_balance($_de->get_de_balance()+$_de->get_de_transaction()); //beállítjuk az új egyenleget
|
||||
$newBalance = $_de->get_de_balance()+$_de->get_de_transaction();
|
||||
if (!$nonZero) {
|
||||
$_de->set_de_balance($newBalance); //beállítjuk az új egyenleget
|
||||
//$newBalance = 0;
|
||||
}
|
||||
}
|
||||
//echo $_de->get_de_date() . " minusz 1200<br><br>";
|
||||
|
||||
}
|
||||
elseif ($_de->get_de_type() == 'money_deposit') {
|
||||
$actualExpireDate = $_de->get_de_money_deposit()->get_mod_expire_date();
|
||||
$nonZero = $_de->get_de_money_deposit()->get_mod_non_zero();
|
||||
$_de->set_de_transaction($_de->get_de_money_deposit()->get_mod_money_income()->get_mi_sum());
|
||||
|
||||
//ha ez a befizetés az utolsó és lejárt, akkor ne adjuk hozzá a balancehoz
|
||||
|
||||
Reference in New Issue
Block a user