Updating search forms for payment and invoice page.
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 1 Aug 2019 20:33:57 +0000 (16:33 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 1 Aug 2019 20:33:57 +0000 (16:33 -0400)
Also updating member contact login view.

models/admin/billing/payments.php
views/admin/billing/invoices.html
views/admin/billing/memberBillingSubHeader.html
views/admin/billing/payments.html
views/admin/billing/statements.html

index fdcf44f..e84a14f 100644 (file)
@@ -231,6 +231,8 @@ class GlmMembersAdmin_billing_payments extends GlmDataPayments
             $where = 'true';
             $where_params = array( 'true' );
 
+            // echo '<pre>$_REQUEST: ' . print_r( $_REQUEST, true ) . '</pre>';
+
             // Check if we're doing paging
             if (isset($_REQUEST['pageSelect'])) {
                 // If request is for Next
@@ -250,7 +252,7 @@ class GlmMembersAdmin_billing_payments extends GlmDataPayments
             // Get any search parameters.
             $reg_options = array(
                 'options' => array(
-                    'regexp' => '%[0-9]{2}/[0-9]{2}/[0-9]{4}%'
+                    'regexp' => '%[0-9]{4}-[0-9]{2}-[0-9]{2}%'
                 )
             );
             if ( isset( $_REQUEST['fromDate'] ) && $_REQUEST['fromDate']
index 1ee10ab..48d6f19 100644 (file)
     <legend>Search Invoices</legend>
     <div class="grid-container full">
         <div class="grid-x grid-padding-x">
-            <div class="cell small-12 medium-4">
-                <div class="grid-x grid-padding-x">
-                    {* From Date *}
-                    {$ui = [
-                        'value'       => $fromDate|default:'',
-                        'field'       => 'fromDate',
-                        'label'       => 'From Date',
-                        'required'    => false,
-                        'errorText'   => 'From Date is Required',
-                        'dataError'   => ''
-                    ]}
-                    {include file='ui/f6/date.html'}
-
-                    {* To Date *}
-                    {$ui = [
-                        'value'       => $toDate|default:'',
-                        'field'       => 'toDate',
-                        'label'       => 'To Date',
-                        'required'    => false,
-                        'errorText'   => 'To Date is Required',
-                        'dataError'   => ''
-                    ]}
-                    {include file='ui/f6/date.html'}
-                </div>
-            </div>
             <div class="cell small-12 medium-4">
                 <div class="grid-x grid-margin-x">
 
                     {include file='ui/f6/text.html'}
                 </div>
             </div>
+            <div class="cell small-12 medium-4">
+                <div class="grid-x grid-padding-x">
+                    {* From Date *}
+                    {$ui = [
+                        'value'       => $fromDate|default:'',
+                        'field'       => 'fromDate',
+                        'label'       => 'From Date',
+                        'required'    => false,
+                        'errorText'   => 'From Date is Required',
+                        'dataError'   => ''
+                    ]}
+                    {include file='ui/f6/date.html'}
+
+                    {* To Date *}
+                    {$ui = [
+                        'value'       => $toDate|default:'',
+                        'field'       => 'toDate',
+                        'label'       => 'To Date',
+                        'required'    => false,
+                        'errorText'   => 'To Date is Required',
+                        'dataError'   => ''
+                    ]}
+                    {include file='ui/f6/date.html'}
+                </div>
+            </div>
             <div class="cell small-12 medium-4">
                 <div class="grid-x grid-margin-x">
                     {* Show only Unpaid Invoices *}
                                     data-account="{$t.account.value}"
                                     data-member_name="{$t.member_name}"
                                     >Send Invoice</a> |
-                                {if $billing_settings.uptravel_payment_form}
+                                {* if $billing_settings.uptravel_payment_form *}
                                     <a
                                         class="make-a-payment"
                                         id="make-a-payment-{$t.id}"
                                         data-member="{$t.member_id}"
                                         href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=billing&option=makepaymentadjustment&member={$t.member_id}">Make A Payment</a> |
-                                {else}
+                                {else}
                                     <a
                                         class="pay-invoice"
                                         id="pay-invoice-{$t.id}"
                                         data-member="{$t.member_id}"
                                         href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=billing&option=makepayment&member={$t.member_id}">Pay Invoice</a> |
-                                {/if}
+                                {/if *}
                             {/if}
                         </span>
                         <span class="account-dashboard-link">
             source: availableInvoices,
             select: function( event, ui ){
                 $('#member-invoice-id').val( ui.item.id );
+                $('#searchName').val( ui.item.label );
                 $('#searchInvoice').val( ui.item.id );
                 $('#searchForm').submit();
             },
index e964c50..2ab9758 100644 (file)
@@ -28,7 +28,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}
+                {if !$lockedToMember && 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 3cfa561..140615b 100644 (file)
     <div class="grid-container full">
         <div class="grid-x grid-padding-x">
             <div class="cell small-12 medium-3">
-                <b>From Date: </b><input type="text" name="fromDate" value="{$fromDate}" class="glm-form-text-input-short glm-date-input">
+                <div class="grid-x grid-padding-x">
+
+                    {* Used for autocomplete *}
+                    <input id="member-account" type="hidden" name="filterAccounts" value="{$filterAccounts|default:''}">
+
+                    {* Member Account *}
+                    {$ui = [
+                        'value'       => $smarty.request.searchName|default:'',
+                        'field'       => 'searchName',
+                        'label'       => 'Member Account',
+                        'required'    => false,
+                        'errorText'   => 'Member Account is Required',
+                        'dataError'   => ''
+                    ]}
+                    {include file='ui/f6/text.html'}
+                </div>
+
+                <b>Member Account:&nbsp;</b>
             </div>
             <div class="cell small-12 medium-3">
-                <b>To Date: </b><input type="text" name="toDate" value="{$toDate}" class="glm-form-text-input-short glm-date-input">
+                <div class="grid-x grid-padding-x">
+                    {* From Date *}
+                    {$ui = [
+                        'value'       => $fromDate|default:'',
+                        'field'       => 'fromDate',
+                        'label'       => 'From Date',
+                        'required'    => false,
+                        'errorText'   => 'From Date is Required',
+                        'dataError'   => ''
+                    ]}
+                    {include file='ui/f6/date.html'}
+                </div>
             </div>
             <div class="cell small-12 medium-3">
-                <b>Member Account:&nbsp;</b>
-                <input id="member-account" type="hidden" name="filterAccounts" value="{$filterAccounts}">
-                <input id="account_name" type="text" name="searchName" value="{if $searchName}{$searchName}{/if}" />
+                <div class="grid-x grid-padding-x">
+                    {* To Date *}
+                    {$ui = [
+                        'value'       => $toDate|default:'',
+                        'field'       => 'toDate',
+                        'label'       => 'To Date',
+                        'required'    => false,
+                        'errorText'   => 'To Date is Required',
+                        'dataError'   => ''
+                    ]}
+                    {include file='ui/f6/date.html'}
+                </div>
             </div>
+
             <div class="cell small-12">
                 <input class="button primary" type="submit" value="Submit">
             </div>
         });
 
         // Date Input
-        $('.glm-date-input').datepicker({
-            dateFormat: 'mm/dd/yy'
-        });
+        //$('.glm-date-input').datepicker({
+        //    dateFormat: 'mm/dd/yy'
+        //});
 
         var availableAccounts = [
         {foreach $allAccounts as $m}
         ]
 
         // Setup autocomplete for both inputs
-        $('#account_name').autocomplete({
+        $('#searchName').autocomplete({
             source: availableAccounts,
             select: function( event, ui ){
                 $('#member-account').val( ui.item.id );
+                $('#searchName').val( ui.item.label );
                 $('#searchForm').submit();
             },
             change: function( event, ui) {
index 46e6111..2514a07 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 $billing_settings.uptravel_payment_form}
+                        {if $adminAjaxPassthru || ( $billing_settings.uptravel_payment_form && !$lockedToMember )}
                             {if $transaction.transaction_data.paid}&nbsp;{else}<a class="makeAPayment" data-member="{$memberID}" 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 class="payInvoice" data-member="{$memberID}" href="{$thisUrl}?page={$thisPage}&glm_action=billing&option=makepayment&member={$memberID}">Pay Invoice</a>{/if}