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

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@387 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-24 07:43:42 +00:00
parent 743ff52e59
commit b820929ddc
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')),
),

View File

@@ -124,15 +124,12 @@ class TransactionsController extends AppController {
return;
}
foreach($this->data['LedgerEntry'] AS &$entry) {
if (!isset($entry['acct'][$entry['account_id']]))
continue;
$entry['MonetarySource'] = $entry['acct'][$entry['account_id']];
foreach($this->data['Entry'] AS &$entry) {
$entry['Tender'] = $entry['type'][$entry['tender_type_id']];
unset($entry['type']);
unset($entry['tender_type_id']);
}
pr($this->data);
if (!$this->Transaction->addReceipt($this->data,
$this->data['Customer']['id'],
(isset($this->data['Lease']['id'])