element('table', array('class' => 'item unit detail', 'caption' => 'Unit Info', 'rows' => $rows, 'column_class' => array('field', 'value'))); ?>
Security Deposit:
Balance:
link($lease['Contact'][0]['display_name'], array('controller' => 'contacts', 'action' => 'view', $lease['Contact'][0]['id'])), datefmt($lease['lease_date']), datefmt($lease['movein_date']), datefmt($lease['moveout_date']), $lease['amount'], $lease['deposit'], $lease['comment']); } echo $this->element('table', array('class' => 'item lease list', 'caption' => 'Lease History', 'headers' => $headers, 'rows' => $rows, 'column_class' => $headers)); /********************************************************************** * Ledger History */ foreach($unit['Lease'] AS $lease) { $headers = array('Date', /*'Through',*/ /*'Charge/Receipt'*/'ID', 'Type', 'Comment', 'Amount', 'Total'); $rows = array(); $running_total = 0; $odd = 0; foreach($lease['Charge'] AS $charge) { $amount = $charge['total']; $running_total += $amount; $rows[] = array(datefmt($charge['charge_date']) .' - '. datefmt($charge['charge_to_date']), '#'.$charge['id'], $charge['ChargeType']['name'], $charge['comment'], currency($amount), currency($running_total)); $row_class[] = array('charge', (++$odd % 2) ? 'oddrow' : 'evnrow'); foreach ($charge['Receipt'] AS $receipt) { $amount = -1 * $receipt['ChargesReceipt']['amount']; $running_total += $amount; $rows[] = array(' -- ' . datefmt($receipt['stamp']), '#'.$receipt['id'], 'Payment/Receipt', $receipt['comment'], currency($amount), currency($running_total)); $row_class[] = array('receipt', ($odd % 2) ? 'oddrow' : 'evnrow'); } } echo $this->element('table', array('class' => 'item ledger list', 'caption' => 'Lease #'.$lease['number'].' (Tenant: '.$lease['Contact'][0]['display_name'].')', 'suppress_alternate_rows' => true, 'headers' => $headers, 'rows' => $rows, 'row_class' => $row_class, 'column_class' => $headers)); } ?>