From: Steve Sutton Date: Mon, 11 Feb 2019 18:34:30 +0000 (-0500) Subject: Fix some setting issues X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=50b77af26529d4168e5c196cf406ffa54b8a4952;p=WP-Plugins%2Fglm-member-db-billing.git Fix some setting issues Fix required fields fix print and view links --- diff --git a/classes/data/dataAccounts.php b/classes/data/dataAccounts.php index c162442..ea64078 100644 --- a/classes/data/dataAccounts.php +++ b/classes/data/dataAccounts.php @@ -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 diff --git a/lib/GlmPDFInvoice.php b/lib/GlmPDFInvoice.php index 4efe82b..0c5f3b9 100644 --- a/lib/GlmPDFInvoice.php +++ b/lib/GlmPDFInvoice.php @@ -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 .= ''; - // 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 .= ''; + // // 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( diff --git a/views/admin/billing/invoices.html b/views/admin/billing/invoices.html index 25ad124..6f97695 100644 --- a/views/admin/billing/invoices.html +++ b/views/admin/billing/invoices.html @@ -80,7 +80,7 @@ Edit |