Files
pmgr/site/views/elements/transactions.ctp
abijah c9ade62536 Very, very messy and broken. It does work somewhat, but I can see just what a mess it's going to be to carry it out, so I'm abandoning.
git-svn-id: file:///svn-source/pmgr/branches/reconcile_entry_to_receipt_20090629@187 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-06-30 00:59:09 +00:00

55 lines
1.8 KiB
PHP

<?php /* -*- mode:PHP -*- */
if (isset($reconcile_ledger_entry_id)) {
$applied_amount = true;
} else {
$applied_amount = false;
}
$subtotal_amount = false;
// Define the table columns
$cols = array();
$cols['ID'] = array('index' => 'Transaction.id', 'formatter' => 'id');
//$cols['Customer'] = array('index' => 'Customer.name', 'formatter' => 'longname');
$cols['Timestamp'] = array('index' => 'Transaction.stamp', 'formatter' => 'date');
$cols['Through'] = array('index' => 'Transaction.through_date', 'formatter' => 'date');
$cols['Due'] = array('index' => 'Transaction.due_date', 'formatter' => 'date');
$cols['Comment'] = array('index' => 'Transaction.comment', 'formatter' => 'comment');
if ($applied_amount) {
$cols['Applied'] = array('index' => "Reconciliation.amount", 'formatter' => 'currency');
}
if ($subtotal_amount) {
$cols['Sub-Total'] = array('index' => 'subtotal', 'formatter' => 'currency', 'sortable' => false);
}
$jqGrid_options = array('jqGridColumns' => $cols,
'controller' => 'transactions',
);
$jqGrid_options += compact('grid_div_id', 'grid_id', 'caption', 'grid_setup', 'limit');
$custom_post_data = compact('reconcile_type', 'reconcile_ledger_entry_id');
if (isset($transactions)) {
$jqGrid_options += array('custom_ids' =>
array_map(create_function('$data',
'return $data["id"];'),
$transactions),
'limit' => 5);
}
elseif (isset($reconcile_ledger_entry_id)) {
$jqGrid_options += array('limit' => 5);
}
else {
$jqGrid_options += array('search_fields' => array('Due', 'Comment'));
}
$jqGrid_options += compact('custom_post_data');
$jqGrid_options['sort_column'] = 'Timestamp';
echo $this->element('jqGrid', $jqGrid_options);