Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Commit

Permalink
MAE-508: Fix invalid price field id
Browse files Browse the repository at this point in the history
  • Loading branch information
ahed-compucorp committed Mar 29, 2021
1 parent 4a433f5 commit d425dd5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lineitemedit.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ function lineitemedit_civicrm_pre($op, $entity, $entityID, &$params) {
$lineItem['qty']
);

$newLineItemParams = array(
$newLineItemParams[] = array(
'entity_table' => $lineEntityTable,
'entity_id' => $lineEntityID,
'contribution_id' => $entityID,
Expand All @@ -281,7 +281,10 @@ function lineitemedit_civicrm_pre($op, $entity, $entityID, &$params) {
'financial_type_id' => $lineItem['financial_type_id'],
'tax_amount' => CRM_Utils_Array::value('tax_amount', $lineItem),
);
$newLineItem[] = civicrm_api3('LineItem', 'create', $newLineItemParams)['id'];
}

foreach ($newLineItemParams as $lineItem) {
$newLineItem[] = civicrm_api3('LineItem', 'create', $lineItem)['id'];
}

if (!empty($lineItemParams)) {
Expand Down

0 comments on commit d425dd5

Please sign in to comment.