Fix invoices printing
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 9 May 2019 19:59:30 +0000 (15:59 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 9 May 2019 19:59:30 +0000 (15:59 -0400)
also fix filter on labels page

lib/GlmPDFInvoice.php
models/admin/billing/invoicing.php

index ed29876..aab4a66 100644 (file)
@@ -112,6 +112,7 @@ class GlmPDFInvoice extends Cezpdf
             // Right header for date and account #
             $this->ezSetY( $companyNameSaveY );
 
+            $invoiceData = array();
             // Add the Date of invoice and the member account number using ezTable.
             $invoiceData[] = array(
                 'header' => 'Date:', 'value'  => date( 'm/d/Y', strtotime( $invoice['due_date'] ) ), 'headerFill' => $this->color_white, 'valueFill' => $this->color_white
@@ -371,6 +372,7 @@ class GlmPDFInvoice extends Cezpdf
                 $newY = $this->ezText( '', $this->pdf_font_size );
                 $newY = $this->addText( 375, $newY, 14, '<b>NO PAYMENT REQUIRED</b>' );
             }
+            $paymentForm3 = array();
             if ( $showAccountNumber ) {
                 $paymentForm3[] = array( 'header' => '<b>'.$accountNumberLabel . ':</b>', 'value' => $account['account_number'] );
             }
index 4e63ef4..0b9e619 100644 (file)
@@ -140,7 +140,7 @@ class GlmMembersAdmin_billing_invoicing //extends GlmDataAccounts
                 SELECT account
                   FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX  . "invoices
                  WHERE $notPaid ) ";
-            $wParts[] = " ( T.usmail_invoice OR T.fax_invoice ) ";
+            $wParts[] = " ( T.usmail_invoice = true OR T.fax_invoice = true ) ";
             break;
 
         case 'createLabels':
@@ -150,11 +150,11 @@ class GlmMembersAdmin_billing_invoicing //extends GlmDataAccounts
                       FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX  . "invoices
                      WHERE $notPaid ) ";
             } else {
-                $wParts[] = " T.id IN (
-                    SELECT account
-                      FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX  . "invoices) ";
+                // $wParts[] = " T.id IN (
+                //     SELECT account
+                //       FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX  . "invoices) ";
             }
-            $wParts[] = " ( T.usmail_invoice OR T.fax_invoice ) ";
+            $wParts[] = " ( T.usmail_invoice = true OR T.fax_invoice = true ) ";
             break;
 
         case 'createInvoices':