diff --git a/site/controllers/statement_entries_controller.php b/site/controllers/statement_entries_controller.php index 4103d64..9cbb190 100644 --- a/site/controllers/statement_entries_controller.php +++ b/site/controllers/statement_entries_controller.php @@ -157,6 +157,24 @@ class StatementEntriesController extends AppController { return $order; } + function gridDataCountExecute(&$params, &$model, $query) { + if ($params['action'] === 'unreconciled') { + // REVISIT 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') {