Fix for uptra to show create invoice link in member billing tab.
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 17 May 2019 13:46:20 +0000 (09:46 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 17 May 2019 13:46:20 +0000 (09:46 -0400)
Should show up for members that don't have an invoice.

models/admin/billing/invoicing.php
setup/commonHooks.php
views/admin/billing/memberBillingSubHeader.html
views/admin/billing/statements.html

index 8cefd29..c0a296c 100644 (file)
@@ -175,10 +175,12 @@ class GlmMembersAdmin_billing_invoicing //extends GlmDataAccounts
                   FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "invoice_types
                  WHERE dynamic_amount = true
             ) ";
+            // echo '<pre>$wParts: ' . print_r( $wParts, true ) . '</pre>';
 
             if ( $option2 ) {
                 // $where used in all places.
                 $where    = implode( ' AND ', $wParts );
+                // echo '<pre>$where: ' . print_r( $where, true ) . '</pre>';
                 $accounts = $Accounts->getSimpleAccountList( $where );
 
                 foreach ( $accounts as $account ) {
index 533bd2c..7ece7ae 100644 (file)
@@ -122,7 +122,7 @@ add_filter( 'glm-billing-account-has-invoice', function( $content, $account_id )
                   WHERE account = %d
                     AND due_date BETWEEN %s and %s",
                 $account_id,
-                date( 'Y-m-d' , $currentInvoiceDate ),
+                date( 'Y-m-d', $currentInvoiceDate ),
                 date( 'Y-m-d', $nextInvoiceDate )
             )
         );
index 2f94d74..aacf59e 100644 (file)
@@ -27,7 +27,7 @@
                     <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=billing&member={$memberID}&option=renew" class="">Membership Renewal</a>
                 </li>
             {/if}
-            {if isset( $billing_settings.uptravel_payment_form ) && $billing_settings.uptravel_payment_form && $accountID && !$fromMemberMenu}
+            {if isset( $billing_settings.uptravel_payment_form ) && $billing_settings.uptravel_payment_form && $accountID}
                 {$hasInvoice = apply_filters('glm-billing-account-has-invoice', false, $accountID )}
                 <li>
                     {if $hasInvoice}
index b9fd3f2..991dca0 100644 (file)
                         <td class="glm-shrink">${$transaction.transaction_data.amount_total}</td>
                         <td class="glm-shrink">${$transaction.transaction_data.balance}</td>
                         <td class="glm-shrink">
-                        {if isset( $billing_settings.uptravel_payment_form ) && $billing_settings.uptravel_payment_form && !$fromMemberMenu}
+                        {if isset( $billing_settings.uptravel_payment_form ) && $billing_settings.uptravel_payment_form}
                             {if $transaction.transaction_data.paid}&nbsp;{else}<a href="{$thisUrl}?page={$thisPage}&glm_action=billing&option=makepaymentadjustment&member={$memberID}">Make A Payment</a>{/if}
                         {else}
                             {if $transaction.transaction_data.paid}&nbsp;{else}<a href="{$thisUrl}?page={$thisPage}&glm_action=billing&option=makepayment&member={$memberID}">Pay Invoice</a>{/if}