Files
pmgr/views/units/view.ctp

88 lines
2.3 KiB
PHP

<?php /* -*- mode:PHP -*- */ ?>
<div class="units view">
<?php
function currency($amount) {
return NumberHelper::currency($amount);
}
function datefmt($date) {
$date_fmt = 'm/d/Y';
return TimeHelper::format($date_fmt, $date);
}
function datetimefmt($date) {
return TimeHelper::nice($date);
}
/**********************************************************************
* Unit Info
*/
$rows = array(array('Name', $unit['Unit']['name']),
array('Status', $unit['Unit']['status']),
array('Comment', $unit['Unit']['comment']));
echo $this->element('table',
array('class' => 'item unit detail',
'caption' => 'Unit Info',
'rows' => $rows,
'column_class' => array('field', 'value')));
?>
<DIV CLASS="infobox unit">
<DIV CLASS="summary grand deposit">
Security Deposit: <?php echo currency($outstandingDeposit); ?>
</DIV>
<DIV CLASS="summary grand balance">
Balance: <?php echo currency($outstandingBalance); ?>
</DIV>
</DIV>
<?php
/**********************************************************************
* Lease History
*/
$headers = array('Lease', 'Tenant', 'Signed', 'Move-In', 'Move-Out', 'Rent', 'Deposit', 'Comment');
$rows = array();
foreach($unit['Lease'] AS $lease) {
$rows[] = array('#'.$lease['number'],
$html->link($lease['Contact'][0]['display_name'],
array('controller' => 'contacts',
'action' => 'view',
$lease['Contact'][0]['id'])),
datefmt($lease['lease_date']),
datefmt($lease['movein_date']),
datefmt($lease['moveout_date']),
currency($lease['amount']),
currency($lease['deposit']),
$lease['comment']);
}
echo $this->element('table',
array('class' => 'item lease list',
'caption' => 'Lease History',
'headers' => $headers,
'rows' => $rows,
'column_class' => $headers));
/**********************************************************************
* Ledger History
*/
foreach($unit['Lease'] AS $lease) {
$caption = 'Lease #'.$lease['number'].' (Tenant: '.$lease['Contact'][0]['display_name'].')';
echo $this->element('ledger',
array('lease' => $lease,
'caption' => $caption,
'ledger' => array('charges'=>1, 'receipts'=>1, 'match'=>1, 'zmix'=>1)));
}
?>
</div>