Skip to content

Commit

Permalink
Merge pull request #4292 from monishdeb/CRM-15374
Browse files Browse the repository at this point in the history
CRM-15374 fix - Contribution FEES are affecting Balance and Total Paid i...
  • Loading branch information
davecivicrm committed Oct 2, 2014
2 parents cc1bf3e + e88aa68 commit 17087a4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
16 changes: 10 additions & 6 deletions CRM/Contribute/Form/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -1045,14 +1045,21 @@ public function postProcess() {
}
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
Expand All @@ -1067,7 +1074,7 @@ public function postProcess() {
$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;
}
Expand All @@ -1084,10 +1091,7 @@ public function postProcess() {
$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
Expand Down
3 changes: 3 additions & 0 deletions CRM/Event/Form/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -1391,6 +1391,9 @@ public function postProcess() {
if ($contributionParams['contribution_status_id'] == CRM_Core_OptionGroup::getValue('contribution_status', 'Pending', 'name')) {
$contributionParams['is_pay_later'] = 1;
}
elseif ($contributionParams['contribution_status_id'] == CRM_Core_OptionGroup::getValue('contribution_status', 'Completed', 'name')) {
$contributionParams['is_pay_later'] = 0;
}

if ($params['status_id'] == array_search('Partially paid', $participantStatus)) {
if (!$amountOwed && $this->_action & CRM_Core_Action::UPDATE) {
Expand Down

0 comments on commit 17087a4

Please sign in to comment.