Added override function for counting the results. This is needed because the 'Unpaid Charges' report was returning a crazy large number of entries. Although I know this quick and dirty hack works for that report, I haven't checked or tested to see if this might cause issues in other areas.
git-svn-id: file:///svn-source/pmgr/branches/v0.3_work/site@985 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -157,6 +157,24 @@ class StatementEntriesController extends AppController {
|
||||
return $order;
|
||||
}
|
||||
|
||||
function gridDataCountExecute(&$params, &$model, $query) {
|
||||
if ($params['action'] === 'unreconciled') {
|
||||
// REVISIT <AP> 20100413:
|
||||
// This is a lame solution, as it runs the same queries twice
|
||||
// (and causes code duplication). However, I'm not in the mood
|
||||
// to flush out an actual "count" solution at the moment, and I
|
||||
// also don't want to cache the results in $params (although
|
||||
// that is probably the most sensible solution). So, I'll just
|
||||
// calculate the reconciled set both times and live with the
|
||||
// performance and maintenance penalty
|
||||
$lquery = array('conditions' => $query['conditions']);
|
||||
$set = $this->StatementEntry->reconciledSet('CHARGE', $lquery, true);
|
||||
return count($set['entries']);
|
||||
}
|
||||
|
||||
return parent::gridDataCountExecute($params, $model, $query);
|
||||
}
|
||||
|
||||
function gridDataRecordsExecute(&$params, &$model, $query) {
|
||||
|
||||
if ($params['action'] === 'unreconciled') {
|
||||
|
||||
Reference in New Issue
Block a user