Added outstanding charges and outstanding credits to the customer page, and reorded fields in order of presumed importance. Removed items from Unit/Lease which really shouldn't have been there. They were added for convenience, but the redundancy was confusing. Added a couple report links to make it easy to see outstanding charges and collected rents.
git-svn-id: file:///svn-source/pmgr/branches/v0.3_work/site@977 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -130,11 +130,11 @@ function updateCharges(id) {
|
||||
$("#receipt-balance").html("Calculating...");
|
||||
$("#receipt-charges-caption").html("Please Wait...");
|
||||
|
||||
var custom = new Array();
|
||||
custom['customer_id'] = id;
|
||||
var filter = new Array();
|
||||
filter['StatementEntry.customer_id'] = id;
|
||||
|
||||
var dynamic_post = new Array();
|
||||
dynamic_post['custom'] = custom;
|
||||
dynamic_post['filter'] = filter;
|
||||
|
||||
$('#charge-entries-jqGrid').setPostDataItem('dynamic_post_replace', serialize(dynamic_post));
|
||||
$('#charge-entries-jqGrid')
|
||||
@@ -333,7 +333,7 @@ echo $this->element('statement_entries', array
|
||||
'action' => 'unreconciled',
|
||||
'exclude' => array('Customer', 'Type', 'Debit', 'Credit'),
|
||||
'include' => array('Applied', 'Balance'),
|
||||
'remap' => array('Applied' => 'Paid'),
|
||||
'remap' => array('Received' => 'Paid'),
|
||||
'limit' => 8,
|
||||
),
|
||||
));
|
||||
|
||||
@@ -53,15 +53,55 @@ echo '<div CLASS="detail supporting">' . "\n";
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Contacts
|
||||
* Unpaid Charges
|
||||
*/
|
||||
|
||||
echo $this->element('contacts', array
|
||||
echo $this->element('statement_entries', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' => 'Customer Contacts',
|
||||
'filter' => array('Customer.id' => $customer['Customer']['id']),
|
||||
'include' => array('Relationship'),
|
||||
('caption' => 'Outstanding Charges',
|
||||
'limit' => 10,
|
||||
'action' => 'unreconciled',
|
||||
'filter' => array('StatementEntry.customer_id' => $lease['id']),
|
||||
'exclude' => array('Customer'),
|
||||
)));
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Customer Credits
|
||||
*/
|
||||
|
||||
echo $this->element('statement_entries', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' => 'Oustanding Credits',
|
||||
'grid_div_id' => 'surplus',
|
||||
'limit' => 10,
|
||||
'filter' => array('Customer.id' => $customer['Customer']['id'],
|
||||
'StatementEntry.type' => 'SURPLUS'),
|
||||
'exclude' => array('Entry', 'Effective', 'Customer', 'Unit', 'Account', 'Debit', 'Credit'),
|
||||
'include' => array('Transaction', 'Amount'),
|
||||
'remap' => array('Transaction' => 'Receipt'),
|
||||
)));
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Receipt History
|
||||
*/
|
||||
|
||||
echo $this->element('ledger_entries', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' => 'Receipts',
|
||||
'limit' => 5,
|
||||
'filter' => array('Customer.id' => $customer['Customer']['id'],
|
||||
'Transaction.type' => 'RECEIPT',
|
||||
'Tender.id !=' => null,
|
||||
//'Account.id !=' => '-AR-'
|
||||
),
|
||||
'include' => array('Transaction'),
|
||||
'exclude' => array('Entry', 'Account', 'Cr/Dr'),
|
||||
'remap' => array('Transaction' => 'Receipt'),
|
||||
)));
|
||||
|
||||
|
||||
@@ -73,13 +113,28 @@ echo $this->element('leases', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' => 'Lease History',
|
||||
'filter' => array('Customer.id' => $customer['Customer']['id']),
|
||||
'limit' => 5,
|
||||
'filter' => array('Customer.id' => $customer['Customer']['id']),
|
||||
'exclude' => array('Customer'),
|
||||
'sort_column' => 'Move-In',
|
||||
'sort_order' => 'DESC',
|
||||
)));
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Contacts
|
||||
*/
|
||||
|
||||
echo $this->element('contacts', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' => 'Customer Contacts',
|
||||
'limit' => 5,
|
||||
'filter' => array('Customer.id' => $customer['Customer']['id']),
|
||||
'include' => array('Relationship'),
|
||||
)));
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Customer Account History
|
||||
*/
|
||||
@@ -90,28 +145,11 @@ echo $this->element('statement_entries', array
|
||||
('caption' => 'Customer Statement',
|
||||
'filter' => array('Customer.id' => $customer['Customer']['id'],
|
||||
'type !=' => 'VOID'),
|
||||
'include' => array('Sub-Total'),
|
||||
'exclude' => array('Customer'),
|
||||
)));
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Receipt History
|
||||
*/
|
||||
|
||||
echo $this->element('ledger_entries', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' => 'Receipts',
|
||||
'filter' => array('Customer.id' => $customer['Customer']['id'],
|
||||
'Transaction.type' => 'RECEIPT',
|
||||
'Tender.id !=' => null,
|
||||
//'Account.id !=' => '-AR-'
|
||||
),
|
||||
'include' => array('Transaction'),
|
||||
'exclude' => array('Entry', 'Account', 'Cr/Dr'),
|
||||
)));
|
||||
|
||||
|
||||
/* End "detail supporting" div */
|
||||
echo '</div>' . "\n";
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ $cols['Debit'] = array('index' => 'charge', 'formatter' =>
|
||||
$cols['Credit'] = array('index' => 'disbursement', 'formatter' => 'currency');
|
||||
|
||||
$cols['Amount'] = array('index' => "StatementEntry.amount", 'formatter' => 'currency');
|
||||
$cols['Applied'] = array('index' => "applied", 'formatter' => 'currency');
|
||||
$cols['Received'] = array('index' => "applied", 'formatter' => 'currency');
|
||||
// 'balance' is already in use as part of charge/disbursement/balance.
|
||||
// 'unapplied' isn't quite the right term, but it's not customer visible.
|
||||
$cols['Balance'] = array('index' => "unapplied", 'formatter' => 'currency');
|
||||
@@ -32,6 +32,22 @@ if (isset($subtotal_column))
|
||||
$cols['Sub-Total']['index'] =
|
||||
'subtotal-' . $cols[$subtotal_column]['index'];
|
||||
|
||||
if ((isset($action) && $action == 'unreconciled') ||
|
||||
(isset($config) && isset($config['action']) && $config['action'] == 'unreconciled')) {
|
||||
if (isset($config) && !isset($config['grid_div_id']))
|
||||
$config['grid_div_id'] = 'unpaid';
|
||||
$include_columns = array('Entry', 'Date',
|
||||
'Effective', 'Customer', 'Unit',
|
||||
'Account', 'Amount', 'Received', 'Balance');
|
||||
}
|
||||
else {
|
||||
$include_columns =
|
||||
array_diff(array_keys($cols),
|
||||
array('Transaction', 'Through', 'Lease',
|
||||
'Amount', 'Received', 'Balance', 'Sub-Total',
|
||||
'Comment'));
|
||||
}
|
||||
|
||||
// Include custom data
|
||||
$grid->customData(compact('statement_entry_id'));
|
||||
|
||||
@@ -41,8 +57,5 @@ $grid
|
||||
->sortField('Date', 'DESC')
|
||||
->defaultFields(array('Entry', 'Date', 'Charge', 'Payment'))
|
||||
->searchFields(array('Customer', 'Unit'))
|
||||
->render($this, isset($config) ? $config : null,
|
||||
array_diff(array_keys($cols), array('Transaction', 'Through', 'Lease',
|
||||
'Amount', 'Applied', 'Balance', 'Sub-Total',
|
||||
'Comment')));
|
||||
->render($this, isset($config) ? $config : null, $include_columns);
|
||||
|
||||
|
||||
@@ -215,6 +215,12 @@ class GridHelper extends AppHelper {
|
||||
}
|
||||
$this->jqGrid_options['controller'] = $controller;
|
||||
|
||||
// Add in any custom variables requested
|
||||
if (isset($config['custom'])) {
|
||||
$this->customData($config['custom']);
|
||||
unset($config['custom']);
|
||||
}
|
||||
|
||||
// Incorporate all other user options
|
||||
if (isset($config))
|
||||
$this->jqGrid_options = array_merge($this->jqGrid_options, $config);
|
||||
|
||||
@@ -78,6 +78,21 @@ echo '</div>' . "\n";
|
||||
echo '<div CLASS="detail supporting">' . "\n";
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Unpaid Charges
|
||||
*/
|
||||
|
||||
echo $this->element('statement_entries', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' => 'Outstanding Charges',
|
||||
'limit' => 10,
|
||||
'action' => 'unreconciled',
|
||||
'filter' => array('StatementEntry.lease_id' => $lease['id']),
|
||||
'exclude' => array('Customer', 'Unit'),
|
||||
)));
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Lease Account History
|
||||
*/
|
||||
@@ -86,30 +101,12 @@ echo $this->element('statement_entries', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' => 'Lease Statement',
|
||||
'filter' => array('Lease.id' => $lease['id']),
|
||||
'filter' => array('Lease.id' => $lease['id']),
|
||||
'include' => array('Through'),
|
||||
'exclude' => array('Customer', 'Lease', 'Unit'),
|
||||
)));
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Receipt History
|
||||
*/
|
||||
|
||||
echo $this->element('ledger_entries', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
('caption' => 'Customer Receipts',
|
||||
'filter' => array('Customer.id' => $customer['id'],
|
||||
'Transaction.type' => 'RECEIPT',
|
||||
'Tender.id !=' => null,
|
||||
//'Account.id !=' => '-AR-'
|
||||
),
|
||||
'include' => array('Transaction'),
|
||||
'exclude' => array('Entry', 'Account', 'Cr/Dr'),
|
||||
)));
|
||||
|
||||
|
||||
/* End "detail supporting" div */
|
||||
echo '</div>' . "\n";
|
||||
|
||||
|
||||
@@ -76,26 +76,6 @@ echo $this->element('leases', array
|
||||
)));
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Current Customer Lease Account History
|
||||
*/
|
||||
|
||||
if (isset($current_lease['id'])) {
|
||||
echo $this->element('statement_entries', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
(
|
||||
'caption' =>
|
||||
('Current Lease Statement ('
|
||||
. $current_lease['Customer']['name']
|
||||
. ')'),
|
||||
'filter' => array('Lease.id' => $current_lease['id']),
|
||||
'include' => array('Through'),
|
||||
'exclude' => array('Customer', 'Lease', 'Unit'),
|
||||
)));
|
||||
}
|
||||
|
||||
|
||||
/* End "detail supporting" div */
|
||||
echo '</div>' . "\n";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user