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

112 lines
3.6 KiB
PHP

<?php /* -*- mode:PHP -*- */
echo '<div class="account view">' . "\n";
/**********************************************************************
**********************************************************************
**********************************************************************
**********************************************************************
* Account Detail Main Section
*/
$ledger = $account['Ledger'];
$current_ledger = $account['CurrentLedger'];
if (isset($account['Account']))
$account = $account['Account'];
$rows = array();
$rows[] = array('ID', $account['id']);
$rows[] = array('Name', $account['name']);
$rows[] = array('Type', $account['type']);
$rows[] = array('External Name', $account['external_name']);
$rows[] = array('External Account', $account['external_account']);
$rows[] = array('Comment', $account['comment']);
echo $this->element('table',
array('class' => 'item account detail',
'caption' => 'Account Detail',
'rows' => $rows,
'column_class' => array('field', 'value')));
/**********************************************************************
* Account Info Box
*/
echo '<div class="infobox">' . "\n";
$rows = array();
$rows[] = array('Debits:', FormatHelper::currency($stats['debits']));
$rows[] = array('Credits:', FormatHelper::currency($stats['credits']));
$rows[] = array('Account Balance:', FormatHelper::currency($stats['balance']));
echo $this->element('table',
array('class' => 'summary',
'rows' => $rows,
'column_class' => array('field', 'value'),
'suppress_alternate_rows' => true,
));
echo '</div>' . "\n";
/**********************************************************************
**********************************************************************
**********************************************************************
**********************************************************************
* Supporting Elements Section
*/
echo '<div CLASS="detail supporting">' . "\n";
/**********************************************************************
* Ledgers
*/
echo $this->element('ledgers', array
(// Grid configuration
'config' => array
('caption' => $account['name'] . " Ledgers",
'filter' => array('account_id' => $account['id']),
)));
/**********************************************************************
* Current Ledger
*/
echo $this->element('ledger_entries', array
(// Grid configuration
'config' => array
('grid_div_id' => 'ledger-ledger-entry-list',
'caption' => ("Current Ledger: " .
"(". $current_ledger['name'] .")"),
'filter' => array('ledger_id' => $current_ledger['id']),
'exclude' => array('Account', 'Amount', 'Cr/Dr', 'Balance'),
'include' => array('Debit', 'Credit', 'Sub-Total'),
)));
/**********************************************************************
* Entire Account
*/
echo $this->element('ledger_entries', array
(// Grid configuration
'config' => array
('grid_div_id' => 'account-ledger-entry-list',
'grid_setup' => array('hiddengrid' => true),
'caption' => "Entire Ledger",
'filter' => array('account_id' => $account['id']),
'exclude' => array('Account', 'Amount', 'Cr/Dr', 'Balance'),
'include' => array('Debit', 'Credit', 'Sub-Total'),
)));
/* End "detail supporting" div */
echo '</div>' . "\n";
/* End page div */
echo '</div>' . "\n";