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@335 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-15 05:42:10 +00:00
parent 50c4ee225f
commit 0649329dde
3 changed files with 74 additions and 35 deletions

View File

@@ -46,8 +46,8 @@ Operations to be functional
X - Receive and record Cash
X - Receive and record ACH Deposits
x - Reverse rent charges (early moveout on prepaid occupancy)
- Handle NSF checks
- Assess NSF Fees
X - Handle NSF checks
X - Assess NSF Fees
- Determine Lease Paid-Through status
- Report: List of customers overdue
- Flag unit as overlocked
@@ -66,4 +66,4 @@ Operations to be functional
- Record Petty Cash to refund.
X - Write Off Bad Debt
X - Perform a Deposit and Close the Books
- Determine Rents Collected for a given period.
X - Determine Rents Collected for a given period.

View File

@@ -325,12 +325,16 @@ class LedgerEntriesController extends AppController {
return $order;
}
function jqGridDataOutputRecordCell(&$params, &$model, &$record, $field, $data) {
/* if ($field === 'CreditAccount.name') { */
/* $data .= '-OK'; */
/* } */
function jqGridDataOutputRecords(&$params, &$model, &$records) {
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);
}

View File

@@ -15,25 +15,14 @@ echo '<div class="account collected">' . "\n";
// Reset the form
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(); */
}
function onGridLoadComplete() {
var userdata = $('#collected-entries-jqGrid').getGridParam('userData');
$('#collected-total').html(fmtCurrency(userdata['total']));
}
function updateEntriesGrid() {
var cust = new Array();
@@ -58,8 +47,33 @@ function updateEntriesGrid() {
--></script>
<?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',
//'onsubmit' => 'updateEntriesGrid(); return false',
@@ -101,6 +115,25 @@ echo $form->button('Update',
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
(// Element configuration
'collected_account_id' => $account['id'],
@@ -111,18 +144,12 @@ echo $this->element('ledger_entries', array
(
'grid_div_id' => 'collected-entries',
'grid_div_class' => 'text-below',
'grid_setup' => $grid_setup,
//'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"><!--
@@ -145,6 +172,14 @@ echo('<DIV CLASS="grid-selection-text">' .
});
--></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>