Fix some setting issues
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 11 Feb 2019 18:34:30 +0000 (13:34 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 11 Feb 2019 18:34:30 +0000 (13:34 -0500)
Fix required fields
fix print and view links

classes/data/dataAccounts.php
lib/GlmPDFInvoice.php
views/admin/billing/invoices.html

index c162442..ea64078 100644 (file)
@@ -115,13 +115,14 @@ class GlmDataAccounts extends GlmDataAbstract
 
         }
 
-        $billingNameFieldsRequired = false;
-        $billingFieldsRequired     = $this->config['settings']['billing_fields_required'];
-        $billingContactNameEnabled = $this->config['settings']['billing_contact_name_enabled'];
+        $billingNameFieldsRequired  = false;
+        $billingContactNameRequired = false;
+        $billingFieldsRequired      = $this->config['settings']['billing_fields_required'];
+        $billingContactNameEnabled  = $this->config['settings']['billing_contact_name_enabled'];
         if ( $billingFieldsRequired && $billingContactNameEnabled ) {
-            $billingNameFieldsRequired = false;
-        } else if ( $billingFieldsRequired ) {
-            $billingNameFieldsRequired = true;
+            $billingContactNameRequired = true;
+        } else if ( $billingFieldsRequired && !$billingContactNameEnabled ) {
+            $billingNameFieldsRequired  = true;
         }
 
         /*
@@ -270,7 +271,7 @@ class GlmDataAccounts extends GlmDataAbstract
                 'field'    => 'billing_contact_name',
                 'type'     => 'text',
                 'use'      => 'a',
-                'required' => $billingFieldsRequired,
+                'required' => $billingContactNameRequired,
             ),
 
             // Billing First Name
index 4efe82b..0c5f3b9 100644 (file)
@@ -276,18 +276,18 @@ class GlmPDFInvoice extends Cezpdf
                 ),
                 $this->pdf_font_size
             );
-            $barCodeText = $account['account_number'] . '-' . $invoice['id'];
-            // $barCodeText = $account['account_number'] . '-3013';
-            $code39RECT = $this->code39($barCodeText, 1, 30, 0, -5);
-            $barcode = '';
-            $MAXcodeWidth = 0;
-            foreach ($code39RECT as $v) {
-                $barcode .= '<C:rect:'.implode(',', $v).'>';
-                // x position + width
-                if (($v['x'] + $v['b']) > $MAXcodeWidth) {
-                    $MAXcodeWidth = $v['x'] + $v['b'];
-                }
-            }
+            // $barCodeText = $account['account_number'] . '-' . $invoice['id'];
+            // // $barCodeText = $account['account_number'] . '-3013';
+            // $code39RECT = $this->code39($barCodeText, 1, 30, 0, -5);
+            // $barcode = '';
+            // $MAXcodeWidth = 0;
+            // foreach ($code39RECT as $v) {
+            //     $barcode .= '<C:rect:'.implode(',', $v).'>';
+            //     // x position + width
+            //     if (($v['x'] + $v['b']) > $MAXcodeWidth) {
+            //         $MAXcodeWidth = $v['x'] + $v['b'];
+            //     }
+            // }
             $this->ezSetY( 130 );
             // $this->ezText( $barcode, $this->pdf_font_size, array( 'aright' => 335, 'justification' => 'right' ) );
             $barCode = array(
index 25ad124..6f97695 100644 (file)
@@ -80,7 +80,7 @@
                                     <a href="{$adminUrl}?page=glm-members-admin-menu-billing&glm_action=invoices&option=edit&id={$t.id}">Edit</a> |
                                 </span>
                                 <span class="account-dashboard-link">
-                                    {if isset( $billing_settings.invoice_pdf_enabled ) && $billing_settings.invoice_pdf_enabled}
+                                    {if isset( $settings.invoice_pdf_enabled ) && $settings.invoice_pdf_enabled}
                                         <a href="{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=createPDFInvoice&id={$t.id}">Print</a> |
                                     {else}
                                         <a href="{$thisUrl}?page={$thisPage}&glm_action=invoices&option=view&id={$t.id}">View</a> |
@@ -90,7 +90,7 @@
                                     {if $t.paid.value}
                                         &nbsp;
                                     {else}
-                                        {if isset( $billing_settings.uptravel_payment_form ) && $billing_settings.uptravel_payment_form}
+                                        {if isset( $settings.uptravel_payment_form ) && $settings.uptravel_payment_form}
                                             <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=billing&option=makepaymentadjustment&member={$t.member_id}">Make A Payment</a> |
                                         {else}
                                             <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=billing&option=makepayment&member={$t.member_id}">Pay Invoice</a> |