From 121bf42cfed30e6595d204ade537d489b6254bc7 Mon Sep 17 00:00:00 2001 From: Marco Valente Date: Thu, 2 Jul 2015 12:33:55 +0100 Subject: [PATCH] CRM-16789 Invoice attachements when tax rate is 0 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 | 2 +- CRM/Event/BAO/Event.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Contribute/BAO/ContributionPage.php b/CRM/Contribute/BAO/ContributionPage.php index c7847bbd82..3c0a4efd34 100644 --- a/CRM/Contribute/BAO/ContributionPage.php +++ b/CRM/Contribute/BAO/ContributionPage.php @@ -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']; } diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 84c64b4bfa..a6cfb64738 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -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']; } -- 2.25.1