From: Steve Sutton Date: Thu, 13 Sep 2018 14:13:43 +0000 (-0400) Subject: Add filter for show only unpaid invoices. X-Git-Tag: v1.0.10^2~4 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=542a89497f9efc97c718cc1107f98efc2e07ae7e;p=WP-Plugins%2Fglm-member-db-billing.git Add filter for show only unpaid invoices. Adding this to the admin billing invoices page. --- diff --git a/models/admin/billing/invoices.php b/models/admin/billing/invoices.php index 60a7d0e..b45718e 100644 --- a/models/admin/billing/invoices.php +++ b/models/admin/billing/invoices.php @@ -435,6 +435,12 @@ class GlmMembersAdmin_billing_invoices extends GlmDataInvoices WHERE ref_name like '%" . esc_sql( $searchName ) . "%')"; } + if ( isset( $_REQUEST['filterUnpaid'] ) ) { + $filterUnpaid = filter_var( $_REQUEST['filterUnpaid'], FILTER_VALIDATE_BOOLEAN ); + if ( $filterUnpaid ) { + $where_params[] = "T.paid <> true"; + } + } if ( isset( $_REQUEST['filterPending'] ) ) { $filterPending = filter_var( $_REQUEST['filterPending'], FILTER_VALIDATE_BOOLEAN ); $where_params[] = "T.paid <> true"; diff --git a/views/admin/billing/invoices.html b/views/admin/billing/invoices.html index efd76ad..8b607b1 100644 --- a/views/admin/billing/invoices.html +++ b/views/admin/billing/invoices.html @@ -25,6 +25,11 @@ +
+ + + Show only Unpaid Invoices +