From ff410df4337fe25dfef02d24cbc7cff9ed1367b6 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 22 Apr 2019 15:28:04 -0400 Subject: [PATCH] Updating invoice id search on invoices page. Correct how the autocomplete is working. --- models/admin/billing/invoices.php | 3 ++- views/admin/billing/invoices.html | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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(); } }, -- 2.17.1