}
elseif (array_key_exists('participant', $contributionDetails)) {
$pId = current($contributionDetails['participant']);
- }
+ }
}
}
+
+ $isQuickConfig = 0;
+ if ($this->_priceSetId && CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) {
+ $isQuickConfig = 1;
+ }
+
if (!$priceSetId && !empty($submittedValues['total_amount']) && $this->_id) {
// 10117 update th line items for participants
if ($pId) {
$entityTable = 'participant';
$entityID = $pId;
+ $isRelatedId = FALSE;
$participantParams = array(
'fee_amount' => $submittedValues['total_amount'],
'id' => $entityID
$entityID = $this->_id;
}
- $lineItems = CRM_Price_BAO_LineItem::getLineItems($entityID, NULL, TRUE, $isRelatedId);
+ $lineItems = CRM_Price_BAO_LineItem::getLineItems($entityID, $entityTable, $isQuickConfig, $isRelatedId);
foreach (array_keys($lineItems) as $id) {
$lineItems[$id]['id'] = $id;
}
$lineItem[$this->_priceSetId] = $lineItems;
}
}
- $isQuickConfig = 0;
- if ($this->_priceSetId && CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) {
- $isQuickConfig = 1;
- }
+
//CRM-11529 for quick config back office transactions
//when financial_type_id is passed in form, update the
//line items with the financial type selected in form
$expenseTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Expense Account is' "));
$domainId = CRM_Core_Config::domainID();
$amount = 0;
+ $contributionStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
if (!empty($params['prevContribution'])) {
+ if ($params['prevContribution']->contribution_status_id == array_search('Pending', $contributionStatuses) ||
+ $params['contribution']->contribution_status_id == array_search('Refund', $contributionStatuses)) {
+ return FALSE;
+ }
$amount = $params['prevContribution']->fee_amount;
}
$amount = $params['fee_amount'] - $amount;