Added lease and ledger_entry controllers/views. Minor bugfixes as well.

git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@85 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-06-10 08:53:22 +00:00
parent 4277962e3b
commit f8eb45a0b9
10 changed files with 427 additions and 38 deletions

View File

@@ -14,11 +14,13 @@
$rows = array(array('ID', $transaction['Transaction']['id']),
array('Timestamp', FormatHelper::datetime($transaction['Transaction']['stamp'])),
array('Through', FormatHelper::date($transaction['Transaction']['through_date'])),
array('Due', FormatHelper::date($transaction['Transaction']['due_date'])),
array('Comment', $transaction['Transaction']['comment']));
echo $this->element('table',
array('class' => 'item transaction detail',
'caption' => 'Transaction Info',
'caption' => 'Transaction Detail',
'rows' => $rows,
'column_class' => array('field', 'value')));
@@ -50,7 +52,7 @@ echo $this->element('table',
* Entries
*/
$headers = array('Entry', 'Debit', 'Credit', 'Comment', 'Amount', 'Total');
$headers = array('Entry', 'Debit', 'Credit', 'Amount', 'Comment',/* 'Total'*/);
$column_class = array();
foreach (array_intersect($headers, array('Entry')) AS $k => $v) {
$column_class[$k] = 'id';
@@ -71,17 +73,31 @@ foreach($transaction['LedgerEntry'] AS $entry) {
array('controller' => 'ledger_entries',
'action' => 'view',
$entry['id'])),
$html->link($entry['DebitLedger']['name'],
array('controller' => 'ledgers',
'action' => 'view',
$entry['DebitLedger']['id'])),
$html->link($entry['CreditLedger']['name'],
array('controller' => 'ledgers',
'action' => 'view',
$entry['CreditLedger']['id'])),
$entry['comment'],
($html->link($entry['DebitLedger']['Account']['name'],
array('controller' => 'accounts',
'action' => 'view',
$entry['DebitLedger']['Account']['id']))
. ' ('
. $html->link('#' . $entry['DebitLedger']['Account']['id']
. '-' . $entry['DebitLedger']['sequence'],
array('controller' => 'ledgers',
'action' => 'view',
$entry['DebitLedger']['id']))
. ')'),
($html->link($entry['CreditLedger']['Account']['name'],
array('controller' => 'accounts',
'action' => 'view',
$entry['CreditLedger']['Account']['id']))
. ' ('
. $html->link('#' . $entry['CreditLedger']['Account']['id']
. '-' . $entry['CreditLedger']['sequence'],
array('controller' => 'ledgers',
'action' => 'view',
$entry['CreditLedger']['id']))
. ')'),
FormatHelper::currency($entry['amount']),
FormatHelper::currency($running_total)
$entry['comment'],
//FormatHelper::currency($running_total),
);
}