Files
pmgr/site/views/elements/ledger_entries.ctp

27 lines
1.3 KiB
PHP

<?php /* -*- mode:PHP -*- */
// Define the table columns
$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['Debit Account'] = array('index' => 'DebitAccount.name', 'formatter' => 'longname');
$cols['Credit Account'] = array('index' => 'CreditAccount.name', 'formatter' => 'longname');
$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');
$jqGrid_options = array('jqGridColumns' => $cols,
'controller' => 'ledger_entries',
'caption' => isset($caption) ? $caption : null);
if (isset($ledger_id)) {
$jqGrid_options += array('custom_post_data' => array('ledger_id' => $ledger_id,
'account_type' => $account_type),
'limit' => 50);
}
echo $this->element('jqGrid', $jqGrid_options);