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');