I'm still in the middle of moving onto a ledger based system. However, I'm am now changing how transactions and entries relate back to the customer. I'll be using a ledger for each lease (for rent, late charges, security deposits, etc), and a ledger for each customer (for POS, non-specific deposits such as reservations or covering mulitple units, bad debt writeoff, and possibly customer credits, when not obviously lease specific). This coming change might not be in the right direction, so I want to capture the work as is right now. This change set is not fully functional. Many operations do work, but there are obviously transaction problems with units and customers.
git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@71 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
3
views/accounts/index.ctp
Normal file
3
views/accounts/index.ctp
Normal file
@@ -0,0 +1,3 @@
|
||||
<div class="accounts index">
|
||||
<?php echo $this->element('accounts', array('heading' => '<h2>'.$heading.'</h2>')) ?>
|
||||
</div>
|
||||
95
views/accounts/view.ctp
Normal file
95
views/accounts/view.ctp
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php /* -*- mode:PHP -*- */ ?>
|
||||
|
||||
<div class="account view">
|
||||
|
||||
<?php
|
||||
; // Editor alignment
|
||||
|
||||
function currency($number) {
|
||||
if (!isset($number))
|
||||
return null;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
function comment($comment) {
|
||||
if (isset($comment) && is_array($comment)) {
|
||||
foreach (array_keys($comment) AS $k) {
|
||||
if (!$comment[$k])
|
||||
unset($comment[$k]);
|
||||
}
|
||||
return implode('; ', $comment);
|
||||
}
|
||||
|
||||
return $comment;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
* Account Detail Main Section
|
||||
*/
|
||||
|
||||
$rows = array(array('ID', $account['Account']['id']),
|
||||
array('Name', $account['Account']['name']),
|
||||
array('Type', $account['Account']['type']),
|
||||
array('External Name', $account['Account']['external_name']),
|
||||
array('External Account', $account['Account']['external_account']),
|
||||
array('Comment', $account['Account']['comment']));
|
||||
|
||||
echo $this->element('table',
|
||||
array('class' => 'item account detail',
|
||||
'caption' => 'Account Detail',
|
||||
'rows' => $rows,
|
||||
'column_class' => array('field', 'value')));
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Account Info Box
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
<DIV CLASS="infobox">
|
||||
<DIV CLASS="summary balance">
|
||||
Account Balance: <?php echo currency($balance); ?>
|
||||
</DIV>
|
||||
</DIV>
|
||||
|
||||
<DIV CLASS="detail supporting">
|
||||
<?php
|
||||
; // Editor alignment
|
||||
|
||||
/**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
* Supporting Elements Section
|
||||
*/
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Ledger
|
||||
*/
|
||||
|
||||
echo $this->element('ledgers',
|
||||
array('caption' => $account['Account']['name'] . " Ledgers",
|
||||
'ledgers' => $account['Ledger']));
|
||||
|
||||
/* End "detail supporting" DIV */ ?>
|
||||
</DIV>
|
||||
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user