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@71 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-06-06 20:18:56 +00:00
parent 30b934823c
commit f3ffa3c079
54 changed files with 3066 additions and 2125 deletions

View File

@@ -1,6 +1,6 @@
<?php /* -*- mode:PHP -*- */ ?>
<div class="units view">
<div class="unit view">
<?php
@@ -9,17 +9,22 @@ function 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);
}
/**********************************************************************
* Unit Info
**********************************************************************
**********************************************************************
**********************************************************************
* Unit Detail Main Section
*/
$rows = array(array('Name', $unit['Unit']['name']),
@@ -33,8 +38,12 @@ echo $this->element('table',
'column_class' => array('field', 'value')));
/**********************************************************************
* Unit Info Box
*/
?>
<DIV CLASS="infobox unit">
<DIV CLASS="infobox">
<DIV CLASS="summary grand deposit">
Security Deposit: <?php echo currency($outstandingDeposit); ?>
</DIV>
@@ -42,7 +51,17 @@ echo $this->element('table',
Balance: <?php echo currency($outstandingBalance); ?>
</DIV>
</DIV>
<DIV CLASS="detail supporting">
<?php
; // Editor alignment
/**********************************************************************
**********************************************************************
**********************************************************************
**********************************************************************
* Supporting Elements Section
*/
/**********************************************************************
@@ -52,10 +71,10 @@ $headers = array('Lease', 'Tenant', 'Signed', 'Move-In', 'Move-Out', 'Rent', 'De
$rows = array();
foreach($unit['Lease'] AS $lease) {
$rows[] = array('#'.$lease['number'],
$html->link($lease['Contact'][0]['display_name'],
array('controller' => 'contacts',
$html->link($lease['Customer']['name'],
array('controller' => 'customers',
'action' => 'view',
$lease['Contact'][0]['id'])),
$lease['Customer']['id'])),
datefmt($lease['lease_date']),
datefmt($lease['movein_date']),
datefmt($lease['moveout_date']),
@@ -76,12 +95,15 @@ echo $this->element('table',
* Ledger History
*/
foreach($unit['Lease'] AS $lease) {
$caption = 'Lease #'.$lease['number'].' (Tenant: '.$lease['Contact'][0]['display_name'].')';
pr($lease);
$caption = 'Lease #'.$lease['number'].' (Tenant: '.$lease['Customer']['name'].')';
echo $this->element('ledger',
array('lease' => $lease,
'caption' => $caption,
'ledger' => array('charges'=>1, 'receipts'=>1, 'match'=>1, 'zmix'=>1)));
array('caption' => $caption,
'entries' => $lease['Customer']['Transaction'],
'ledger' => array('mix'=>1)));
}
?>
/* End "detail supporting" DIV */ ?>
</DIV>
</div>