CRM-16189, fix for order api for entity table
authorPradeep Nayak <pradpnayak@gmail.com>
Tue, 30 Aug 2016 11:40:06 +0000 (17:10 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Wed, 31 Aug 2016 20:45:40 +0000 (02:15 +0530)
----------------------------------------
* CRM-16189: Improve support for Accrual Method bookkeeping
  https://issues.civicrm.org/jira/browse/CRM-16189

CRM/Price/BAO/LineItem.php
api/v3/Membership.php

index 9b0ef7cc06a1f6307cf3ced6c9eb3486eefc990e..e3f4b1a623a64736437491234ad3dcd41a946046 100644 (file)
@@ -432,7 +432,9 @@ AND li.entity_id = {$entityId}
       }
 
       foreach ($values as &$line) {
-        $line['entity_table'] = $entityTable;
+        if (empty($line['entity_table'])) {
+          $line['entity_table'] = $entityTable;
+        }
         if (empty($line['entity_id'])) {
           $line['entity_id'] = $entityId;
         }
index fa1952599a983ddecd9d9b2827d8e9123a482196..4754152317be4b8e4f2480c586c15816858daff7 100644 (file)
@@ -143,7 +143,7 @@ function civicrm_api3_membership_create($params) {
   //need to pass action to handle related memberships.
   $params['action'] = $action;
 
-  if (empty($params['line_item']) && !empty($params['membership_type_id'])) {
+  if (empty($params['line_item']) && !empty($params['membership_type_id']) && empty($params['skipLineItem'])) {
     CRM_Price_BAO_LineItem::getLineItemArray($params, NULL, 'membership', $params['membership_type_id']);
   }