From 7c9637ae35a1e371ed327cd5809a7a5fc99b593b Mon Sep 17 00:00:00 2001 From: abijah Date: Wed, 5 Aug 2009 00:06:46 +0000 Subject: [PATCH] Added a more descriptive fieldname for statement entry views. Instead of Transaction, it will be Receipt, Invoice, Deposit, etc. git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@487 97e9348a-65ac-dc4b-aefc-98561f571b83 --- controllers/statement_entries_controller.php | 2 +- views/statement_entries/view.ctp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/controllers/statement_entries_controller.php b/controllers/statement_entries_controller.php index 2816a70..974b1b2 100644 --- a/controllers/statement_entries_controller.php +++ b/controllers/statement_entries_controller.php @@ -212,7 +212,7 @@ class StatementEntriesController extends AppController { $entry = $this->StatementEntry->find ('first', array('contain' => array - ('Transaction' => array('fields' => array('id', 'stamp')), + ('Transaction' => array('fields' => array('id', 'type', 'stamp')), 'Account' => array('id', 'name', 'type'), 'Customer' => array('fields' => array('id', 'name')), 'Lease' => array('fields' => array('id')), diff --git a/views/statement_entries/view.ctp b/views/statement_entries/view.ctp index 6116104..038afd6 100644 --- a/views/statement_entries/view.ctp +++ b/views/statement_entries/view.ctp @@ -15,15 +15,18 @@ $customer = $entry['Customer']; $lease = $entry['Lease']; $entry = $entry['StatementEntry']; +$Ttype = ucfirst(strtolower($transaction['type'])); + $rows = array(); $rows[] = array('ID', $entry['id']); -$rows[] = array('Transaction', $html->link('#'.$transaction['id'], +$rows[] = array($Ttype, $html->link('#'.$transaction['id'], array('controller' => 'transactions', 'action' => 'view', $transaction['id']))); $rows[] = array('Timestamp', FormatHelper::datetime($transaction['stamp'])); $rows[] = array('Effective', FormatHelper::date($entry['effective_date'])); -$rows[] = array('Through', FormatHelper::date($entry['through_date'])); +if (in_array($entry['type'], array('CHARGE', /*REVISIT 'VOUCHER-PAYMENT'*/))) + $rows[] = array('Through', FormatHelper::date($entry['through_date'])); $rows[] = array('Type', $entry['type']); $rows[] = array('Amount', FormatHelper::currency($entry['amount'])); $rows[] = array('Account', $html->link($account['name'],