Updating each section of billing to get rid of undefined php notices.
{* Form Start *}
{$ui = [
- 'id' => 'searchForm',
- 'action' => "{$thisUrl}?page={$thisPage}",
- 'method' => 'post'
+ 'id' => 'searchForm',
+ 'action' => "{$thisUrl}?page={$thisPage}",
+ 'method' => 'post'
]}
{include file='ui/f6/form-start.html'}
e.preventDefault();
accountLinksEmployeesSelected();
var account_id = $(this).data('id');
- console.log('account_id: ', account_id);
$('#account-employees-' + account_id).show();
} );
function accountLinksEmployeesSelected() {
accountEmployee = true;
- console.log( 'accountHoverId: ', accountHoverId );
$('#account-container-' + accountHoverId).addClass('hide-for-large');
}
$('#glm-billing-employees').on('click', '.glm-billing-employee-del', function(){
- //console.log( 'clicked glm-billing-employee-del on ' );
$(this).parent('.glm-billing-employee').remove();
});
$('#glm-billing-employees').on('click', '.glm-billing-employee-del', function(){
- //console.log( 'clicked glm-billing-employee-del on ' );
$(this).parent('.glm-billing-employee').remove();
});
valid = valid && checkRequired( line_item_type, lineTips, 'Invoice Type is required!' );
if ( valid ) {
- // console.log( 'line_item_type', line_item_type );
var selectedLineItem = $.extend({}, invoiceTypeJSON[line_item_type.val()] );
- // console.log( 'selectedLineItem', selectedLineItem );
if ( selectedLineItem.dynamic_amount.value ) {
isDynamicInvoiceType = true;
var dynamic_price = $( 'input[name="dynamic_price"]' ); // Dynamic price line item
if ( selectedLineItem == undefined ) {
// Check that name and amount are not empty
} else {
- // console.log( 'isDynamicInvoiceType:', isDynamicInvoiceType );
// Check first to see if this line_item_type is already in line_items.
// Only for invoice types that are not dynamic amounts
if ( isDynamicInvoiceType || ( !isDynamicInvoiceType && !isLineItem( selectedLineItem ) ) ) {
valid = valid && checkRequired( billing_zip, accountTips, 'Billing Zip is required!' );
if ( valid ) {
- // console.log( newAccountForm.serialize() );
$.ajax({
url: '{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=billingAccount&option=add',
cache: false,
dataType: 'json'
}).done(function( msg ){
if ( msg.status === true ) {
- // console.log( 'account: ', msg.account );
// TODO: check these function as they don't seem to work!
// Reload the account select
updateBillingAccountList( msg.account );
if ( msg.fieldFail.account_number ) {
alert( 'Account Number must be unique!' );
}
- // console.log( 'return', msg );
}
});
}
* Check field against regular expression.
*/
function checkRegexp( fieldName, regexp, message, tips ) {
- // console.log( 'fieldName: ', fieldName );
- // console.log( 'regexp: ', regexp );
- // console.log( 'message: ', message );
if ( !( regexp.test( fieldName.val() ) ) ) {
fieldName.addClass( 'ui-state-error' );
updateTips( tips, message );
dataType: 'json'
}).done(function(msg){
availableAccountMembers = [];
- // console.log( msg );
for ( index in msg ) {
var obj = msg[index];
availableAccountMembers.push( {
id: obj.id
} );
}
- // console.log( 'availableAccountMembers', availableAccountMembers );
// also need to update the source for the autocomplete
$('#glm_member_accounts').autocomplete(
'option',
dataType: 'json'
}).done(function(data){
invoiceTypeJSON = data;
- // console.log( 'invoiceTypeJSON', invoiceTypeJSON );
addLineItemToInvoice( invoiceTypeJSON[lineItemId] );
totalInvoice();
});
valid = valid && checkRequired( customFieldAmount, customTips, 'Amount is required!' );
valid = valid && checkRegexp( customFieldAmount, moneyRegex, 'Amount: Use numbers only!', customTips );
- // console.log( 'customFieldName: ', customFieldName.val() );
- // console.log( 'customFieldAmount: ', customFieldAmount.val() );
if ( valid ) {
- // console.log('start ajax');
$.ajax({
url: '{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=invoiceTypes&option=add',
cache: false,
dataType: 'json'
}).done(function( msg ){
if ( msg.status === true ) {
- // console.log( 'msg from addCustomLineItem: ', msg );
updateInvoiceTypeList( msg.invoiceType.id );
// Close the dialog
customLineItemDialog.dialog( 'close' );
} else {
- // console.log( 'return', msg );
}
});
}
*/
newAccountForm = newAccountDialog.find( '#addAccountForm' ).on( 'submit', function(){
event.preventDefault();
- // console.log('Adding new Account');
});
/**
{* Form Start *}
{$ui = [
- 'id' => 'billing-invoice-type-form',
- 'action' => "{$thisUrl}?page={$thisPage}&glm_action==invoiceTypes",
- 'method' => 'post',
- 'file' => false
+ 'id' => 'billing-invoice-type-form',
+ 'action' => "{$thisUrl}?page={$thisPage}&glm_action==invoiceTypes",
+ 'method' => 'post',
+ 'file' => false,
+ 'validate' => true,
+ 'validateFocusMsg' => true
]}
{include file="ui/f6/form-start.html"}
-{* Callout Errors *}
-{include file='ui/f6/errorCallout.html'}
-
<input type="hidden" name="glm_action" value="invoiceTypes">
{if isset($data.fieldData.id)}
</fieldset>
-</div>
-
-{* Form Submit *}
-{if isset( $data.fieldData.id )}
- {$label = 'Update Invoice Type'}
-{else}
- {$label = 'Add Invoice Type'}
-{/if}
-{$ui = [
- 'type' => 'submit',
- 'label' => $label,
- 'class' => 'primary'
-]}
-{include file='ui/f6/submit.html'}
+ {* Form Submit *}
+ {$ui = [
+ 'submit' => true,
+ 'label' => 'Save Invoice Type',
+ 'class' => 'primary',
+ 'cancel' => "{$thisUrl}?page=glm-members-admin-menu-billing&glm_action=invoiceTypes"
+ ]}
+ {include file='ui/f6/submit.html'}
-<a class="button secondary" href="{$thisUrl}?page=glm-members-admin-menu-billing&glm_action=invoiceTypes">Cancel</a>
+</div>
{* Error Callout *}
{include file='ui/f6/errorCallout.html'}
<script>
jQuery(document).ready(function($){
// Abide event listeners
- $(document)
+ //$(document)
// field element is invalid
- .on('invalid.zf.abide', function( ev, elem ) {
- elem.focus();
- })
+ //.on('invalid.zf.abide', function( ev, elem ) {
+ //elem.focus();
+ //})
// form validation failed
- .on('forminvalid.zf.abide', function( ev, frm ) {
+ //.on('forminvalid.zf.abide', function( ev, frm ) {
//ev.preventDefault();
- //console.log( 'Form is not valid' );
- })
+ //})
// form validation passed
- .on('formvalid.zf.abide', function( ev, frm ) {
+ //.on('formvalid.zf.abide', function( ev, frm ) {
//ev.preventDefault();
- //console.log( 'Form is valid' );
- })
+ //})
// to preven form from submitting upon successful validation
- .on('submit', function( ev ) {
+ //.on('submit', function( ev ) {
//ev.preventDefault();
- //console.log( 'Submit for form intercepted' );
- });
+ //});
/*
* Check for input changes
var glmSubmitRequired = false;
$('input, textarea, select').on( 'change', function() {
glmSubmitRequired = true;
- console.log('locked', glmSubmitRequired);
});
/*
{* Form Start *}
{$ui = [
- 'id' => 'billing-notification-form',
- 'action' => "{$thisUrl}?page={$thisPage}&glm_action=notifications",
- 'method' => 'post',
- 'file' => false
+ 'id' => 'billing-notification-form',
+ 'action' => "{$thisUrl}?page={$thisPage}&glm_action=notifications",
+ 'method' => 'post',
+ 'file' => false,
+ 'validate' => true,
+ 'validateFocusMsg' => true
]}
{include file="ui/f6/form-start.html"}
<input type="hidden" name="option" value="insert">
{/if}
-{* Error Callout *}
-{include file='ui/f6/errorCallout.html'}
-
<div class="grid-container">
<div class="grid-x grid-margin-x">
]}
{include file='ui/f6/editor.html'}
-
-
- <button class="button primary" type="submit">{if $notification_id}Update{else}Add{/if} Notification Type</button>
-
- <a class="button secondary" href="{$thisUrl}?page=glm-members-admin-menu-billing&glm_action=notifications">Cancel</a>
+ {* Form Submit *}
+ {$ui = [
+ 'submit' => true,
+ 'label' => 'Save Notification Type',
+ 'class' => 'primary',
+ 'cancel' => "{$thisUrl}?page=glm-members-admin-menu-billing&glm_action=notifications"
+ ]}
+ {include file='ui/f6/submit.html'}
</fieldset>
-
<fieldset class="fieldset small-12 medium-6">
<legend>Merge Tag Description</legend>
var glmSubmitRequired = false;
$('input, textarea, select').on( 'change', function() {
glmSubmitRequired = true;
- console.log('locked', glmSubmitRequired);
});
/*
},
success: function( results ) {
updateInvoiceList( results );
- console.log( results );
},
});
},
<td>
<select multiple size="5" id="invoice_types" name="invoice_types[]">
{foreach $paymentTypes as $paymentType}
- <option value="{$paymentType.id}"{if isset($smarty.request.invoice_types) && in_array( $paymentType.id, $smarty.request.invoice_types )} selected{/if}>{$paymentType.name}</option>
+ <option value="{$paymentType.id}"
+ {if isset($smarty.request.invoice_types) && is_array( $smarty.request.invoice_types ) && in_array( $paymentType.id, $smarty.request.invoice_types )}
+ selected
+ {/if}>{$paymentType.name}</option>
{/foreach}
</select>
</td>
<th>Date Range Search: </th>
<td>
<b>From Date: </b><br />
- <input type="text" name="fromDate" value="{$fromDate}" class="glm-form-text-input-short glm-date-input"><br />
+ <input type="text" name="fromDate" value="{$fromDate|default:''}" class="glm-form-text-input-short glm-date-input"><br />
<b>To Date: </b><br />
- <input type="text" name="toDate" value="{$toDate}" class="glm-form-text-input-short glm-date-input"><br />
+ <input type="text" name="toDate" value="{$toDate|default:''}" class="glm-form-text-input-short glm-date-input"><br />
</td>
</tr>
<tr>
<th>Name Search:</th>
<td>
- <input type="hidden" name="filterReports" value="{$filterReports}">
+ <input type="hidden" name="filterReports" value="{$filterReports|default:''}">
<input id="account_name2" name="member_name" value="" />
</td>
</tr>
- {if isset( $settings.account_number_enabled ) && $settings.account_number_enabled}
+ {if !empty( $settings.account_number_enabled ) && $settings.account_number_enabled}
<tr>
<th>Account Number Search:</th>
<td>
- <input type="hidden" name="filterReports" value="{$filterReports}">
+ <input type="hidden" name="filterReports" value="{$filterReports|default:''}">
<input id="account_number" name="account_number" value="" />
</td>
</tr>
{* index (Dashboard) *}
+{* Header *}
{if $fromMemberMenu}
{include file='admin/member/header.html'}
{include file='admin/billing/memberBillingSubHeader.html'}
<br clear="all">
{/foreach}
+{* Export Billing Modal *}
{include file='admin/billing/exportBillingModal.html'}
<script>
e.preventDefault();
accountLinksEmployeesSelected();
var account_id = $(this).data('id');
- console.log('account_id: ', account_id);
$('#account-employees-' + account_id).show();
} );
function accountLinksEmployeesSelected() {
accountEmployee = true;
- console.log( 'accountHoverId: ', accountHoverId );
$('#account-container-' + accountHoverId).addClass('glm-hidden');
}
{* Form Start *}
{$ui = [
- 'id' => 'searchForm',
- 'action' => "{$thisUrl}?page={$thisPage}",
- 'method' => 'post'
+ 'id' => 'searchForm',
+ 'action' => "{$thisUrl}?page={$thisPage}",
+ 'method' => 'post'
]}
{include file='ui/f6/form-start.html'}
select: function( event, ui ){
$('#member-invoice-id').val( ui.item.id );
$('#invoiceId').val( ui.item.id );
- // console.log( 'selected invoice id: ', ui.item.id );
$('#searchForm').submit();
},
change: function( event, ui) {
if( ui.item == null ) {
$('#member-invoice-id').val( '' );
- // console.log( 'selected invoice id: ', ui );
$('#searchForm').submit();
}
},
$('#print-invoices').on( 'click', function(e){
e.preventDefault();
var formData = $('#invoicing-form select').serialize();
- console.log( 'Form Data:', formData );
window.location = '{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=printInvoices&' + formData;
} );
$('#create-labels').on( 'click', function(e){
e.preventDefault();
var formData = $('#invoicing-form select, input.labelOption').serialize();
- console.log( 'Form Data:', formData );
// Check if the Export as CSV file was checked.
if ( $('#exportCSV:checked').length ) {
- console.log( 'exportCSV: ON' );
window.location = '{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=createCSVLabels&' + formData;
} else {
- console.log( 'exportCSV: OFF' );
window.location = '{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=createPDFLabels&' + formData;
}
} );
</form>
-<script type="text/javascript">
+<script>
jQuery(document).ready(function($) {
// Flash certain elements for a short time after display
$(document)
.on('invalid.zf.abide', function(ev,elem){
return false;
- // console.log('elem: ', elem);
// $('#billingPaymentForm').foundation('requiredCheck', elem);
- // console.log( 'Field id '+ev.target.id+' is invalid' );
})
// .on('forminvalid.zf.abide', function(ev,frm){
- // console.log( 'form id '+ev.target.id+' is invalid' );
// })
.on('submit', function(ev){
ev.preventDefault();
var validForm = $('#billingPaymentForm').foundation('validateForm');
- console.log('ValidForm: ',validForm);
var data = $('#billingPaymentForm').serialize();
- console.log('data: ', data);
- console.log('Submit for form id '+ev.target.id+' intercepted');
$.ajax({
url: '{$ajaxUrl}?action=glm_members_admin_ajax&' + data,
cache: false,
beforeSend: startAjax,
complete: completeAjax,
}).done(function(rsp){
- console.log( 'rsp:', rsp );
if ( rsp ) {
var $sucessModal = $('#billingSuccess');
$sucessModal.foundation('open').trigger('resizeme.zp.reveal');
return false;
}
}).fail(function(){
- console.log( 'error no submission' );
});
return false;
});
$(document)
.on('invalid.zf.abide', function(ev,elem){
return false;
- // console.log('elem: ', elem);
// $('#billingPaymentForm').foundation('requiredCheck', elem);
- // console.log( 'Field id '+ev.target.id+' is invalid' );
})
// .on('forminvalid.zf.abide', function(ev,frm){
- // console.log( 'form id '+ev.target.id+' is invalid' );
// })
.on('submit', function(ev){
ev.preventDefault();
var validForm = $('#billingPaymentForm').foundation('validateForm');
- console.log('ValidForm: ',validForm);
var data = $('#billingPaymentForm').serialize();
- console.log('data: ', data);
- console.log('Submit for form id '+ev.target.id+' intercepted');
$.ajax({
url: '{$ajaxUrl}?action=glm_members_admin_ajax&' + data,
cache: false,
beforeSend: startAjax,
complete: completeAjax,
}).done(function(rsp){
- console.log( 'rsp:', rsp );
// if ( rsp.status == '1' ) {
// var $sucessModal = $('#billingInfoSuccess');
// $sucessModal.foundation('open').trigger('resizeme.zp.reveal');
//
return false;
}).fail(function(){
- console.log( 'error failed to call ajax action' );
});
return false;
});
{* Form Start *}
{$ui = [
- 'id' => 'glm-billing-management-form',
- 'action' => "{$thisUrl}?page={$thisPage}",
- 'method' => 'post'
+ 'id' => 'glm-billing-management-form',
+ 'action' => "{$thisUrl}?page={$thisPage}",
+ 'method' => 'post',
+ 'validate' => true,
+ 'validateFocusMsg' => true
]}
{include file="ui/f6/form-start.html"}
</table>
</div>
-<script src="{$jsUrl}/PrintArea/jquery.PrintArea.js" type="text/JavaScript" language="javascript"></script>
+<script src="{$jsUrl}/PrintArea/jquery.PrintArea.js"></script>
<script>
jQuery(document).ready(function($) {
$(".graph-print").click(function(){
{* Form End *}
{include file='ui/f6/form-end.html'}
-<script type="text/javascript">
+<script>
jQuery(document).ready(function($) {
var paymentHoverId = false;
+{* Reports *}
+
+{* Header *}
{include file='admin/billing/header.html'}
<div class="callout grid-container">
<input type="hidden" name="prevStart" value="{$prevStart}">
<input type="hidden" name="nextStart" value="{$nextStart}">
<input type="hidden" name="limit" value="{$limit}">
+
{if $option == 'reportGenerator'}
<fieldset class="fieldset cell small-12">
<legend>Filter Reports</legend>
{* Payment Types *}
{$ui = [
- 'value' => $smarty.request.invoice_types,
+ 'value' => $smarty.request.invoice_types|default:'',
'field' => 'invoice_types',
'label' => 'Payment Types',
'list' => $paymentTypes,
{* Counties *}
{$ui = [
- 'value' => $smarty.request.counties,
+ 'value' => $smarty.request.counties|default:'',
'field' => 'counties',
'label' => 'Counties',
'list' => $counties,
{* Member Name *}
{$ui = [
- 'value' => $smarty.request.member_name,
+ 'value' => $smarty.request.member_name|default:'',
'field' => 'member_name',
'label' => 'Member Name',
'required' => false,
{if isset( $settings.account_number_enabled ) && $settings.account_number_enabled}
{* Account Number *}
{$ui = [
- 'value' => $smarty.request.account_number,
+ 'value' => $smarty.request.account_number|default:'',
'field' => 'account_number',
'label' => 'Account Number',
'required' => false,
{* From *}
{$ui = [
- 'value' => $smarty.request.from_date,
+ 'value' => $smarty.request.from_date|default:'',
'field' => 'from_date',
'label' => 'From',
'required' => false,
{* To *}
{$ui = [
- 'value' => $smarty.request.to_date,
+ 'value' => $smarty.request.to_date|default:'',
'field' => 'to_date',
'label' => 'To',
'required' => false,
<div class="cell small-12 medium-auto">
{* Transaction Types *}
{$ui = [
- 'value' => $smarty.request.transactionTypes,
+ 'value' => $smarty.request.transactionTypes|default:'',
'field' => 'transactionTypes',
'label' => 'Transaction Types',
'list' => $actionTypeSel,
</fieldset>
{/if}
+
{if $option == 'accountsByAge'}
<h3>over 60 days</h3>
{/if}
+
<br clear="all">
<br clear="all">
<p>Total found: <span class="label">{$totalAccounts}</span></p>
+
{* Paging *}
{if $paging}
<input type="Submit" name="pageSelect" value="Previous {$limit} Reports" class="button button-secondary glm-button"{if !$prevStart} disabled{/if}>
<input type="Submit" name="pageSelect" value="Next {$limit} Reports" class="button button-secondary glm-button"{if !$nextStart} disabled{/if}>
{/if}
<br clear="all">
+
{if isset( $accounts ) && !empty( $accounts )}
<div id="account-list">
<table class="stack glm-admin-table-inner">
</table>
</div>
{/if}
+
{* Paging *}
{if $paging}
<input type="submit" name="pageSelect" value="Previous {$limit} Reports" class="button button-secondary glm-button"{if !$prevStart} disabled{/if}>
{if $option == 'reportGenerator'}
<div class="report-totals">
- <div class="total-invoices">Total Invoices: <span>{$totalInvoices}</span></div>
- <div class="total-payments">Total Payments: <span>{$totalPayments}</span></div>
+ <div class="total-invoices">Total Invoices: <span>{$totalInvoices|default:'$0.00'}</span></div>
+ <div class="total-payments">Total Payments: <span>{$totalPayments|default:'$0.00'}</span></div>
</div>
{/if}
$('#report_search').on( 'click', function(e){
// e.preventDefault();
var formData = $('#reports-form select, input.reportForm').serialize();
- console.log( 'Form Data:', formData );
// Check if the Export as CSV file was checked.
if ( $('#qif:checked').length ) {
- console.log( 'exportCSV: ON' );
window.location = '{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=exportQIF&' + formData;
return false;
} else {
</div>
</div>
-<script src="{$jsUrl}/PrintArea/jquery.PrintArea.js" type="text/JavaScript" language="javascript"></script>
+<script src="{$jsUrl}/PrintArea/jquery.PrintArea.js"></script>
<script>
jQuery(document).ready(function($) {
$(".graph-print").click(function(){
- <script type="text/javascript">
+<script>
- jQuery(document).ready(function($) {
+ jQuery(document).ready(function($) {
- /*
- * Edit area tabs
- */
- // Flash certain elements for a short time after display
- $(".glm-flash-updated").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
-
- if('{literal}{$registrationsSettings.fieldData.calendar_view}{/literal}'){
- $("#calendar-view").val('{literal}{$registrationsSettings.fieldData.calendar_view}{/literal}');
- } else {
- $("#calendar-view").val("agenda");
- }
- });
- </script>
+ /*
+ * Edit area tabs
+ */
+ // Flash certain elements for a short time after display
+ $(".glm-flash-updated").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
+
+ if('{literal}{$registrationsSettings.fieldData.calendar_view}{/literal}'){
+ $("#calendar-view").val('{literal}{$registrationsSettings.fieldData.calendar_view}{/literal}');
+ } else {
+ $("#calendar-view").val("agenda");
+ }
+ });
+</script>
</tr>
</table>
-<script type="text/javascript">
+<script>
jQuery(document).ready(function($) {
</tbody>
</table>
-<script type="text/javascript">
+<script>
jQuery(document).ready(function($) {
$("#newInvoiceTypeDialog").dialog({
</tbody>
</table>
-<script type="text/javascript">
+<script>
jQuery(document).ready(function($) {
$("#deleteNotificationTypeDialog").dialog({
$('.payment_option').change(function(){
var payment_option = $('.payment_option:checked').val();
- // console.log( 'payment_option: ', payment_option );
if ( payment_option == 'pay_by_check' ) {
{if $billing_settings.proc_methods == 4}
$('.sq-payment-form').hide();
$('.payment_option').change(function(){
var payment_option = $('.payment_option:checked').val();
- console.log( 'payment_option: ', payment_option );
if ( payment_option == 'pay_by_check' ) {
$('.glm-billing-credit').hide();
$('.ccard').prop('disabled', true);
'invoice_number': $(this).val(),
}
}).done(function(msg){
- console.log( 'msg', msg );
if ( msg.status === false ) {
alert( 'Not a valid Account #' );
$('#invoice_number').val('');
return false;
}
if ( msg.status ) {
- // console.log( 'invoice_type', msg.invoice_type );
$('#member_renewing').data( 'amount', msg.invoice.amount_total );
$('#member_renewing').val( msg.invoice_type );
// $('#invoice_type_id_' + msg.invoice_type ).attr('checked', true);
'invoice_number': $(this).val(),
}
}).done(function(msg){
- console.log( 'msg', msg );
if ( msg.status === false ) {
alert( 'Not a valid Account #' );
$('#invoice_number').val('');
$('#member_id').val( msg.member_id );
if ( msg.invoice_type ) {
// $('input[name=member_renewing]').prop('checked', false);
- console.log( 'invoice_type', msg.invoice_type );
$('#invoice_type_id_' + msg.invoice_type ).attr('checked', true);
getPageTotal();
}
$('input[name=member_renewing]:first').prop( 'checked', true );
}
- // console.log( 'member_renewing_amount', member_renewing_amount );
// Get each employee and add their amounts.
$('input[name^=employees]').each(function(){