diff --git a/controllers/ledger_entries_controller.php b/controllers/ledger_entries_controller.php index 9e6ee26..d5165bc 100644 --- a/controllers/ledger_entries_controller.php +++ b/controllers/ledger_entries_controller.php @@ -282,6 +282,11 @@ class LedgerEntriesController extends AppController { array('Transaction.id' => $params['custom']['transaction_id']); } + if (isset($params['custom']['monetary_source_id'])) { + $conditions[] = + array('MonetarySource.id' => $params['custom']['monetary_source_id']); + } + return $conditions; } diff --git a/views/elements/ledger_entries.ctp b/views/elements/ledger_entries.ctp index ebd6b30..293f266 100644 --- a/views/elements/ledger_entries.ctp +++ b/views/elements/ledger_entries.ctp @@ -118,7 +118,7 @@ if (isset($searchfields)) // Include custom data $grid->customData(compact('ledger_id', 'account_id', 'ar_account', - 'account_type', 'account_ftype', + 'account_type', 'account_ftype', 'monetary_source_id', 'customer_id', 'lease_id', 'transaction_id', 'group_by_tx')); // Render the grid diff --git a/views/monetary_sources/view.ctp b/views/monetary_sources/view.ctp index 371cf1b..bc9ed3d 100644 --- a/views/monetary_sources/view.ctp +++ b/views/monetary_sources/view.ctp @@ -50,6 +50,22 @@ echo '' . "\n"; echo '
' . "\n"; + +/********************************************************************** + * Ledger Entries + */ + +echo $this->element('ledger_entries', array + (// Element configuration + 'monetary_source_id' => $source['id'], + + // Grid configuration + 'config' => array + ('caption' => "Ledger Entries", + ), + )); + + /* End "detail supporting" div */ echo '
' . "\n";