Fixed some views.

This commit is contained in:
James Cole
2015-05-20 07:20:02 +02:00
parent 95ef691077
commit 9e54eecfaa
5 changed files with 52 additions and 22 deletions
+2 -2
View File
@@ -37,14 +37,14 @@ class Expense
$accountId = $entry->account_id;
if (!$this->expenses->has($accountId)) {
$newObject = new stdClass;
$newObject->amount = floatval($entry->queryAmount);
$newObject->amount = floatval($entry->amount);
$newObject->name = $entry->name;
$newObject->count = 1;
$newObject->id = $accountId;
$this->expenses->put($accountId, $newObject);
} else {
$existing = $this->expenses->get($accountId);
$existing->amount += floatval($entry->queryAmount);
$existing->amount += floatval($entry->amount);
$existing->count++;
$this->expenses->put($accountId, $existing);
}
+2 -2
View File
@@ -38,14 +38,14 @@ class Income
$accountId = $entry->account_id;
if (!$this->incomes->has($accountId)) {
$newObject = new stdClass;
$newObject->amount = floatval($entry->queryAmount);
$newObject->amount = floatval($entry->amount);
$newObject->name = $entry->name;
$newObject->count = 1;
$newObject->id = $accountId;
$this->incomes->put($accountId, $newObject);
} else {
$existing = $this->incomes->get($accountId);
$existing->amount += floatval($entry->queryAmount);
$existing->amount += floatval($entry->amount);
$existing->count++;
$this->incomes->put($accountId, $existing);
}