Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Update contribution financial type when line item financial type is updated #32

Closed
mfb opened this issue Feb 8, 2019 · 12 comments
Closed

Comments

@mfb
Copy link

mfb commented Feb 8, 2019

If the line item financial type is updated, this extension doesn't update the parent contribution's financial type, and they will be out of sync in any reports, etc.

Civi core now "freezes" the contribution financial type, so admins cannot manually sync the line item and contribution financial types.

I would say this extension should automatically update the parent contribution's financial type.

@eileenmcnaughton
Copy link
Contributor

I would lean towards just exposing the option to change it - the contribution could have several types at the line item level

@mfb
Copy link
Author

mfb commented Feb 8, 2019

That works for me.

There might be cases where someone edits just the line item or just the contribution and they get out of sync, but that's probably not a big deal, and can always be manually fixed.

@JoeMurray
Copy link
Member

KISS: let people edit the contrib and line item financial types separately. The problem is there are many possible ways of making it more convenient that vary based on use cases that are not the same for everyone..

@mfb
Copy link
Author

mfb commented Feb 25, 2019

Would @Monish or anyone else be able to take a look at this?

@monishdeb
Copy link
Member

@mfb I agree with you and it makes sense for contribution with single line-item. But suppose a contribution has multiple line-items, where each item has different FT then parent contribution. In such case how we can decide the contribution's FT!

So here's my plan:

  1. Simply update the contribution's FT if there's single line-item FT change
  2. Expose the contributions FT (like @eileenmcnaughton suggested) if there are multiple line-items

What do you think?

@JoeMurray
Copy link
Member

Maybe put the Contribution Financial Type just above the Line Item Financial Type with help text if it is changed 'NB: The Contribution Financial Type is not used in Financial Data exports, and is deprecated and scheduled to be removed in a future version of CiviCRM as it does not accurately represent cases where different line items of a contribution have different financial types.'

@mfb
Copy link
Author

mfb commented Oct 11, 2019

This all sounds great to me.

@mfb
Copy link
Author

mfb commented Feb 13, 2020

We're still interested in this feature - we use the contribution financial type in reports etc. Was anyone working on it? :)

@JoeMurray
Copy link
Member

This is currently an unfunded feature request. We're very busy unfortunately and have not been able to make time for pro bono projects. This would be near the top of them.

@mfb
Copy link
Author

mfb commented Feb 13, 2020

The PR at #51 would resolve this issue for us, by syncing the contribution's financial type when it's updated on a line item, and the contribution only has one line item.

It doesn't do anything to make the contribution financial type editable when there are multiple line items, as suggested by @monishdeb - but it seems like that feature could be added in a followup PR.

(Side note: I was thinking perhaps this extension should use database transactions, so that all these changes to different records are made atomically? But that would also be for another PR :)

@monishdeb
Copy link
Member

@mfb I have made this improvement under PR #55 . Please have a look.

@monishdeb
Copy link
Member

Closing the ticket as PR #55 is merged which fixes the current issue, also included in latest 2.4 release

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants