From: Steve Sutton Date: Mon, 22 Apr 2019 19:28:04 +0000 (-0400) Subject: Updating invoice id search on invoices page. X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=ff410df4337fe25dfef02d24cbc7cff9ed1367b6;p=WP-Plugins%2Fglm-member-db-billing.git Updating invoice id search on invoices page. Correct how the autocomplete is working. --- diff --git a/models/admin/billing/invoices.php b/models/admin/billing/invoices.php index 55fd69b..eee71a4 100644 --- a/models/admin/billing/invoices.php +++ b/models/admin/billing/invoices.php @@ -586,7 +586,8 @@ class GlmMembersAdmin_billing_invoices extends GlmDataInvoices case 'list': default: - // echo '
'.print_r( $_REQUEST, true ).'
'; + // echo '
'.print_r( $_REQUEST, true ).'
'; + // Need to get the accounts $Accounts = new GlmDataAccounts( $this->wpdb, $this->config ); $accounts = $Accounts->getSimpleAccountList(); diff --git a/views/admin/billing/invoices.html b/views/admin/billing/invoices.html index 3a84e78..72be142 100644 --- a/views/admin/billing/invoices.html +++ b/views/admin/billing/invoices.html @@ -234,6 +234,7 @@ {/foreach} ] + {* accounts for the search *} $('#account_name').autocomplete({ source: availableAccounts, select: function( event, ui ){ @@ -248,6 +249,7 @@ }, }); + {* Invoices for the search *} var availableInvoices = [ {foreach $invoiceList as $m} { label: "{$m.id} ( {$m.member_name|unescape:'html'|replace:'"':''} )", value: "{$m.id|unescape:'html'|replace:'"':''}", id: '{$m.id}' }, @@ -257,11 +259,14 @@ source: availableInvoices, select: function( event, ui ){ $('#member-invoice-id').val( ui.item.id ); + $('#invoice_id').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(); } },