git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@324 97e9348a-65ac-dc4b-aefc-98561f571b83
146 lines
4.3 KiB
PHP
146 lines
4.3 KiB
PHP
<?php /* -*- mode:PHP -*- */
|
|
|
|
echo '<div class="account collected">' . "\n";
|
|
|
|
/**********************************************************************
|
|
**********************************************************************
|
|
**********************************************************************
|
|
**********************************************************************
|
|
* Javascript
|
|
*/
|
|
|
|
?>
|
|
|
|
<script type="text/javascript"><!--
|
|
|
|
// 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); */
|
|
|
|
/* updateEntriesGrid(); */
|
|
}
|
|
|
|
function updateEntriesGrid() {
|
|
var cust = new Array();
|
|
|
|
var account_ids = new Array();
|
|
$("INPUT[type='checkbox']:checked").each(function(i) {
|
|
account_ids.push($(this).val());
|
|
});
|
|
|
|
cust['collected_account_id'] = <?php echo $account['id']; ?>;
|
|
cust['collected_from_date'] = $('#TxFromDate').val();
|
|
cust['collected_through_date'] = $('#TxThroughDate').val();
|
|
cust['collected_payment_accounts'] = account_ids;
|
|
|
|
$('#collected-entries-jqGrid').clearGridData();
|
|
$('#collected-entries-jqGrid').setPostDataItem('custom', serialize(cust));
|
|
$('#collected-entries-jqGrid')
|
|
.setGridParam({ page: 1 })
|
|
.trigger("reloadGrid");
|
|
}
|
|
|
|
|
|
--></script>
|
|
|
|
<?php
|
|
; // align
|
|
//echo '<DIV ID="dialog">' . "\n";
|
|
|
|
echo $form->create(null, array('id' => 'receipt-form',
|
|
//'onsubmit' => 'updateEntriesGrid(); return false',
|
|
'url' => array('controller' => 'transactions',
|
|
'action' => 'postReceipt')));
|
|
|
|
echo $form->input("id",
|
|
array('id' => 'account-id',
|
|
'type' => 'hidden',
|
|
'value' => 0));
|
|
|
|
echo $this->element('form_table',
|
|
array('class' => "item account collected entry",
|
|
//'with_name_after' => ':',
|
|
'field_prefix' => 'Tx.',
|
|
'fields' => array
|
|
("account_id" => array('name' => 'Account',
|
|
'opts' =>
|
|
array('type' => 'select',
|
|
'multiple' => 'checkbox',
|
|
'options' => $paymentAccounts,
|
|
'selected' => array_keys($defaultAccounts),
|
|
),
|
|
),
|
|
"from_date" => array('opts' =>
|
|
array('type' => 'text'),
|
|
'between' => '<A HREF="#" ONCLICK="datepickerBOM(null,\'TxFromDate\'); return false;">BOM</A>',
|
|
),
|
|
"through_date" => array('opts' =>
|
|
array('type' => 'text'),
|
|
'between' => '<A HREF="#" ONCLICK="datepickerEOM(\'TxFromDate\',\'TxThroughDate\'); return false;">EOM</A>',
|
|
),
|
|
),
|
|
));
|
|
|
|
echo $form->button('Update',
|
|
array('onclick' => 'updateEntriesGrid(); return false',
|
|
));
|
|
|
|
echo $form->end();
|
|
|
|
echo $this->element('ledger_entries', array
|
|
(// Element configuration
|
|
'collected_account_id' => $account['id'],
|
|
'collected_payment_accounts' => array_keys($defaultAccounts),
|
|
|
|
// Grid configuration
|
|
'config' => array
|
|
(
|
|
'grid_div_id' => 'collected-entries',
|
|
'grid_div_class' => 'text-below',
|
|
//'caption' => '<SPAN id="receipt-charges-caption"></SPAN>',
|
|
'caption' => 'Collected Charges',
|
|
),
|
|
));
|
|
|
|
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"><!--
|
|
$(document).ready(function(){
|
|
$("#TxFromDate")
|
|
.attr('autocomplete', 'off')
|
|
.datepicker({ constrainInput: true,
|
|
numberOfMonths: [1, 1],
|
|
showCurrentAtPos: 0,
|
|
dateFormat: 'mm/dd/yy' });
|
|
|
|
$("#TxThroughDate")
|
|
.attr('autocomplete', 'off')
|
|
.datepicker({ constrainInput: true,
|
|
numberOfMonths: [1, 1],
|
|
showCurrentAtPos: 0,
|
|
dateFormat: 'mm/dd/yy' });
|
|
|
|
resetForm();
|
|
});
|
|
--></script>
|
|
|
|
</div>
|
|
|
|
<a href="#" onClick="$('#debug').html(''); return false;">Clear Debug Output</a>
|