Added links everywhere for charge/payment/receipt. Also, minor tweaking to the views in a couple places.

git-svn-id: file:///svn-source/pmgr/branches/initial_20090526/site@64 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-06-01 08:39:33 +00:00
parent dd5402d2f1
commit fc71c058fb
6 changed files with 51 additions and 24 deletions

View File

@@ -57,17 +57,20 @@ echo $this->element('table',
* Receipts
*/
$headers = array('ID', 'Timestamp', 'Comment', 'Applied');
$headers = array('ID', 'Timestamp', 'Comment', 'Applied', 'Balance');
$rows = array();
$running_total = 0;
$running_total = $charge['Charge']['total'];
foreach($charge['Receipt'] AS $receipt) {
$amount = $receipt['ChargesReceipt']['amount'];
$running_total += $amount;
$rows[] = array('#'.$receipt['id'],
$running_total -= $amount;
$rows[] = array($html->link('#'.$receipt['id'],
array('controller' => 'receipts',
'action' => 'view',
$receipt['id'])),
datefmt($receipt['stamp']),
$receipt['comment'],
currency($receipt['ChargesReceipt']['amount']),
//currency($running_total)
currency($running_total)
);
}

View File

@@ -157,7 +157,7 @@ echo $this->element('table',
* Ledger History
*/
foreach($contact['Lease'] AS $lease) {
$headers = array('Date', /*'Through',*/ /*'Charge/Receipt'*/'ID', 'Type', 'Comment', 'Amount', 'Total');
$headers = array(/*'Charge/Receipt'*/'ID', 'Date', /*'Through',*/ 'Type', 'Comment', 'Amount', 'Total');
$rows = array();
$row_class = array();
@@ -166,8 +166,11 @@ foreach($contact['Lease'] AS $lease) {
foreach($lease['Charge'] AS $charge) {
$amount = $charge['total'];
$running_total += $amount;
$rows[] = array(datefmt($charge['charge_date']) .' - '. datefmt($charge['charge_to_date']),
'#'.$charge['id'],
$rows[] = array($html->link('#'.$charge['id'],
array('controller' => 'charges',
'action' => 'view',
$charge['id'])),
datefmt($charge['charge_date']) .' - '. datefmt($charge['charge_to_date']),
$charge['ChargeType']['name'],
$charge['comment'],
currency($amount),
@@ -177,9 +180,12 @@ foreach($contact['Lease'] AS $lease) {
foreach ($charge['Receipt'] AS $receipt) {
$amount = -1 * $receipt['ChargesReceipt']['amount'];
$running_total += $amount;
$rows[] = array(' -- ' . datefmt($receipt['stamp']),
'#'.$receipt['id'],
'Payment/Receipt',
$rows[] = array($html->link('#'.$receipt['id'],
array('controller' => 'receipts',
'action' => 'view',
$receipt['id'])),
' -- ' . datefmt($receipt['stamp']),
'Payment Applied',
$receipt['comment'],
currency($amount),
currency($running_total));

View File

@@ -41,7 +41,10 @@ foreach ($payments as $payment) {
'action' => 'view',
$payment['Payment']['id'])),
$payment['PaymentType']['name'],
'#'.$payment['Receipt']['id'],
$html->link('#'.$payment['Receipt']['id'],
array('controller' => 'receipts',
'action' => 'view',
$payment['Receipt']['id'])),
currency($payment['Payment']['amount']),
$payment['Payment']['comment'],
);

View File

@@ -24,7 +24,10 @@ function datefmt($date) {
$rows = array(array('ID', $payment['Payment']['id']),
array('Type', $payment['PaymentType']['name']),
array('Receipt', '#'.$payment['Receipt']['id']),
array('Receipt', $html->link('#'.$payment['Receipt']['id'],
array('controller' => 'receipts',
'action' => 'view',
$payment['Receipt']['id']))),
array('Amount', currency($payment['Payment']['amount'])),
array('Comment', $payment['Payment']['comment']));

View File

@@ -50,17 +50,20 @@ echo $this->element('table',
* Payments
*/
$headers = array('ID', 'Type', 'Comment', 'Amount', /*'Total'*/);
$headers = array('ID', 'Type', 'Comment', 'Amount', 'Total');
$rows = array();
$running_total = 0;
foreach($receipt['Payment'] AS $payment) {
$amount = $payment['amount'];
$running_total += $amount;
$rows[] = array('#'.$payment['id'],
$rows[] = array($html->link('#'.$payment['id'],
array('controller' => 'payments',
'action' => 'view',
$payment['id'])),
$payment['PaymentType']['name'],
$payment['comment'],
currency($payment['amount']),
//currency($running_total)
currency($running_total)
);
}
@@ -76,14 +79,17 @@ echo $this->element('table',
* Charges
*/
$headers = array('Date', 'ID', /*'Due',*/ 'Type', 'Lease', 'Comment', 'Amount' /*, 'Tax', 'Subtotal'*/, 'Applied', /*'Total'*/);
$headers = array('ID', 'Date', /*'Due',*/ 'Type', 'Lease', 'Comment', 'Amount' /*, 'Tax', 'Subtotal'*/, 'Applied', /*'Total'*/);
$rows = array();
$running_total = 0;
foreach($receipt['Charge'] AS $charge) {
$amount = $charge['total'];
$running_total += $amount;
$rows[] = array(datefmt($charge['charge_date']) .' - '. datefmt($charge['charge_to_date']),
'#'.$charge['id'],
$rows[] = array($html->link('#'.$charge['id'],
array('controller' => 'charges',
'action' => 'view',
$charge['id'])),
datefmt($charge['charge_date']) .' - '. datefmt($charge['charge_to_date']),
//datefmt($charge['due_date']),
$charge['ChargeType']['name'],
'#'.$charge['Lease']['number'],

View File

@@ -76,7 +76,7 @@ echo $this->element('table',
* Ledger History
*/
foreach($unit['Lease'] AS $lease) {
$headers = array('Date', /*'Through',*/ /*'Charge/Receipt'*/'ID', 'Type', 'Comment', 'Amount', 'Total');
$headers = array(/*'Charge/Receipt'*/'ID', 'Date', /*'Through',*/ 'Type', 'Comment', 'Amount', 'Total');
$rows = array();
$running_total = 0;
@@ -84,8 +84,11 @@ foreach($unit['Lease'] AS $lease) {
foreach($lease['Charge'] AS $charge) {
$amount = $charge['total'];
$running_total += $amount;
$rows[] = array(datefmt($charge['charge_date']) .' - '. datefmt($charge['charge_to_date']),
'#'.$charge['id'],
$rows[] = array($html->link('#'.$charge['id'],
array('controller' => 'charges',
'action' => 'view',
$charge['id'])),
datefmt($charge['charge_date']) .' - '. datefmt($charge['charge_to_date']),
$charge['ChargeType']['name'],
$charge['comment'],
currency($amount),
@@ -95,8 +98,11 @@ foreach($unit['Lease'] AS $lease) {
foreach ($charge['Receipt'] AS $receipt) {
$amount = -1 * $receipt['ChargesReceipt']['amount'];
$running_total += $amount;
$rows[] = array(' -- ' . datefmt($receipt['stamp']),
'#'.$receipt['id'],
$rows[] = array($html->link('#'.$receipt['id'],
array('controller' => 'receipts',
'action' => 'view',
$receipt['id'])),
' -- ' . datefmt($receipt['stamp']),
'Payment Applied',
$receipt['comment'],
currency($amount),