Added the charges controller and views. Fixed a couple minor bugs found with receipts.
git-svn-id: file:///svn-source/pmgr/branches/initial_20090526@62 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -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']);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user