From 1495bb337391ec9b911002531ec71c2ecd705b58 Mon Sep 17 00:00:00 2001 From: abijah Date: Mon, 15 Jun 2009 21:52:38 +0000 Subject: [PATCH] Added monetary source into the ledger entry lists. This may be more information than is needed on the listing, but I'll take it out later if so. git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@139 97e9348a-65ac-dc4b-aefc-98561f571b83 --- site/controllers/ledger_entries_controller.php | 9 +++++++-- site/models/monetary_source.php | 4 ++++ site/views/elements/ledger_entries.ctp | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/site/controllers/ledger_entries_controller.php b/site/controllers/ledger_entries_controller.php index 3e52de9..29da8d8 100644 --- a/site/controllers/ledger_entries_controller.php +++ b/site/controllers/ledger_entries_controller.php @@ -29,8 +29,13 @@ class LedgerEntriesController extends AppController { return array ('link' => array(// Models - 'Transaction' => array('fields' => - array('Transaction.id', 'Transaction.stamp')), + 'Transaction' => + array('fields' => + array('Transaction.id', 'Transaction.stamp')), + + 'MonetarySource' => + array('fields' => + array('MonetarySource.id', 'MonetarySource.name')), ), ); } diff --git a/site/models/monetary_source.php b/site/models/monetary_source.php index df530bf..230e3b9 100644 --- a/site/models/monetary_source.php +++ b/site/models/monetary_source.php @@ -12,5 +12,9 @@ class MonetarySource extends AppModel { 'MonetaryType', ); + var $hasMany = array( + 'LedgerEntry', + ); + } ?> \ No newline at end of file diff --git a/site/views/elements/ledger_entries.ctp b/site/views/elements/ledger_entries.ctp index 3c4a282..2e2a2d3 100644 --- a/site/views/elements/ledger_entries.ctp +++ b/site/views/elements/ledger_entries.ctp @@ -5,6 +5,7 @@ $cols = array(); $cols['Transaction'] = array('index' => 'Transaction.id', 'formatter' => 'id'); $cols['Entry'] = array('index' => 'LedgerEntry.id', 'formatter' => 'id'); $cols['Date'] = array('index' => 'Transaction.stamp', 'formatter' => 'date'); +$cols['Source'] = array('index' => 'MonetarySource.name', 'formatter' => 'name'); $cols['Comment'] = array('index' => 'LedgerEntry.comment', 'formatter' => 'comment'); $cols['Debit'] = array('index' => 'debit', 'formatter' => 'currency'); $cols['Credit'] = array('index' => 'credit', 'formatter' => 'currency');