CRM-17539 fix enotice on zero dollar receipt
authoreileen <emcnaughton@wikimedia.org>
Sun, 15 Nov 2015 21:47:32 +0000 (13:47 -0800)
committereileen <emcnaughton@wikimedia.org>
Tue, 24 Nov 2015 04:57:51 +0000 (17:57 +1300)
CRM/Contribute/Form/Contribution/Main.php

index ad8dc2ad35282a6ea6456d42362e2e7df9474580..5950346dab9bbccac0e83bc43f4646bae9ead16c 100644 (file)
@@ -1046,11 +1046,14 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
         }
       }
     }
+    // from here on down, $params['amount'] holds a monetary value (or null) rather than an option ID
+    $params['amount'] = self::computeAmount($params, $this->_values);
 
     if (($this->_values['is_pay_later'] &&
         empty($this->_paymentProcessor) &&
         !array_key_exists('hidden_processor', $params)) ||
       (CRM_Utils_Array::value('payment_processor_id', $params) == 0)
+      && $params['amount'] != 0
     ) {
       $params['is_pay_later'] = 1;
     }
@@ -1068,8 +1071,6 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       $this->assign('pay_later_receipt', $this->_values['pay_later_receipt']);
     }
 
-    // from here on down, $params['amount'] holds a monetary value (or null) rather than an option ID
-    $params['amount'] = self::computeAmount($params, $this->_values);
     $params['separate_amount'] = $params['amount'];
     $memFee = NULL;
     if (!empty($params['selectMembership'])) {