Changes in Report shows incorrect date for Overdue payments
authorSudha Bisht <sudha.bisht@webaccessglobal.com>
Thu, 30 Apr 2015 10:09:46 +0000 (15:39 +0530)
committerSudha Bisht <sudha.bisht@webaccessglobal.com>
Thu, 30 Apr 2015 10:09:46 +0000 (15:39 +0530)
CRM/Report/Form/Pledge/Detail.php

index 73e8130945fa6402ef3656086482b1b492925d12..8beccf1547b1080c34eaaf9504415e1584c81bd9 100644 (file)
@@ -449,6 +449,8 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form {
     // To Display Payment Details of pledged amount
     // for pledge payments In Progress
     if (!empty($display)) {
+      $statusId = array_keys(CRM_Core_PseudoConstant::accountOptionValues("contribution_status", NULL, " AND v.name IN  ('Pending', 'Overdue')"));
+      $statusId = implode(',', $statusId);
       $sqlPayment = "
                  SELECT min(payment.scheduled_date) as scheduled_date,
                         payment.pledge_id,
@@ -459,7 +461,7 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form {
                        LEFT JOIN civicrm_pledge pledge
                                  ON pledge.id = payment.pledge_id
 
-                  WHERE payment.status_id = 2
+                  WHERE payment.status_id IN ({$statusId})
 
                   GROUP BY payment.pledge_id";