Files
pmgr/site/views/ledger_entries/view.ctp
abijah c9ade62536 Very, very messy and broken. It does work somewhat, but I can see just what a mess it's going to be to carry it out, so I'm abandoning.
git-svn-id: file:///svn-source/pmgr/branches/reconcile_entry_to_receipt_20090629@187 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-06-30 00:59:09 +00:00

138 lines
5.0 KiB
PHP

<?php /* -*- mode:PHP -*- */
echo '<div class="ledger-entry view">' . "\n";
/**********************************************************************
**********************************************************************
**********************************************************************
**********************************************************************
* LedgerEntry Detail Main Section
*/
$transaction = $entry['Transaction'];
$debit_ledger = $entry['DebitLedger'];
$credit_ledger = $entry['CreditLedger'];
$source = $entry['MonetarySource'];
$customer = $entry['Customer'];
$lease = $entry['Lease'];
$entry = $entry['LedgerEntry'];
$rows = array(array('ID', $entry['id']),
array('Transaction', $html->link('#'.$transaction['id'],
array('controller' => 'transactions',
'action' => 'view',
$transaction['id']))),
array('Timestamp', FormatHelper::datetime($transaction['stamp'])),
array('Customer', (isset($customer['name'])
? $html->link($customer['name'],
array('controller' => 'customers',
'action' => 'view',
$customer['id']))
: null)),
array('Lease', (isset($lease['id'])
? $html->link('#'.$lease['id'],
array('controller' => 'leases',
'action' => 'view',
$lease['id']))
: null)),
array('Monetary Source', (isset($source['name'])
? $html->link($source['name'],
array('controller' => 'monetary_sources',
'action' => 'view',
$source['id']))
: null)),
array('Amount', FormatHelper::currency($entry['amount'])),
array('Debit', ($html->link($debit_ledger['Account']['name'],
array('controller' => 'accounts',
'action' => 'view',
$debit_ledger['Account']['id']))
. ' ('
. $html->link('#' . $debit_ledger['Account']['id']
. '-' . $debit_ledger['sequence'],
array('controller' => 'ledgers',
'action' => 'view',
$debit_ledger['id']))
. ')')),
array('Credit', ($html->link($credit_ledger['Account']['name'],
array('controller' => 'accounts',
'action' => 'view',
$credit_ledger['Account']['id']))
. ' ('
. $html->link('#' . $credit_ledger['Account']['id']
. '-' . $credit_ledger['sequence'],
array('controller' => 'ledgers',
'action' => 'view',
$credit_ledger['id']))
. ')')),
array('Comment', $entry['comment']));
echo $this->element('table',
array('class' => 'item ledger-entry detail',
'caption' => 'Ledger Entry Detail',
'rows' => $rows,
'column_class' => array('field', 'value')));
/**********************************************************************
* LedgerEntry Info Box
*/
echo '<div class="infobox">' . "\n";
$rows = array();
if ($debit_ledger['Account']['trackable']) {
$rows[] = array('Debit Amount Reconciled:', FormatHelper::currency($stats['debit_amount_reconciled']));
$rows[] = array('Debit Amount Remaining:', FormatHelper::currency($stats['debit_amount_remaining']));
}
if ($credit_ledger['Account']['trackable']) {
$rows[] = array('Credit Amount Reconciled:', FormatHelper::currency($stats['credit_amount_reconciled']));
$rows[] = array('Credit Amount Remaining:', FormatHelper::currency($stats['credit_amount_remaining']));
}
echo $this->element('table',
array('class' => 'summary',
'rows' => $rows,
'column_class' => array('field', 'value'),
'suppress_alternate_rows' => true,
));
echo '</div>' . "\n";
/**********************************************************************
**********************************************************************
**********************************************************************
**********************************************************************
* Supporting Elements Section
*/
echo '<div CLASS="detail supporting">' . "\n";
/**********************************************************************
* Reconciliation Ledger Entries
*/
if ($debit_ledger['Account']['trackable']) {
echo $this->element('transactions',
array('caption' => "Payments Received",
'grid_div_id' => 'debit_reconciliation_ledger_entries',
'reconcile_type' => 'debit',
'reconcile_ledger_entry_id' => $entry['id'],
));
}
if ($credit_ledger['Account']['trackable']) {
echo $this->element('transactions',
array('caption' => "Charges Paid",
'grid_div_id' => 'credit_reconciliation_ledger_entries',
'reconcile_type' => 'credit',
'reconcile_ledger_entry_id' => $entry['id'],
));
}
/* End "detail supporting" div */
echo '</div>' . "\n";
/* End page div */
echo '</div>' . "\n";