Added mechanism to lookup the NSF tender from the bounce transaction.

git-svn-id: file:///svn-source/pmgr/branches/surplus_account_20090815@584 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-08-16 19:00:45 +00:00
parent 754cdb8522
commit 1429fe720b
2 changed files with 13 additions and 10 deletions

View File

@@ -388,15 +388,9 @@ class TransactionsController extends AppController {
('first', ('first',
array('contain' => array('contain' =>
array(// Models array(// Models
'Account' => 'Account(id,name)',
array('fields' => array('Account.id', 'Ledger(id,name)',
'Account.name'), 'NsfTender(id,name)',
),
'Ledger' =>
array('fields' => array('Ledger.id',
'Ledger.name'),
),
), ),
'conditions' => array(array('Transaction.id' => $id), 'conditions' => array(array('Transaction.id' => $id),
// REVISIT <AP>: 20090811 // REVISIT <AP>: 20090811
@@ -407,6 +401,10 @@ class TransactionsController extends AppController {
), ),
)); ));
// REVISIT <AP>: 20090815
// for debug purposes only (pr output)
$this->Transaction->stats($id);
if (empty($transaction)) { if (empty($transaction)) {
$this->Session->setFlash(__('Invalid Item.', true)); $this->Session->setFlash(__('Invalid Item.', true));
$this->redirect(array('action'=>'index')); $this->redirect(array('action'=>'index'));

View File

@@ -11,6 +11,7 @@ echo '<div class="transaction view">' . "\n";
$account = $transaction['Account']; $account = $transaction['Account'];
$ledger = $transaction['Ledger']; $ledger = $transaction['Ledger'];
$nsf_tender = $transaction['NsfTender'];
if (isset($transaction['Transaction'])) if (isset($transaction['Transaction']))
$transaction = $transaction['Transaction']; $transaction = $transaction['Transaction'];
@@ -28,7 +29,11 @@ $rows[] = array('Ledger', $html->link($ledger['name'],
array('controller' => 'ledgers', array('controller' => 'ledgers',
'action' => 'view', 'action' => 'view',
$ledger['id']))); $ledger['id'])));
$rows[] = array('Comment', $transaction['comment']); if (!empty($nsf_tender['id']))
$rows[] = array('NSF Tender', $html->link($nsf_tender['name'],
array('controller' => 'tenders',
'action' => 'view',
$nsf_tender['id'])));
echo $this->element('table', echo $this->element('table',
array('class' => 'item transaction detail', array('class' => 'item transaction detail',