Skip to content
Snippets Groups Projects
Commit 097d90dc authored by deepak-srivastava's avatar deepak-srivastava
Browse files

Merge pull request #986 from deepak-srivastava/ninja

CRM-12772
parents 872b92c0 9dad7c4d
No related branches found
No related tags found
No related merge requests found
...@@ -339,16 +339,11 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { ...@@ -339,16 +339,11 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form {
} }
//used when contribution field is selected //used when contribution field is selected
if ($this->_contribField) { if ($this->_contribField) {
$this->_from .= " $this->_from .= "
LEFT JOIN ( LEFT JOIN civicrm_membership_payment cmp
SELECT cc.*, cmp.membership_id as membership_id ON {$this->_aliases['civicrm_membership']}.id = cmp.membership_id
FROM civicrm_membership_payment cmp LEFT JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']}
JOIN civicrm_contribution cc ON cmp.contribution_id={$this->_aliases['civicrm_contribution']}.id\n";
ON cc.id = cmp.contribution_id
ORDER BY cc.receive_date DESC
) {$this->_aliases['civicrm_contribution']}
ON {$this->_aliases['civicrm_membership']}.id =
{$this->_aliases['civicrm_contribution']}.membership_id\n";
} }
} }
...@@ -402,6 +397,10 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { ...@@ -402,6 +397,10 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form {
function orderBy() { function orderBy() {
$this->_orderBy = " ORDER BY {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_contact']}.id, {$this->_aliases['civicrm_membership']}.membership_type_id"; $this->_orderBy = " ORDER BY {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_contact']}.id, {$this->_aliases['civicrm_membership']}.membership_type_id";
if ($this->_contribField) {
$this->_orderBy .= ", {$this->_aliases['civicrm_contribution']}.receive_date DESC";
}
} }
function postProcess() { function postProcess() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment