From 78662b87965ef5dcb74e71c0cc5aaddc73605d15 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Tue, 30 Aug 2016 17:10:06 +0530 Subject: [PATCH] CRM-16189, fix for order api for entity table ---------------------------------------- * CRM-16189: Improve support for Accrual Method bookkeeping https://issues.civicrm.org/jira/browse/CRM-16189 --- CRM/Price/BAO/LineItem.php | 4 +++- api/v3/Membership.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index 9b0ef7cc06..e3f4b1a623 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -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; } diff --git a/api/v3/Membership.php b/api/v3/Membership.php index fa1952599a..4754152317 100644 --- a/api/v3/Membership.php +++ b/api/v3/Membership.php @@ -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']); } -- 2.25.1