Fixed the balance summary of the collected report, and marked off NSF and collected report requirements.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@335 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -325,12 +325,16 @@ class LedgerEntriesController extends AppController {
|
|||||||
return $order;
|
return $order;
|
||||||
}
|
}
|
||||||
|
|
||||||
function jqGridDataOutputRecordCell(&$params, &$model, &$record, $field, $data) {
|
function jqGridDataOutputRecords(&$params, &$model, &$records) {
|
||||||
/* if ($field === 'CreditAccount.name') { */
|
|
||||||
/* $data .= '-OK'; */
|
|
||||||
/* } */
|
|
||||||
|
|
||||||
parent::jqGridDataOutputRecordCell($params, $model, $record, $field, $data);
|
if ($params['action'] === 'collected') {
|
||||||
|
$total = 0;
|
||||||
|
foreach ($records AS &$record)
|
||||||
|
$total += $record['LedgerEntry']['applied'];
|
||||||
|
echo ' <userdata name="total">' . $total . '</userdata>' . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
parent::jqGridDataOutputRecords($params, $model, $records);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,25 +15,14 @@ echo '<div class="account collected">' . "\n";
|
|||||||
|
|
||||||
// Reset the form
|
// Reset the form
|
||||||
function resetForm() {
|
function resetForm() {
|
||||||
/* $('#payment-entry-id').val(1); */
|
|
||||||
/* $('#payments').html(''); */
|
|
||||||
|
|
||||||
/* $("#receipt-customer-id").html("INTERNAL ERROR"); */
|
|
||||||
/* $("#receipt-customer-name").html("INTERNAL ERROR"); */
|
|
||||||
/* $("#receipt-balance").html("INTERNAL ERROR"); */
|
|
||||||
/* $("#receipt-charges-caption").html("Outstanding Charges"); */
|
|
||||||
|
|
||||||
/* datepickerBOM(null, 'TxFromDate'); */
|
|
||||||
/* datepickerNow('TxThroughDate', false); */
|
|
||||||
|
|
||||||
// REVISIT <AP>: 20090714
|
|
||||||
// Figure out how to just prevent jqGrid
|
|
||||||
// from loading in the first place
|
|
||||||
|
|
||||||
/* $('#collected-entries-jqGrid').clearGridData(); */
|
|
||||||
/* updateEntriesGrid(); */
|
/* updateEntriesGrid(); */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onGridLoadComplete() {
|
||||||
|
var userdata = $('#collected-entries-jqGrid').getGridParam('userData');
|
||||||
|
$('#collected-total').html(fmtCurrency(userdata['total']));
|
||||||
|
}
|
||||||
|
|
||||||
function updateEntriesGrid() {
|
function updateEntriesGrid() {
|
||||||
var cust = new Array();
|
var cust = new Array();
|
||||||
|
|
||||||
@@ -58,8 +47,33 @@ function updateEntriesGrid() {
|
|||||||
--></script>
|
--></script>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
; // align
|
|
||||||
//echo '<DIV ID="dialog">' . "\n";
|
/**********************************************************************
|
||||||
|
**********************************************************************
|
||||||
|
**********************************************************************
|
||||||
|
**********************************************************************
|
||||||
|
* Summary Info Box
|
||||||
|
*/
|
||||||
|
|
||||||
|
echo '<div class="infobox">' . "\n";
|
||||||
|
|
||||||
|
$rows = array();
|
||||||
|
$rows[] = array('Total:', '<SPAN id="collected-total"></SPAN>');
|
||||||
|
echo $this->element('table',
|
||||||
|
array('class' => 'summary',
|
||||||
|
'rows' => $rows,
|
||||||
|
'column_class' => array('field', 'value'),
|
||||||
|
'suppress_alternate_rows' => true,
|
||||||
|
));
|
||||||
|
echo '</div>' . "\n";
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
**********************************************************************
|
||||||
|
**********************************************************************
|
||||||
|
**********************************************************************
|
||||||
|
* User Configuration
|
||||||
|
*/
|
||||||
|
|
||||||
echo $form->create(null, array('id' => 'receipt-form',
|
echo $form->create(null, array('id' => 'receipt-form',
|
||||||
//'onsubmit' => 'updateEntriesGrid(); return false',
|
//'onsubmit' => 'updateEntriesGrid(); return false',
|
||||||
@@ -101,6 +115,25 @@ echo $form->button('Update',
|
|||||||
|
|
||||||
echo $form->end();
|
echo $form->end();
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
**********************************************************************
|
||||||
|
**********************************************************************
|
||||||
|
**********************************************************************
|
||||||
|
* Supporting Elements Section
|
||||||
|
*/
|
||||||
|
|
||||||
|
echo '<div CLASS="detail supporting">' . "\n";
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* Entries
|
||||||
|
*/
|
||||||
|
|
||||||
|
$grid_setup =
|
||||||
|
array('loadComplete' =>
|
||||||
|
array('--special' => "function() {url=jQuery('#collected-entries-jqGrid').getGridParam('url');url=url.replace(/\/debug.*$/,'?'); pd=jQuery('#collected-entries-jqGrid').getPostData();$.each(pd,function(i){ url+=i+'='+escape(pd[i])+'&'; }); jQuery('#collected-entries-jqGrid-query').html('<A HREF=\"'+url+'\">Grid Query</A><BR>'); onGridLoadComplete();}"));
|
||||||
|
|
||||||
echo $this->element('ledger_entries', array
|
echo $this->element('ledger_entries', array
|
||||||
(// Element configuration
|
(// Element configuration
|
||||||
'collected_account_id' => $account['id'],
|
'collected_account_id' => $account['id'],
|
||||||
@@ -111,18 +144,12 @@ echo $this->element('ledger_entries', array
|
|||||||
(
|
(
|
||||||
'grid_div_id' => 'collected-entries',
|
'grid_div_id' => 'collected-entries',
|
||||||
'grid_div_class' => 'text-below',
|
'grid_div_class' => 'text-below',
|
||||||
|
'grid_setup' => $grid_setup,
|
||||||
//'caption' => '<SPAN id="receipt-charges-caption"></SPAN>',
|
//'caption' => '<SPAN id="receipt-charges-caption"></SPAN>',
|
||||||
'caption' => 'Collected Charges',
|
'caption' => 'Collected ' . Inflector::pluralize($account['name'])
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
echo('<DIV CLASS="grid-selection-text">' .
|
|
||||||
'<TABLE ID="supporting-table">' .
|
|
||||||
'<TR><TD CLASS="field">Balance:</TD><TD CLASS="value"><SPAN id="collected-balance"></SPAN></TD></TR>' .
|
|
||||||
'</TABLE>' .
|
|
||||||
'</DIV>' .
|
|
||||||
"\n");
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript"><!--
|
<script type="text/javascript"><!--
|
||||||
@@ -145,6 +172,14 @@ echo('<DIV CLASS="grid-selection-text">' .
|
|||||||
});
|
});
|
||||||
--></script>
|
--></script>
|
||||||
|
|
||||||
</div>
|
<?php
|
||||||
|
|
||||||
|
/* End "detail supporting" div */
|
||||||
|
echo '</div>' . "\n";
|
||||||
|
|
||||||
|
/* End page div */
|
||||||
|
echo '</div>' . "\n";
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
<a href="#" onClick="$('#debug').html(''); return false;">Clear Debug Output</a>
|
<a href="#" onClick="$('#debug').html(''); return false;">Clear Debug Output</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user