CRM-20392 add unit test and fix for incorrect total used in line item creation code.
[civicrm-core.git] / CRM / Price / BAO / LineItem.php
index 56694bd71cf66b949962fe869760d1f85d14fe6d..e1b629c4a721d07e65dc044b5d790e7371073099 100644 (file)
@@ -555,7 +555,7 @@ WHERE li.contribution_id = %1";
 
     if (!$entityId) {
       $priceSetDetails = CRM_Price_BAO_PriceSet::getDefaultPriceSet($entityTable);
-      $totalAmount = CRM_Utils_Array::value('total_amount', $params);
+      $totalAmount = CRM_Utils_Array::value('partial_payment_total', $params, CRM_Utils_Array::value('total_amount', $params));
       $financialType = CRM_Utils_Array::value('financial_type_id', $params);
       foreach ($priceSetDetails as $values) {
         if ($entityTable == 'membership') {