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 (Moderator: Dave Greenberg) »
  • Editing contributions creates errors in the database
Pages: [1]

Author Topic: Editing contributions creates errors in the database  (Read 520 times)

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Editing contributions creates errors in the database
November 18, 2012, 11:58:16 pm
Editing contributions through Civi leads to incorrect info being stored in the MYSQL database. 

It seems to only create problems with the civicrm_line_item table.  As most people seem to report income based on the civicrm_contribution table it could be happening on many installations without people realising what is going on.  It also means I can't check easily that the behaviour I see on my installation can be replicated on the Demo site

But just because people aren't aware it happens it doesn't mean it isn't a bug.  As we are moving towards CiviAccounts and more rigorous accounting processes/reports I think this needs to be addressed.

So far I have come across this problem twice as outlined below:

Case 1
An offline contribution was made for $5 line.
  • One entry was created in the civicrm_contribution table for $5
  • One entry was created in the civicrm_line_item table for $5.
The wrong Contribution type was used however meant the daily Income Allocated listing we use to post to our accounting package was incorrect.

I edited the payment through the Civi.  After editing the situation was:
  • One entry in the civicrm_contribution table for $5
  • Two entries in the civicrm_line_item table: the original one with the old contribution type for $5 and a new one with the new contribution type also for $5.
So one contibution for $5  was linked to two line items each for $5.


Case 2
An offline registration was entered for an event that used a price set.
  • One entry was created in the civicrm_contribution table for $220
  • Two entries were created in the civicrm_line_item table: one for $65 and the other for $155.]
However the wrong Payment type was selected which meant the daily Income Recieved listing we use to post to our accounting package was incorrect.

I edited the payment through the Civi.  After the editing the situation was:
  • One entry in the civicrm_contribution table for $220
  • Two entries in the civicrm_line_item table: one for $65 and the other for $220.
So there is one contribution for $220 linked to line items that total $285.

I realise that not many people report on a line_item level, but I do think it is a bug.

I don't even know how to start tracking down the problem.  I can barely customise a system workflow message template.  However, I do want to want to learn more, so I am happy to fossick around if someone can point me in the right direction. 






Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Editing contributions creates errors in the database
November 19, 2012, 12:41:50 pm
Hmm - I did a quick test on my local 4.2 install of Case 1.
- create backoffice contribution w/ Contribution Type = Donation
- verified 1 contribution and 1 line_item record
- edited the same contribution record and changed Contribution Type to 'Membership Fee'
- rechecked my DB and still have 1 contribution and 1 line_item

Also tested w/ changing the amount AND contribution type during edit. Still working as expected. Need to figure out what's different in your environment.
Protect your investment in CiviCRM by  becoming a Member!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Editing contributions creates errors in the database
November 19, 2012, 12:47:01 pm
Eileen suggested you might see if you can recreate these bugs in your personal sandbox. If not, then some investigatiion / debugging will need to happen w/ a copy of the production DB.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Editing contributions creates errors in the database

This forum was archived on 2017-11-26.