Move tpl assignment to email function
authoreileen <emcnaughton@wikimedia.org>
Fri, 26 Mar 2021 03:26:06 +0000 (16:26 +1300)
committereileen <emcnaughton@wikimedia.org>
Thu, 8 Apr 2021 23:58:39 +0000 (11:58 +1200)
CRM/Member/Form/Membership.php

index c435bde7294f48ab14a8f3494128c95dab9e51f0..6f7bbf7baca396c47d05b4d384a52103e4ba6a8b 100644 (file)
@@ -1072,10 +1072,6 @@ DESC limit 1");
         $params['receipt_date'] = $formValues['receive_date'] ?? NULL;
       }
 
-      //insert financial type name in receipt.
-      $formValues['contributionType_name'] = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialType',
-        $this->getFinancialTypeID()
-      );
     }
 
     // process line items, until no previous line items.
@@ -1600,6 +1596,10 @@ DESC limit 1");
       $this->assign('is_pay_later', 0);
       $this->assign('isPrimary', 1);
     }
+    //insert financial type name in receipt.
+    $formValues['contributionType_name'] = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialType',
+      $this->getFinancialTypeID()
+    );
     return $this->emailReceipt($this, $formValues, $membership);
   }