CRM-16189, added code to create transaction for participant
authorPradeep Nayak <pradpnayak@gmail.com>
Thu, 11 Aug 2016 03:24:58 +0000 (08:54 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Sun, 25 Sep 2016 21:22:30 +0000 (02:52 +0530)
----------------------------------------
* CRM-16189: Improve support for Accrual Method bookkeeping
  https://issues.civicrm.org/jira/browse/CRM-16189

CRM/Member/BAO/Membership.php

index 1805b76426d879bf0bbe7da85c1504b0a6260314..3ed18e20aa59c69fa39836d87191a70fa65c193f 100644 (file)
@@ -340,6 +340,10 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership {
 
     if (!empty($params['line_item']) && empty($ids['contribution'])) {
       CRM_Price_BAO_LineItem::processPriceSet($membership->id, $params['line_item'], CRM_Utils_Array::value('contribution', $params));
+      if (!empty($params['contribution'])) {
+        $trxnParams['contribution'] = $params['contribution'];
+        CRM_Contribute_BAO_Contribution::recordAlwaysAccountsReceivable($trxnParams, 'Membership');
+      }
     }
 
     //insert payment record for this membership