$viewFile = 'admin/notifications/notification.html';
if ( !$test ) {
+ $defaultContactData = array(
+ 'org' => '',
+ 'business_fname' => '',
+ 'business_lname' => '',
+ 'title' => '',
+ 'business_addr1' => '',
+ 'business_addr2' => '',
+ 'business_city' => '',
+ 'business_state' => array( 'value' => '' ),
+ 'business_zip' => '',
+ 'business_email' => '',
+ 'business_phone' => '',
+ 'office_phone' => '',
+ 'business_mobile' => '',
+ 'fax' => '',
+ );
// Get Contact Data
$contactData = apply_filters( 'glm-member-db-contacts-get-contact-data-by-refdest', $account['ref_dest'] );
if ( !$contactData ) {
);
}
+ $contactData = array_merge( $defaultContactData, $contactData );
+
$account_data = array(
'account' => array(
'name' => $account['ref_name'],
// TODO: get invoices (array) of data and send back
// Need to know which invoices were effected with payment.
if ( !empty( $invoices ) ) {
- $invoiceData = array_map( $BillingSupport->getInvoiceById, $invoices );
+ $invoiceData = array_map( array( $BillingSupport, 'getInvoiceById' ), $invoices );
}
$return = array(
'payment_id' => $payment_id,
'errorText' => 'Recurrence is Required',
'dataError' => $data.fieldFail.recurrence
]}
+ {if $data.fieldData.recurring.value}
+ {$ui['required'] = true}
+ {/if}
{include file='ui/f6/select.html'}
complete: completeAjax,
}).done(function(resp){
$modalPayment.html(resp).foundation('open').trigger('resizeme.zp.reveal');
- $modalPayment.on('closed.zf.reveal', function(){
- $('#glmBillingPayment').foundation('_destroy');
- $('.glm-foundation-6-ui').append(
- '<div id="glmBillingPayment" class="medium reveal" data-reveal data-close-on-click="false"></div>'
- );
- var elem = new Foundation.Reveal($('#glmBillingPayment'));
- });
});
return false;
});
var $sucessModal = $('#billingSuccess');
$sucessModal.foundation('open').trigger('resizeme.zp.reveal');
// TODO: Need to refresh the page or the section for this invoice.
- console.log( 'rsp:', rsp );
+ if ( rsp.invoices.length > 0 ) {
+ // Loop over the invoices and update the ones if found on this page.
+ for ( var i in rsp.invoices ) {
+ // Update the balance due
+ $('#balance-' + rsp.invoices[i].id ).html( rsp.invoices[i].balance );
+ // If the invoices is marked 'Paid' then remove the make payment
+ // or pay invoices links and the send invoices line
+ if ( rsp.invoices[i].paid ) {
+ $('#make-a-payment-' + rsp.invoices[i].id).remove();
+ $('#pay-invoice-' + rsp.invoices[i].id).remove();
+ $('#send-invoice-' + rsp.invoices[i].id).remove();
+ }
+ }
+ }
return true;
} else {
return false;
<br clear="all">
-<p>Total found: <span class="label">{$numbDisplayed}</span></p>
+<p>Total found: <span class="label">{$numbDisplayed|default:'0'}</span></p>
{if $paging}
<input type="Submit" name="pageSelect" value="Previous {$limit} Accounts" class="button button-secondary glm-button"{if !$prevStart} disabled{/if}>
<input type="Submit" name="pageSelect" value="Next {$limit} Accounts" class="button button-secondary glm-button"{if !$nextStart} disabled{/if}>