From: jitendrapurohit Date: Tue, 25 Aug 2015 09:19:29 +0000 (+0530) Subject: fix where and qill for all the date filters X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8fea776b02b18b64972ce51e92b1482762636e54;p=civicrm-core.git fix where and qill for all the date filters --- diff --git a/CRM/Report/Form/Contribute/Recur.php b/CRM/Report/Form/Contribute/Recur.php index 446c4092d7..e293867174 100644 --- a/CRM/Report/Form/Contribute/Recur.php +++ b/CRM/Report/Form/Contribute/Recur.php @@ -191,22 +191,22 @@ class CRM_Report_Form_Contribute_Recur extends CRM_Report_Form { 'start_date' => array( 'title' => ts('Start Date'), 'operatorType' => CRM_Report_Form::OP_DATE, - 'type' => CRM_Utils_Type::T_TIME, + 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, ), 'next_sched_contribution_date' => array( 'title' => ts('Next Scheduled Contribution Date'), 'operatorType' => CRM_Report_Form::OP_DATE, - 'type' => CRM_Utils_Type::T_TIME, + 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, ), 'end_date' => array( 'title' => ts('End Date'), 'operatorType' => CRM_Report_Form::OP_DATE, - 'type' => CRM_Utils_Type::T_TIME, + 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, ), - 'contribution_processed_date' => array( + 'modified_date' => array( 'title' => ts('Last Contribution Processed'), 'operatorType' => CRM_Report_Form::OP_DATE, - 'type' => CRM_Utils_Type::T_TIME, + 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, ), 'calculated_end_date' => array( 'title' => ts('Calculated end date (either end date or date all installments will be made)'), @@ -313,16 +313,8 @@ class CRM_Report_Form_Contribute_Recur extends CRM_Report_Form { "; $isBreak = TRUE; } - if (!empty($this->_params['contribution_processed_date_' . $suffix])) { - $relative = CRM_Utils_Array::value("contribution_processed_date_relative", $this->_params); - $from = CRM_Utils_Array::value("contribution_processed_date_from", $this->_params); - $to = CRM_Utils_Array::value("contribution_processed_date_to", $this->_params); - $this->_where .= " AND contribution_civireport.id IN (SELECT MAX(cc.id) - FROM civicrm_contribution cc - LEFT JOIN civicrm_contribution_recur ccr ON cc.contribution_recur_id = ccr.id - WHERE ccr.contribution_status_id = 1 AND (" . - $this->dateClause("DATE(ccr.modified_date)", - $relative, $from, $to, CRM_Utils_Type::T_DATE, NULL, NULL) . " ) GROUP BY cc.contribution_recur_id)"; + if (!empty($this->_params['modified_date_' . $suffix])) { + $this->_where .= " AND {$this->_aliases['civicrm_contribution_recur']}.contribution_status_id = 1"; $isBreak = TRUE; } if (!empty($isBreak)) {