Merge branch 'master' of cybelle:kisscount
This commit is contained in:
commit
457bb7941a
10
www/User.php
10
www/User.php
|
@ -45,6 +45,15 @@ class User
|
||||||
return LoadCategory($this, $id);
|
return LoadCategory($this, $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function IsAccountBlocked($id)
|
||||||
|
{
|
||||||
|
foreach($this->accounts as $i => $ac)
|
||||||
|
if ($ac->id == $id)
|
||||||
|
return $ac["blocked"] == "1";
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
function GetAccountName($id)
|
function GetAccountName($id)
|
||||||
{
|
{
|
||||||
foreach($this->accounts as $i => $account)
|
foreach($this->accounts as $i => $account)
|
||||||
|
@ -54,4 +63,5 @@ class User
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -97,7 +97,8 @@ $total_incomes = $total_outcomes = $cur_incomes = $cur_outcomes = 0;
|
||||||
|
|
||||||
while($operation = $operations->fetchArray())
|
while($operation = $operations->fetchArray())
|
||||||
{
|
{
|
||||||
if ($operation["transfert"] != "" || $operation["meta"] == "1") continue;
|
if ($operation["meta"] == "1")
|
||||||
|
continue;
|
||||||
|
|
||||||
$date = mktime(0, 0, 0, $operation["month"]+1, $operation["day"]+1, $operation["year"]);
|
$date = mktime(0, 0, 0, $operation["month"]+1, $operation["day"]+1, $operation["year"]);
|
||||||
|
|
||||||
|
@ -106,6 +107,16 @@ while($operation = $operations->fetchArray())
|
||||||
if ($date <= $cur_date)
|
if ($date <= $cur_date)
|
||||||
$accounts[$operation["account"]]["cur"] += $operation["amount"];
|
$accounts[$operation["account"]]["cur"] += $operation["amount"];
|
||||||
|
|
||||||
|
if ($operation["transfert"] != "" && ($operation["amount"] < 0
|
||||||
|
|| $_SESSION["user"]->IsAccountBlocked($operation["account"])))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
|
||||||
|
if ($operation["transfert"] != "")
|
||||||
|
{
|
||||||
|
$operation["amount"] = -$operation["amount"];
|
||||||
|
}
|
||||||
|
|
||||||
if ($operation["amount"] < 0)
|
if ($operation["amount"] < 0)
|
||||||
{
|
{
|
||||||
$categories[$operation["category"]] -= $operation["amount"];
|
$categories[$operation["category"]] -= $operation["amount"];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user