CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Weird data: sum of line item amounts does NOT match contribution amount
Pages: [1]

Author Topic: Weird data: sum of line item amounts does NOT match contribution amount  (Read 352 times)

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Weird data: sum of line item amounts does NOT match contribution amount
November 15, 2013, 07:13:28 pm
By running the SQL query provided below, I get over 200 records where the sum of the line item amount does NOT match the contribution total_amount.   Is there ever a legitimate reason for this? Or is this a bug?    I am running version 4.3.8 ( which was upgraded from version 4.2.7)      Should I attempt to craft an SQL update statement to fix the issue?

SELECT c.id, c.contact_id, COUNT( li.id ) , SUM( line_total ) , c.total_amount, c.source
FROM civicrm_line_item li
JOIN civicrm_participant part ON li.entity_id = part.id
AND li.entity_table =  'civicrm_participant'
JOIN civicrm_participant_payment ep ON IFNULL( part.registered_by_id, part.id ) = ep.participant_id
JOIN civicrm_contribution c ON ep.contribution_id = c.id
GROUP BY c.id
HAVING SUM( li.line_total ) <> c.total_amount
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Weird data: sum of line item amounts does NOT match contribution amount

This forum was archived on 2017-11-26.