if (CRM_Core_Permission::access('CiviContribute')) {
$this->assign('accessContribution', TRUE);
CRM_Member_Page_Tab::associatedContribution($this->_contactId, $this->_id);
+
+ //show associated soft credit when contribution payment is paid by different person in edit mode
+ if ($this->_id && $this->_contactId) {
+ $filter = " AND cc.id IN (SELECT contribution_id FROM civicrm_membership_payment WHERE membership_id = {$this->_id})";
+ $softCreditList = CRM_Contribute_BAO_ContributionSoft::getSoftContributionList($this->_contactId, $filter);
+ if (!empty($softCreditList)) {
+ $this->assign('softCredit', TRUE);
+ $this->assign('softCreditRows', $softCreditList);
+ }
+ }
}
}
</script>
{/literal}
{if $accessContribution and $action eq 2 and $rows.0.contribution_id}
- <fieldset>
- {include file="CRM/Contribute/Form/Selector.tpl" context="Search"}
- </fieldset>
+ <div class="crm-accordion-wrapper">
+ <div class="crm-accordion-header">Related Contributions</div>
+ <div class="crm-accordion-body">{include file="CRM/Contribute/Form/Selector.tpl" context="Search"}</div>
+ </div>
+ {/if}
+ {if $softCredit}
+ <div class="crm-accordion-wrapper">
+ <div class="crm-accordion-header">Related Soft Contributions</div>
+ <div class="crm-accordion-body">{include file="CRM/Contribute/Page/ContributionSoft.tpl" context="membership"}</div>
+ </div>
{/if}
{/if}
{include file="CRM/Custom/Page/CustomDataView.tpl"}
{if $accessContribution and $rows.0.contribution_id}
- {include file="CRM/Contribute/Form/Selector.tpl" context="Search"}
+ <div class="crm-accordion-wrapper">
+ <div class="crm-accordion-header">Related Contributions</div>
+ <div class="crm-accordion-body">{include file="CRM/Contribute/Form/Selector.tpl" context="Search"}</div>
+ </div>
{/if}
{if $softCredit}
- {include file="CRM/Contribute/Page/ContributionSoft.tpl" context="membership"}
+ <div class="crm-accordion-wrapper">
+ <div class="crm-accordion-header">Related Soft Contributions</div>
+ <div class="crm-accordion-body">{include file="CRM/Contribute/Page/ContributionSoft.tpl" context="membership"}</div>
+ </div>
{/if}
{if $has_related}