Files
pmgr/site/views/elements/ledgers.ctp
2009-07-30 01:59:10 +00:00

24 lines
1.3 KiB
PHP

<?php /* -*- mode:PHP -*- */
// Define the table columns
$cols = array();
$cols['ID'] = array('index' => 'id_sequence', 'formatter' => 'id');
$cols['Name'] = array('index' => 'Ledger.name', 'formatter' => 'name');
$cols['Account'] = array('index' => 'Account.name', 'formatter' => 'longname');
$cols['Open Date'] = array('index' => 'PriorCloseTransaction.stamp', 'formatter' => 'date');
$cols['Close Date'] = array('index' => 'CloseTransaction.stamp', 'formatter' => 'date');
$cols['Comment'] = array('index' => 'Ledger.comment', 'formatter' => 'comment');
$cols['Entries'] = array('index' => 'entries', 'formatter' => 'number');
$cols['Debits'] = array('index' => 'debits', 'formatter' => 'currency');
$cols['Credits'] = array('index' => 'credits', 'formatter' => 'currency');
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
// Render the grid
$grid
->columns($cols)
->sortField('ID', 'ASC')
->defaultFields(array('ID', 'Name', 'Account'))
->searchFields(array('Account', 'Comment'))
->render($this, isset($config) ? $config : null,
array_diff(array_keys($cols), array('Open Date', 'Comment')));