CRM-16789 Invoice attachements when tax rate is 0
authorMarco Valente <marco@compucorp.co.uk>
Thu, 2 Jul 2015 11:33:55 +0000 (12:33 +0100)
committerMarco Valente <marco@compucorp.co.uk>
Thu, 2 Jul 2015 11:33:55 +0000 (12:33 +0100)
Correcting the issue: Event or contribution payment invoices is not being sent when
the tax amount is 0 or evaluates to false.

CRM/Contribute/BAO/ContributionPage.php
CRM/Event/BAO/Event.php

index c7847bbd82e9a5a9c8d7931227e48ebfa6c901cb..3c0a4efd3447783be9993db7e3cb7c25ddb47750 100644 (file)
@@ -405,7 +405,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio
         $taxAmt = $template->get_template_vars('dataArray');
         $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
         $invoicing = CRM_Utils_Array::value('invoicing', $prefixValue);
-        if (count($taxAmt) > 0 && (isset($invoicing) && isset($prefixValue['is_email_pdf']))) {
+        if (isset($invoicing) && isset($prefixValue['is_email_pdf'])) {
           $sendTemplateParams['isEmailPdf'] = TRUE;
           $sendTemplateParams['contributionId'] = $values['contribution_id'];
         }
index 84c64b4bfa08867af47781d43dc13f964072d222..a6cfb6473891f274789f8403c9bd99d8821b6922 100644 (file)
@@ -1246,7 +1246,7 @@ WHERE civicrm_event.is_active = 1
           $taxAmt = $template->get_template_vars('totalTaxAmount');
           $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
           $invoicing = CRM_Utils_Array::value('invoicing', $prefixValue);
-          if ($taxAmt && (isset($invoicing) && isset($prefixValue['is_email_pdf']))) {
+          if (isset($invoicing) && isset($prefixValue['is_email_pdf'])) {
             $sendTemplateParams['isEmailPdf'] = TRUE;
             $sendTemplateParams['contributionId'] = $values['contributionId'];
           }