CRM-12256
authorDonald A. Lobo <lobo@civicrm.org>
Sun, 31 Mar 2013 21:52:12 +0000 (14:52 -0700)
committerDonald A. Lobo <lobo@civicrm.org>
Sun, 31 Mar 2013 21:52:12 +0000 (14:52 -0700)
CRM/Contribute/BAO/ContributionRecur.php

index f918ca16701362eec14ff818263b461f19ae9efc..269a8d69f3b1476aebf3ad100ff3a32ad46a9927 100644 (file)
@@ -183,7 +183,7 @@ SELECT r.payment_processor_id
     $recurID = implode(',', $ids);
     $totalCount = array();
 
-    $query = " 
+    $query = "
          SELECT contribution_recur_id, count( contribution_recur_id ) as commpleted
          FROM civicrm_contribution
          WHERE contribution_recur_id IN ( {$recurID}) AND is_test = 0
@@ -368,8 +368,8 @@ SELECT r.payment_processor_id
 
   static function getSubscriptionDetails($entityID, $entity = 'recur') {
     $sql = "
-SELECT rec.id                   as recur_id, 
-       rec.processor_id         as subscription_id, 
+SELECT rec.id                   as recur_id,
+       rec.processor_id         as subscription_id,
        rec.frequency_interval,
        rec.installments,
        rec.frequency_unit,
@@ -377,14 +377,14 @@ SELECT rec.id                   as recur_id,
        rec.is_test,
        rec.auto_renew,
        rec.currency,
-       con.id                   as contribution_id, 
+       con.id                   as contribution_id,
        con.contribution_page_id,
        con.contact_id,
        mp.membership_id";
 
     if ($entity == 'recur') {
       $sql .= "
-      FROM civicrm_contribution_recur rec 
+      FROM civicrm_contribution_recur rec
 INNER JOIN civicrm_contribution       con ON ( con.contribution_recur_id = rec.id )
 LEFT  JOIN civicrm_membership_payment mp  ON ( mp.contribution_id = con.id )
      WHERE rec.id = %1
@@ -393,14 +393,14 @@ LEFT  JOIN civicrm_membership_payment mp  ON ( mp.contribution_id = con.id )
     elseif ($entity == 'contribution') {
       $sql .= "
       FROM civicrm_contribution       con
-INNER JOIN civicrm_contribution_recur rec 
+INNER JOIN civicrm_contribution_recur rec ON ( con.contribution_recur_id = rec.id )
 LEFT  JOIN civicrm_membership_payment mp  ON ( mp.contribution_id = con.id )
      WHERE con.id = %1";
     }
     elseif ($entity == 'membership') {
       $sql .= "
-      FROM civicrm_membership_payment mp 
-INNER JOIN civicrm_membership         mem ON ( mp.membership_id = mem.id ) 
+      FROM civicrm_membership_payment mp
+INNER JOIN civicrm_membership         mem ON ( mp.membership_id = mem.id )
 INNER JOIN civicrm_contribution_recur rec ON ( mem.contribution_recur_id = rec.id )
 INNER JOIN civicrm_contribution       con ON ( con.id = mp.contribution_id )
      WHERE mp.membership_id = %1";
@@ -410,7 +410,9 @@ INNER JOIN civicrm_contribution       con ON ( con.id = mp.contribution_id )
     if ($dao->fetch()) {
       return $dao;
     }
-    else return CRM_Core_DAO::$_nullObject;
+    else {
+      return CRM_Core_DAO::$_nullObject;
+    }
   }
 
   static function setSubscriptionContext() {