Files
pmgr/site/views/statement_entries/view.ctp
abijah cca698d437 Several changes in an effort to support charge reversals. I can't imagine this is all working flawlessly, as I'm not quite sure how it even _should_ work.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@490 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-05 07:54:57 +00:00

127 lines
4.2 KiB
PHP

<?php /* -*- mode:PHP -*- */
echo '<div class="statement-entry view">' . "\n";
/**********************************************************************
**********************************************************************
**********************************************************************
**********************************************************************
* Entry Detail Main Section
*/
$transaction = $entry['Transaction'];
$account = $entry['Account'];
$customer = $entry['Customer'];
$lease = $entry['Lease'];
$entry = $entry['StatementEntry'];
$Ttype = ucfirst(strtolower($transaction['type']));
$rows = array();
$rows[] = array('ID', $entry['id']);
$rows[] = array($Ttype, $html->link('#'.$transaction['id'],
array('controller' => 'transactions',
'action' => 'view',
$transaction['id'])));
$rows[] = array('Timestamp', FormatHelper::datetime($transaction['stamp']));
$rows[] = array('Effective', FormatHelper::date($entry['effective_date']));
if (in_array($entry['type'], array('CHARGE', 'PAYMENT')))
$rows[] = array('Through', FormatHelper::date($entry['through_date']));
$rows[] = array('Type', $entry['type']);
$rows[] = array('Amount', FormatHelper::currency($entry['amount']));
$rows[] = array('Account', $html->link($account['name'],
array('controller' => 'accounts',
'action' => 'view',
$account['id'])));
$rows[] = array('Customer', (isset($customer['name'])
? $html->link($customer['name'],
array('controller' => 'customers',
'action' => 'view',
$customer['id']))
: null));
$rows[] = array('Lease', (isset($lease['id'])
? $html->link('#'.$lease['id'],
array('controller' => 'leases',
'action' => 'view',
$lease['id']))
: null));
$rows[] = array('Comment', $entry['comment']);
echo $this->element('table',
array('class' => 'item statement-entry detail',
'caption' => 'Statement Entry Detail',
'rows' => $rows,
'column_class' => array('field', 'value')));
/**********************************************************************
* Entry Info Box
*/
if (strtoupper($entry['type']) === 'CHARGE') {
$applied_caption = "Disbursements Applied";
//$remaining_caption = "Charge Balance";
}
else {
$applied_caption = "Dispursed to Charges";
//$remaining_caption = "Disbursement Balance";
}
$remaining_caption = "Remaining Balance";
echo '<div class="infobox">' . "\n";
$rows = array();
$rows[] = array($applied_caption,
'<SPAN id="statement-entry-applied">' .
FormatHelper::currency($stats['reconciled']) .
'</SPAN>');
$rows[] = array($remaining_caption,
'<SPAN id="statement-entry-balance">' .
FormatHelper::currency($stats['balance']) .
'</SPAN>');
echo $this->element('table',
array('class' => 'item summary',
'caption' => null,
'rows' => $rows,
'column_class' => array('field', 'value'),
//'suppress_alternate_rows' => true,
));
echo '</div>' . "\n";
/**********************************************************************
**********************************************************************
**********************************************************************
**********************************************************************
* Supporting Elements Section
*/
echo '<div CLASS="detail supporting">' . "\n";
/**********************************************************************
* Reconciliation Ledger Entries
*/
echo $this->element('statement_entries', array
(// Element configuration
'statement_entry_id' => $entry['id'],
/* 'action' => 'reconcile', */
// Grid configuration
'config' => array
('caption' => 'Entries Applied',
//'filter' => array('id' => $entry['id']),
'exclude' => array('Entry'),
)));
/* End "detail supporting" div */
echo '</div>' . "\n";
/* End page div */
echo '</div>' . "\n";