Got the collected reports working again. NSF hasn't been tested yet, because NSF entry is not yet working.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@402 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -24,21 +24,22 @@ function onGridLoadComplete() {
|
||||
}
|
||||
|
||||
function updateEntriesGrid() {
|
||||
var cust = new Array();
|
||||
|
||||
var account_ids = new Array();
|
||||
$("INPUT[type='checkbox']:checked").each(function(i) {
|
||||
account_ids.push($(this).val());
|
||||
});
|
||||
|
||||
cust['account_id'] = <?php echo $account['id']; ?>;
|
||||
var cust = new Array();
|
||||
cust['from_date'] = $('#TxFromDate').val();
|
||||
cust['through_date'] = $('#TxThroughDate').val();
|
||||
cust['payment_accounts'] = account_ids;
|
||||
cust['account_id'] = account_ids;
|
||||
|
||||
var dynamic_post = new Array();
|
||||
dynamic_post['custom'] = cust;
|
||||
|
||||
$('#collected-total').html('Calculating...');
|
||||
$('#collected-entries-jqGrid').clearGridData();
|
||||
$('#collected-entries-jqGrid').setPostDataItem('custom', serialize(cust));
|
||||
$('#collected-entries-jqGrid').setPostDataItem('dynamic_post', serialize(dynamic_post));
|
||||
$('#collected-entries-jqGrid')
|
||||
.setGridParam({ page: 1 })
|
||||
.trigger("reloadGrid");
|
||||
@@ -153,11 +154,8 @@ echo '<div CLASS="detail supporting">' . "\n";
|
||||
* Entries
|
||||
*/
|
||||
|
||||
echo $this->element('ledger_entries', array
|
||||
(// Element configuration
|
||||
'account_id' => $account['id'],
|
||||
|
||||
// Grid configuration
|
||||
echo $this->element('statement_entries', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
(
|
||||
'grid_div_id' => 'collected-entries',
|
||||
@@ -165,7 +163,10 @@ echo $this->element('ledger_entries', array
|
||||
'grid_events' => array('loadComplete' => 'onGridLoadComplete()'),
|
||||
//'grid_setup' => array('hiddengrid' => true),
|
||||
//'caption' => '<SPAN id="receipt-charges-caption"></SPAN>',
|
||||
'caption' => 'Collected ' . Inflector::pluralize($account['name'])
|
||||
'caption' => 'Collected ' . Inflector::pluralize($account['name']),
|
||||
'filter' => array('StatementEntry.type' => 'PAYMENT',
|
||||
'ChargeEntry.account_id' => $account['id']),
|
||||
'exclude' => array('Account', 'Charge'),
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
@@ -20,23 +20,16 @@ $cols['Comment'] = array('index' => 'StatementEntry.comment', 'formatter'
|
||||
$cols['Charge'] = array('index' => 'charge', 'formatter' => 'currency');
|
||||
$cols['Payment'] = array('index' => 'payment', 'formatter' => 'currency');
|
||||
|
||||
$cols['Last Payment'] = array('index' => 'last_paid', 'formatter' => 'date');
|
||||
$cols['Applied'] = array('index' => "applied", 'formatter' => 'currency');
|
||||
$cols['Sub-Total'] = array('index' => 'subtotal-balance', 'formatter' => 'currency', 'sortable' => false);
|
||||
|
||||
|
||||
/* if (!isset($statement_entry_id)) */
|
||||
/* $grid->invalidFields('Applied'); */
|
||||
/* else */
|
||||
/* $cols['Sub-Total']['index'] = 'subtotal-applied'; */
|
||||
|
||||
// REVISIT <AP>: 20090722
|
||||
// Disallowing this field until more of the rework is complete
|
||||
$grid->invalidFields('Applied');
|
||||
if (isset($subtotal_column))
|
||||
$cols['Sub-Total']['index'] =
|
||||
'subtotal-' . $cols[$subtotal_column]['index'];
|
||||
|
||||
// Include custom data
|
||||
$grid->customData(compact('statement_entry_id', 'from_date', 'through_date',
|
||||
'payment_accounts', 'charge_accounts'));
|
||||
$grid->customData(compact('statement_entry_id'));
|
||||
|
||||
// Render the grid
|
||||
$grid
|
||||
@@ -45,5 +38,7 @@ $grid
|
||||
->defaultFields(array('Entry', 'Date', 'Charge', 'Payment'))
|
||||
->searchFields(array('Customer', 'Unit'))
|
||||
->render($this, isset($config) ? $config : null,
|
||||
array_diff(array_keys($cols), array('Through', 'Lease', 'Last Payment', 'Comment')));
|
||||
array_diff(array_keys($cols), array('Through', 'Lease',
|
||||
'Applied', 'Sub-Total',
|
||||
'Comment')));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user