Nowhere near done yet, but checking in a snapshot of semi-working code. There is some simultaneous support for both with and without use of the Invoice/Receipt account. I want to do away with them completely, but will need to change how sitelink payments are mapped (right now, they split a payment into multiple parts to match the charge).
git-svn-id: file:///svn-source/pmgr/branches/single_AR_20090622@181 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -63,12 +63,13 @@ echo $this->element('leases',
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Account
|
||||
* Customer Account History
|
||||
*/
|
||||
|
||||
echo $this->element('accounts',
|
||||
echo $this->element('ledger_entries',
|
||||
array('caption' => 'Account',
|
||||
'accounts' => array($customer['Account'])));
|
||||
'customer_id' => $customer['Customer']['id'],
|
||||
));
|
||||
|
||||
|
||||
/* End "detail supporting" div */
|
||||
|
||||
@@ -143,8 +143,12 @@ foreach ($jqGridColumns AS &$col) {
|
||||
}
|
||||
|
||||
// Set the default sort column
|
||||
reset($jqGridColumns);
|
||||
$sortname = current($jqGridColumns);
|
||||
if (isset($sort_column)) {
|
||||
$sortname = $jqGridColumns[$sort_column];
|
||||
} else {
|
||||
reset($jqGridColumns);
|
||||
$sortname = current($jqGridColumns);
|
||||
}
|
||||
$sortname = $sortname['index'];
|
||||
|
||||
// Configure the grid setup, giving priority to user defined parameters
|
||||
|
||||
@@ -21,6 +21,9 @@ else {
|
||||
$cols['Debit Account'] = array('index' => 'DebitAccount.name', 'formatter' => 'longname');
|
||||
$cols['Credit Account'] = array('index' => 'CreditAccount.name', 'formatter' => 'longname');
|
||||
}
|
||||
$cols['Customer'] = array('index' => 'Customer.name', 'formatter' => 'name');
|
||||
$cols['Lease'] = array('index' => 'Lease.number', 'formatter' => 'id');
|
||||
$cols['Unit'] = array('index' => 'Unit.name', 'formatter' => 'name');
|
||||
$cols['Source'] = array('index' => 'MonetarySource.name', 'formatter' => 'name');
|
||||
$cols['Comment'] = array('index' => 'LedgerEntry.comment', 'formatter' => 'comment', 'width'=>150);
|
||||
if (isset($ledger_id)) {
|
||||
@@ -34,7 +37,8 @@ if (isset($reconcile_id)) {
|
||||
$cols['Applied'] = array('index' => "Reconciliation.amount", 'formatter' => 'currency');
|
||||
}
|
||||
|
||||
$custom_post_data = compact('ledger_id', 'account_type', 'account_ftype', 'notxgroup');
|
||||
$custom_post_data = compact('ledger_id', 'account_type', 'account_ftype',
|
||||
'customer_id', 'lease_id', 'transaction_id', 'notxgroup');
|
||||
|
||||
$jqGrid_options = array('jqGridColumns' => $cols,
|
||||
'controller' => 'ledger_entries',
|
||||
@@ -42,11 +46,6 @@ $jqGrid_options = array('jqGridColumns' => $cols,
|
||||
|
||||
$jqGrid_options += compact('grid_div_id', 'grid_id', 'caption', 'grid_setup', 'limit');
|
||||
|
||||
if (isset($ledger_id)) {
|
||||
$jqGrid_options += array('action' => 'ledger',
|
||||
'limit' => 50);
|
||||
}
|
||||
|
||||
if (isset($ledger_entries)) {
|
||||
$jqGrid_options += array('custom_ids' =>
|
||||
array_map(create_function('$data',
|
||||
@@ -54,6 +53,10 @@ if (isset($ledger_entries)) {
|
||||
$ledger_entries),
|
||||
'limit' => 10);
|
||||
}
|
||||
else {
|
||||
$jqGrid_options += array('action' => 'ledger',
|
||||
'limit' => 50);
|
||||
}
|
||||
|
||||
if (isset($reconcile_id)) {
|
||||
$custom_post_data += compact('reconcile_id');
|
||||
@@ -61,5 +64,6 @@ if (isset($reconcile_id)) {
|
||||
}
|
||||
|
||||
$jqGrid_options += compact('custom_post_data');
|
||||
$jqGrid_options['sort_column'] = 'Date';
|
||||
echo $this->element('jqGrid', $jqGrid_options);
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ echo '<div class="lease view">' . "\n";
|
||||
|
||||
$lease_type = $lease['LeaseType'];
|
||||
$customer = $lease['Customer'];
|
||||
$account = $lease['Account'];
|
||||
$unit = $lease['Unit'];
|
||||
|
||||
if (isset($lease['Lease']))
|
||||
@@ -36,10 +35,6 @@ $rows = array(array('ID', $lease['id']),
|
||||
array('Notice Given', FormatHelper::date($lease['notice_given_date'], true)),
|
||||
array('Notice Received', FormatHelper::date($lease['notice_received_date'], true)),
|
||||
array('Closed', FormatHelper::date($lease['close_date'], true)),
|
||||
array('Account', $html->link($account['name'],
|
||||
array('controller' => 'accounts',
|
||||
'action' => 'view',
|
||||
$account['id']))),
|
||||
array('Deposit', FormatHelper::currency($lease['deposit'])),
|
||||
array('Rent', FormatHelper::currency($lease['amount'])),
|
||||
array('Comment', $lease['comment']));
|
||||
@@ -53,7 +48,7 @@ echo $this->element('table',
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Account Info Box
|
||||
* Lease Info Box
|
||||
*/
|
||||
|
||||
echo '<div class="infobox">' . "\n";
|
||||
@@ -80,15 +75,15 @@ echo '<div CLASS="detail supporting">' . "\n";
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Current Ledger
|
||||
* Lease Account History
|
||||
*/
|
||||
|
||||
echo $this->element('ledger_entries',
|
||||
array('caption' => "Current Ledger: (#{$account['id']}-{$account['CurrentLedger']['sequence']})",
|
||||
'ledger_id' => $account['CurrentLedger']['id'],
|
||||
'account_type' => $account['type'],
|
||||
array('caption' => 'Account',
|
||||
'lease_id' => $lease['id'],
|
||||
));
|
||||
|
||||
|
||||
/* End "detail supporting" div */
|
||||
echo '</div>' . "\n";
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ $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']),
|
||||
@@ -21,8 +23,16 @@ $rows = array(array('ID', $entry['id']),
|
||||
'action' => 'view',
|
||||
$transaction['id']))),
|
||||
array('Timestamp', FormatHelper::datetime($transaction['stamp'])),
|
||||
array('Monetary Source', (isset($source['id'])
|
||||
? $html->link('#'.$source['id'],
|
||||
array('Customer', $html->link($customer['name'],
|
||||
array('controller' => 'customers',
|
||||
'action' => 'view',
|
||||
$customer['id']))),
|
||||
array('Lease', $html->link('#'.$lease['id'],
|
||||
array('controller' => 'leases',
|
||||
'action' => 'view',
|
||||
$lease['id']))),
|
||||
array('Monetary Source', (isset($source['name'])
|
||||
? $html->link($source['name'],
|
||||
array('controller' => 'monetary_sources',
|
||||
'action' => 'view',
|
||||
$source['id']))
|
||||
|
||||
@@ -54,7 +54,8 @@ echo '<div CLASS="detail supporting">' . "\n";
|
||||
|
||||
echo $this->element('ledger_entries',
|
||||
array('caption' => 'Entries in Transaction',
|
||||
'ledger_entries' => $transaction['LedgerEntry'],
|
||||
//'ledger_entries' => $transaction['LedgerEntry'],
|
||||
'transaction_id' => $transaction['Transaction']['id'],
|
||||
'notxgroup' => true,
|
||||
));
|
||||
|
||||
|
||||
@@ -57,16 +57,15 @@ echo $this->element('leases',
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Ledger History
|
||||
* Current Tenant Lease Account History
|
||||
*/
|
||||
/* foreach($unit['Lease'] AS $lease) { */
|
||||
/* pr($lease); */
|
||||
/* $caption = 'Lease #'.$lease['number'].' (Tenant: '.$lease['Customer']['name'].')'; */
|
||||
/* echo $this->element('lease', */
|
||||
/* array('caption' => $caption, */
|
||||
/* 'entries' => $lease['Customer']['Transaction'], */
|
||||
/* 'ledger' => array('mix'=>1))); */
|
||||
/* } */
|
||||
|
||||
echo $this->element('ledger_entries',
|
||||
array('caption' => ('Current Lease Account (' .
|
||||
$unit['CurrentLease']['Customer']['name']
|
||||
. ')'),
|
||||
'lease_id' => $unit['CurrentLease']['id'],
|
||||
));
|
||||
|
||||
|
||||
/* End "detail supporting" div */
|
||||
|
||||
Reference in New Issue
Block a user