Finally added a format helper, which has been long intended. There may be still be conversion issues, it hasn't been tested much.
git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@77 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -3,22 +3,7 @@
|
||||
<div class="unit view">
|
||||
|
||||
<?php
|
||||
|
||||
function currency($amount) {
|
||||
return NumberHelper::currency($amount);
|
||||
}
|
||||
|
||||
function datefmt($date) {
|
||||
if (!$date) return null;
|
||||
$date_fmt = 'm/d/Y';
|
||||
return TimeHelper::format($date_fmt, $date);
|
||||
}
|
||||
|
||||
function datetimefmt($date) {
|
||||
if (!$date) return null;
|
||||
return TimeHelper::nice($date);
|
||||
}
|
||||
|
||||
; // Editor alignment
|
||||
|
||||
/**********************************************************************
|
||||
**********************************************************************
|
||||
@@ -45,10 +30,10 @@ echo $this->element('table',
|
||||
?>
|
||||
<DIV CLASS="infobox">
|
||||
<DIV CLASS="summary grand deposit">
|
||||
Security Deposit: <?php echo currency($outstandingDeposit); ?>
|
||||
Security Deposit: <?php echo FormatHelper::currency($outstandingDeposit); ?>
|
||||
</DIV>
|
||||
<DIV CLASS="summary grand balance">
|
||||
Balance: <?php echo currency($outstandingBalance); ?>
|
||||
Balance: <?php echo FormatHelper::currency($outstandingBalance); ?>
|
||||
</DIV>
|
||||
</DIV>
|
||||
|
||||
@@ -67,28 +52,10 @@ echo $this->element('table',
|
||||
/**********************************************************************
|
||||
* 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['Customer']['name'],
|
||||
array('controller' => 'customers',
|
||||
'action' => 'view',
|
||||
$lease['Customer']['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));
|
||||
echo $this->element('leases',
|
||||
array('caption' => 'Lease History',
|
||||
'leases' => $unit['Lease']));
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
|
||||
Reference in New Issue
Block a user