Add filter for show only unpaid invoices.
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 13 Sep 2018 14:13:43 +0000 (10:13 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 13 Sep 2018 14:13:43 +0000 (10:13 -0400)
Adding this to the admin billing invoices page.

models/admin/billing/invoices.php
views/admin/billing/invoices.html

index 60a7d0e..b45718e 100644 (file)
@@ -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";
index efd76ad..8b607b1 100644 (file)
                     <input id="member-account" type="hidden" name="filterAccounts" value="{$filterAccounts}">
                     <input id="account_name" name="searchName" value="" />
                 </span>
+            <br>
+                <span class="glm-nowrap">
+                    <input type="checkbox" name="filterUnpaid"{if $smarty.request.filterUnpaid} checked{/if}>
+                    <b>Show only Unpaid Invoices</b>
+                </span>
             <br>
                 <span class="glm-nowrap">
                     <input type="submit" value="Submit">