git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@131 97e9348a-65ac-dc4b-aefc-98561f571b83
30 lines
1.3 KiB
PHP
30 lines
1.3 KiB
PHP
<?php /* -*- mode:PHP -*- */
|
|
|
|
// Define the table columns
|
|
$cols = array();
|
|
$cols['ID'] = array('index' => 'id_sequence', 'formatter' => 'id');
|
|
$cols['Account'] = array('index' => 'Account.name', 'formatter' => 'name', 'width' => '250');
|
|
$cols['Entries'] = array('index' => 'entries', 'width' => '60', 'align' => 'right');
|
|
$cols['Debits'] = array('index' => 'debits', 'formatter' => 'currency');
|
|
$cols['Credits'] = array('index' => 'credits', 'formatter' => 'currency');
|
|
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
|
|
$cols['Close Date'] = array('index' => 'Ledger.close_stamp', 'formatter' => 'date');
|
|
$cols['Comment'] = array('index' => 'Ledger.comment', 'formatter' => 'comment');
|
|
|
|
$jqGrid_options = array('jqGridColumns' => $cols,
|
|
'controller' => 'ledgers',
|
|
'caption' => isset($caption) ? $caption : null);
|
|
|
|
if (isset($ledgers)) {
|
|
$jqGrid_options += array('custom_ids' =>
|
|
array_map(create_function('$data',
|
|
'return $data["id"];'),
|
|
$ledgers),
|
|
'limit' => 5);
|
|
}
|
|
else {
|
|
$jqGrid_options += array('search_fields' => array('Account'));
|
|
}
|
|
|
|
echo $this->element('jqGrid', $jqGrid_options);
|