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@77 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-06-08 03:32:07 +00:00
parent 52032180f3
commit 374843aeee
16 changed files with 178 additions and 349 deletions

View File

@@ -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']));
/**********************************************************************