Updating reports and invoicing
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 13 Dec 2018 16:45:06 +0000 (11:45 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 13 Dec 2018 16:45:06 +0000 (11:45 -0500)
Working on list output for open accounts.

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

index d208984..1f2377b 100644 (file)
@@ -90,7 +90,7 @@ class GlmMembersAdmin_billing_reports extends GlmDataTransactions
     {
 
         $haveAccounts  = false;
-        $option        = 'list';
+        $option        = 'openAccounts';
         $view          = 'reports';
         $wParts        = array( 'true' );
         $paymentTypes  = false;
@@ -139,8 +139,13 @@ class GlmMembersAdmin_billing_reports extends GlmDataTransactions
         // Do selected option
         switch ($option) {
 
-        case 'list':
+        case 'openAccounts':
         default:
+            $wParts[] = "T.id IN (
+                SELECT account
+                  FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "invoices
+                 WHERE balance > 0.00
+                )";
             $view = 'reports';
             break;
 
index c5a139a..64b86c0 100644 (file)
@@ -68,7 +68,7 @@
             {if $haveInvoices}
                 {foreach $invoices as $t}
                     <tr class="glm-invoice-row{if $t@iteration is div by 2} alternate{/if}" data-id="{$t.id}">
-                        <td> <a href="{$adminUrl}?page=glm-members-admin-menu-member&glm_action=billing&member={$t.member_id}">{$t.member_name}</a> </td>
+                        <td> <a href="{$adminUrl}?page=glm-members-admin-menu-member&glm_action=billing&member={$t.member_id}"><b>{$t.member_name}</b></a> </td>
                         <td>
                         {foreach $t.line_items as $item}
                             {$item.name} {if $item.recurring && $item.recurrence_string}( {$item.recurrence_string} ){/if}
index 5f38cea..a48a860 100644 (file)
                     </select>
                 </div>
             {/if}
-            {if $option == 'createLabels'}
-                <div style="width:300px;float:left;">
-                    <br>
-                    <label>
-                        <input class="labelOption" type="checkbox" name="only_payment_due"{if isset($smarty.request.only_payment_due) && $smarty.request.only_payment_due} checked{/if}>
-                        Only Payments Due<br>
-                    </label>
-                    <label>
-                        <input id="exportCSV" type="checkbox" name="export_file"{if isset($smarty.request.export_file) && $smarty.request.export_file} checked{/if}>
-                        Export as CSV File<br>
-                    </label>
-                    <label>
-                        <input class="labelOption" type="checkbox" name="no_contact_name"{if isset($smarty.request.no_contact_name) && $smarty.request.no_contact_name} checked{/if}>
-                        Remove Member Billing Contact<br>
-                    </label>
-                </div>
-            {/if}
             <div style="width:400px; height: 30px;">
-                <input type="submit" value="Filter">
-                {if $option == 'createInvoices'}
-                    <input type="submit" name="submitType" value="Create Invoices" onClick="return( confirm( 'Are you Sure?' ) );">
-                {elseif $option == 'printInvoices'}
-                    <input id="print-invoices" type="submit" name="submitType" value="Print Invoices">
-                {elseif $option == 'createLabels'}
-                    <input id="create-labels" type="submit" name="submitType" value="Create Labels">
-                {/if}
+                <input type="submit" value="Search">
             </div>
         </div>
     {/if}