Answers.Body: <p>Your modification is almost certainly correct.  </p>
  
  <p>Line items are an area of the code that was traditionally weak, but have come a long way in the last year.  My recommendation is to submit a bug report on issues.civicrm.org, and your patch on Github.  The review process means that this question will be answered by the financial experts. Financial improvements are generally reviewed pretty quickly.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-03T19:19:26.247Z
Answers.LastActivityDate: 2017-12-03T19:19:26.247Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>For non-'test'/Dummy refund (e.g. Authorize), the refund 'contribution' details for a 'contribution' consisting of 2 line_items (a price and a service fee) are getting assigned the same financial type and total amount (with sign reversed) instead of retaining the line_item values. For example, a refund for an event where the price-set includes an event_fee of $20 and service_fee of $2 should have -$20 for the event_fee and -$2 for the service_fee, and the financial-types not changed. In CRM/Contribute/BAO/Contribution.php, both the event_fee and service_fee <em>amount</em> is set to -$22 and service_fee <em>financial type</em> is changed to 'event_fee' type.
     I modified the code in (Civicrm 4.7.23) CRM/Contribute/BAO/Contribution.php.  Is there a reason NOT to do this?  </p>
  
Tags: <civievent><civicontribute>
Title: Civcrm Refund - why are amount and fin. type are based on (priceset) rather than line_item?
ThreadText: # Civcrm Refund - why are amount and fin. type are based on (priceset) rather than line_item?
  
  (Asked by: username_0 on 2017-12-02)
  
  For non-'test'/Dummy refund (e.g. Authorize), the refund 'contribution' details for a 'contribution' consisting of 2 line\_items (a price and a service fee) are getting assigned the same financial type and total amount (with sign reversed) instead of retaining the line\_item values. For example, a refund for an event where the price-set includes an event\_fee of $20 and service\_fee of $2 should have -$20 for the event\_fee and -$2 for the service\_fee, and the financial-types not changed. In CRM/Contribute/BAO/Contribution.php, both the event\_fee and service\_fee *amount* is set to -$22 and service\_fee *financial type* is changed to 'event\_fee' type.
  I modified the code in (Civicrm 4.7.23) CRM/Contribute/BAO/Contribution.php. Is there a reason NOT to do this?
  
  **Tags:** civievent, civicontribute
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-12-03. Score: 1
  
  Your modification is almost certainly correct.
  
  Line items are an area of the code that was traditionally weak, but have come a long way in the last year. My recommendation is to submit a bug report on issues.civicrm.org, and your patch on Github. The review process means that this question will be answered by the financial experts. Financial improvements are generally reviewed pretty quickly.
  
  
  ---
  
  