Implemented the balance field of Leases as part of a single query. This not only reduces the number of queries required, it also allows balance to be a sortable column, so that we can determine which customers are overdue.

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@251 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-07 16:08:56 +00:00
parent f4319364f2
commit 3f275b127b
4 changed files with 53 additions and 18 deletions

View File

@@ -112,6 +112,9 @@ class AppController extends Controller {
array('link'=>1, 'contain'=>1));
$query['conditions'] = $this->jqGridDataConditions($params, $model);
// DEBUG PURPOSES ONLY!
$params['count_query'] = $query;
// Get the number of records prior to pagination
$count = $this->jqGridDataRecordCount($params, $model, $query);
@@ -136,15 +139,15 @@ class AppController extends Controller {
$query['fields'] = $this->jqGridDataFields($params, $model);
$results = $this->jqGridDataRecords($params, $model, $query);
// DEBUG PURPOSES ONLY!
$params['query'] = $query;
// Post process the records
$this->jqGridRecordsPostProcess($params, $model, $results);
// Add in any needed hyperlinks
$this->jqGridRecordLinks($params, $model, $results, array());
// DEBUG PURPOSES ONLY!
$params['query'] = $query;
// Finally, dump out the data
$this->jqGridDataOutputHeader($params, $model);
echo "<?xml version='1.0' encoding='utf-8'?>\n";