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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Correct relationship of participant and payment related tables in 4.5.1
Pages: [1]

Author Topic: Correct relationship of participant and payment related tables in 4.5.1  (Read 372 times)

jakecivi

  • I post frequently
  • ***
  • Posts: 140
  • Karma: 0
Correct relationship of participant and payment related tables in 4.5.1
October 14, 2014, 07:12:59 pm
Could someone confirm the correct relationship of financial_trxn, entity_financial_trxn, participant_payment, financial_item, line_item, contribution, and participant in 4.5.1? dgg explained pretty clearly, and I think I've got it now:

For a participant, there is one contribution and one financial_item, and then there is one entry in entity_financial_trxn linking the financial_item to a trxn from null to accounts receivable if a “pay later” method has been selected, otherwise from null to a payment processor or deposit account, and an entity_financial_trxn linking the same trxn to the contribution. Then further payments (or in the event of a “pay later” method, the first payment and then further payments) made to the same contribution are recorded against it in entity_financial_trxn, as trxn's linked to the contribution. If any of the trxn's have fees associated with them, that information is recorded in the “fee” column of the main trxn, and then an additional trxn is created, linked to a special “Fee” financial_item via entity_financial_trxn, and also linked to the main contribution via entity_financial_trxn. Also, although it's a legacy table, an entry gets added to participant_payment linking the participant to the contribution (this information is also available in line_item, but there are parts of Civi's code that still use participant_payment). Is that correct?

It also seems that, at least upon upgrade of a civi 4.1 database with various payments in it, that the fee_amount of the contribution gets the fee of the first payment made, and then if it's not the full payment (e.g. I manually update line_item to a different fee amount), 4.5.1 treats additional transactions, even cash ones, as though they have the same processor fee. Those fees are not reflected in the interface but are reflected in the database. Is that a bug?

jakecivi

  • I post frequently
  • ***
  • Posts: 140
  • Karma: 0
Re: Correct relationship of participant and payment related tables in 4.5.1
November 13, 2014, 05:08:48 pm
Another confusing point: creating an event registration, then changing the Contribution amount (clicking edit on the contribution below the participant view) causes the contribution amount to change, the event fee (line_item total) to stay the same, and for an outstanding balance to show. Adding additional payments causes no change in the contribution amount.

It's just not clear that you're not supposed to use that edit button and that using it can screw up your records.

Suppose someone wants to change someone's event fee to something that's not one of the price field values.. and the only seeming way to do that is to edit the contribution, which has unexpected results.

Quote
dgg: ... might be a good argument to freeze some of the contribution form fields (e.g. amount + ?? )
- #civicrm

Perhaps there should be a way to change an event fee (or line item value) to an arbitrary amount?
« Last Edit: November 13, 2014, 05:24:57 pm by jakecivi »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Correct relationship of participant and payment related tables in 4.5.1

This forum was archived on 2017-11-26.