Fixed problem when trying to calculate transaction stats. The current solution is a bit dodgy, but by limiting the queries to LedgerEntry and StatementEntry, it works without too much extra effort.

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@424 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-30 02:47:43 +00:00
parent be2865b4d7
commit 9733226dfd

View File

@@ -490,7 +490,12 @@ class Transaction extends AppModel {
$query['fields'] = array(); $query['fields'] = array();
$stats = array(); $stats = array();
foreach (array_keys($this->hasMany) AS $table) { foreach ($this->hasMany AS $table => $association) {
// Only calculate stats for *Entry types
if (!preg_match("/Entry$/", $table) &&
!preg_match("/Entry$/", $association['className']))
continue;
$squery = $query; $squery = $query;
$squery['link'][$table] = array('fields' => array()); $squery['link'][$table] = array('fields' => array());