Several minor changes including a couple minor bugfixes.
git-svn-id: file:///svn-source/pmgr/branches/surplus_account_20090815@592 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -1169,9 +1169,12 @@ class Transaction extends AppModel {
|
||||
$squery['fields'][] = "SUM(Transaction.amount) AS total";
|
||||
$squery['fields'][] = "COUNT(Transaction.id) AS count";
|
||||
$stats = $this->find('first', $squery);
|
||||
if (empty($stats))
|
||||
return $this->prReturn(array());
|
||||
$stats = $stats[0];
|
||||
unset($stats[0]);
|
||||
|
||||
|
||||
foreach ($this->hasMany AS $table => $association) {
|
||||
// Only calculate stats for *Entry types
|
||||
if (!preg_match("/Entry$/", $table) &&
|
||||
|
||||
Reference in New Issue
Block a user