git-svn-id: file:///svn-source/pmgr/branches/v0.3_work@1036 97e9348a-65ac-dc4b-aefc-98561f571b83
28 lines
1.4 KiB
PHP
28 lines
1.4 KiB
PHP
<?php /* -*- mode:PHP -*- */
|
|
|
|
if (isset($include))
|
|
$include = is_array($include) ? $include : array($include);
|
|
else
|
|
$include = array();
|
|
|
|
// Define the table columns
|
|
$cols = array();
|
|
$cols['ID'] = array('index' => 'Transaction.id', 'formatter' => 'id');
|
|
$cols['Type'] = array('index' => 'Transaction.type', 'formatter' => 'enum');
|
|
$cols['Customer'] = array('index' => 'Customer.name', 'formatter' => 'longname');
|
|
$cols['Timestamp'] = array('index' => 'Transaction.stamp', 'formatter' => 'date');
|
|
$cols['Comment'] = array('index' => 'Transaction.comment', 'formatter' => 'comment', 'sortable' => false);
|
|
$cols['Entries'] = array('index' => 'entries', 'formatter' => 'number');
|
|
$cols['Amount'] = array('index' => 'Transaction.amount', 'formatter' => 'currency');
|
|
$cols['PosNeg'] = array('index' => 'balance', 'formatter' => 'currency');
|
|
$cols['Balance'] = array('index' => 'subtotal-balance', 'formatter' => 'currency', 'sortable' => false);
|
|
|
|
// Render the grid
|
|
$grid
|
|
->columns($cols)
|
|
->sortField('Timestamp', 'DESC')
|
|
->defaultFields(array('ID', 'Timestamp'))
|
|
->searchFields(array('Type', 'Comment'))
|
|
->render($this, isset($config) ? $config : null,
|
|
array_merge($include, array_diff(array_keys($cols), array('Customer', 'PosNeg', 'Balance', 'Comment'))));
|