Added the charges controller and views. Fixed a couple minor bugs found with receipts.

git-svn-id: file:///svn-source/pmgr/branches/initial_20090526/site@62 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-06-01 08:05:53 +00:00
parent cdd274adf7
commit f473a91870
6 changed files with 301 additions and 2 deletions

View File

@@ -5,6 +5,20 @@ if (isset($heading))
else
echo '<h2>'.__('Receipts',true).'</h2>';
function currency($number) {
if ($number < 0)
return "($ " . number_format(-1*$number, 2) . ")";
else
return "$ " . number_format($number, 2);
}
function datefmt($date) {
$date_fmt = 'm/d/Y';
return ($date
? date_format(date_create($date), $date_fmt)
: null);
}
$headers_manual = array('Id', 'Timestamp', 'Comment');
if (isset($paginator)) {
echo $paginator->counter(array(
@@ -23,7 +37,7 @@ foreach ($receipts as $receipt) {
array('controller' => 'receipts',
'action' => 'view',
$receipt['Receipt']['id'])),
$receipt['Receipt']['stamp'],
datefmt($receipt['Receipt']['stamp']),
$receipt['Receipt']['comment']);
}