From 5525990d6fed292971144e9445671a3a2f53839a Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 13 Oct 2014 17:39:38 +1300 Subject: [PATCH] preliminary tidy up - trailing spaces & comments --- CRM/Contribute/BAO/Contribution.php | 12 ++++++------ CRM/Event/BAO/Participant.php | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index bcdd6a3a14..715faeefb1 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -885,7 +885,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = civicrm_contribution.conta * * @param boolean $addExtraFields true if special fields needs to be added * - * @return return the list of contribution fields + * @return array the list of contribution fields * @static * @access public */ @@ -3504,7 +3504,7 @@ WHERE con.id = {$contributionId} } // New Contrbution and update of contribution with tax rate financial type - if (isset($params['financial_type_id']) && array_key_exists($params['financial_type_id'], $taxRates) && + if (isset($params['financial_type_id']) && array_key_exists($params['financial_type_id'], $taxRates) && empty($params['skipLineItem']) && !$isLineItem) { $taxRateParams = $taxRates[$params['financial_type_id']]; @@ -3524,19 +3524,19 @@ WHERE con.id = {$contributionId} } } $params['total_amount'] = $params['total_amount'] + $params['tax_amount']; - } + } else if (isset($params['api.line_item.create'])) { - // Update total amount of contribution using lineItem + // Update total amount of contribution using lineItem $taxAmountArray = array(); foreach ($params['api.line_item.create'] as $key => $value) { if (isset($value['financial_type_id']) && array_key_exists($value['financial_type_id'], $taxRates)) { $taxRate = $taxRates[$value['financial_type_id']]; - $taxAmount = CRM_Contribute_BAO_Contribution_Utils::calculateTaxAmount($value['line_total'], $taxRate); + $taxAmount = CRM_Contribute_BAO_Contribution_Utils::calculateTaxAmount($value['line_total'], $taxRate); $taxAmountArray[] = round($taxAmount['tax_amount'], 2); } } $params['tax_amount'] = array_sum($taxAmountArray); - $params['total_amount'] = $params['total_amount'] + $params['tax_amount']; + $params['total_amount'] = $params['total_amount'] + $params['tax_amount']; } else { // update line item of contrbution diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php index b98d3b4528..ae042dab04 100644 --- a/CRM/Event/BAO/Participant.php +++ b/CRM/Event/BAO/Participant.php @@ -1722,7 +1722,7 @@ WHERE civicrm_participant.contact_id = {$contactID} AND * @param int $contributionId Contribution Id * @param bool $excludeCancelled Exclude cancelled additional participant * - * @return int $participantsId + * @return array $participantsId * @access public * @static */ @@ -1943,10 +1943,10 @@ GROUP BY li.entity_table, li.entity_id, price_field_value_id if (!empty($updateLines)) { foreach ($updateLines as $valueId => $vals) { - if (isset($vals['tax_amount'])) { + if (isset($vals['tax_amount'])) { $taxAmount = $vals['tax_amount']; } - else { + else { $taxAmount = "NULL"; } $updateLineItem = " -- 2.25.1