Made progress adapting the receipt code onto the latest db changes.

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@387 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-24 07:43:42 +00:00
parent 29fe265daa
commit 25b7da57f3
7 changed files with 54 additions and 29 deletions

View File

@@ -134,8 +134,13 @@ class StatementEntriesController extends AppController {
function gridDataOrder(&$params, &$model, $index, $direction) {
$order = parent::gridDataOrder($params, $model, $index, $direction);
if ($index === 'Transaction.stamp')
$order[] = 'StatementEntry.id ' . $direction;
// After sorting by whatever the user wants, add these
// defaults into the sort mechanism. If we're already
// sorting by one of them, it will only be redundant,
// and should cause no harm (possible a longer query?)
$order[] = 'Transaction.stamp ' . $direction;
$order[] = 'StatementEntry.effective_date ' . $direction;
$order[] = 'StatementEntry.id ' . $direction;
return $order;
}
@@ -195,7 +200,7 @@ class StatementEntriesController extends AppController {
('first',
array('contain' => array
('Transaction' => array('fields' => array('id', 'stamp')),
'Account' => array('id', 'name', 'type', 'trackable'),
'Account' => array('id', 'name', 'type'),
'Customer' => array('fields' => array('id', 'name')),
'Lease' => array('fields' => array('id')),
),