-
-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRM-19594 further fix on creating correct line items for memberships #9444
Conversation
eileenmcnaughton
commented
Nov 24, 2016
•
edited by civicrm-builder
Loading
edited by civicrm-builder
- CRM-19594: Wrong Membership Updated
This is a follow to issues identified by @davejenx on #9390 - I think it fixes some but not ALL of the identified problems. It locks in the ones it does fix with unit tests and if it passes I will merge and continue to try to ensure all scenarios are fixed. The one I suspect is not fixes it when a price set has more than one membership line |
493fa6e
to
1fae305
Compare
This one was test driven, but extends us to checking correct line item amounts
1fae305
to
8e8d287
Compare
@davejenx I'm merging this to address at least some of the items you identified - can you re-test them? |
I started testing this PR, then found that there's another one, #9449 . Anyway here are the results I got for #9444 - they don't cover all the cases I tested on #9390 because I discovered #9449 mid test so will move onto that. Testing with PR 9444, after it was committed, Thu 24 Nov
Summary Adjusted dates of previous memberships to start 04/01/2015, end 03/31/2016 -> expired 7. Member Signup and Renewal contrib page (no price set) as anon, no additional contrib entered, test payment processor.Created: 1 contact, id 210 1 membership, id 103 2 membership_log:
1 contribution, id 101 1 membership_payment:
1 line_item:
financial_trxn: Checking other memberships:
Adjusted dates of membership id 103 to start 04/01/2015, end 03/31/2016 -> expired 8. Member Signup and Renewal contrib page (no price set) + additional contrib as anon, test payment processor."Separate Membership Payment" not ticked in contrib page settings. Created: 1 contact, id 211 1 membership, id 104 2 membership_log:
1 contribution, id 102 1 membership_payment:
1 line_item: 2 financial_trxn: Checking other memberships:
Adjusted dates of membership id 104 to start 04/01/2015, end 03/31/2016 -> expired 9. Member Signup and Renewal contrib page (no price set) + additional contrib as anon, test payment processor."Separate Membership Payment" ticked in contrib page settings. Created: 1 contact, id 212 1 membership, id 105 2 membership_log:
2 contributions, id 103 & 104 1 membership_payment:
2 line_items, 1 per contribution:
4 financial_trxn: Checking other memberships:
|
Thanks Dave - I merged the PR's so that they would all be in http://dist.civicrm.org/by-date/latest/4.7.14-rc/ - Scenario 8 seems wrong I think |
Hmm - just thinking about scenario 8 - I think maybe it's a 'feature' not a bug. I suspect it has always been like that, and perhaps some people would argue it should be that way, and unless I can find some reason to thin otherwise I'm not going to treat it as a bug (ie. a candidate to be added to the rc, or for me to prioritise attention to). |
I've been testing 4.6 to see if CRM-19594 occurred - it didn't, see my comment on JIRA. Re scenario 8, the behaviour in 4.6 with "Separate Membership Payment" not ticked in contrib page settings was the same: a single line item with amount = membership + additional contribution. So this doesn't seem to be a newly-introduced issue. My take is that "Separate Membership Payment" comes from an era before line items, offering a choice between creating one contribution or two: two whole contributions (+ fees) from one contrib page submission, crikey! Now that we have line items, "Separate Membership Payment" seems like a relic and you could argue it's no longer needed and we should just create one contribution with two line items - that seems the obvious behaviour. Currently we offer the choice of one contribution with one line item or two contributions, each with one line item. But I think this is for another day. |
Actually 'separate membership payment' creates 2 actual payments - I believe this is useful in some cases for differentiating between a charitable payment & a membership payment at the payer's end. I don't fully understand the use case @GinkgoFJG might... |
I think the above mention was meant for @ginkgomzd, but I might be able to answer this anyway: as I understand it, "separate membership payment" does intentionally create two payments. I believe this occurs all the way through the stack, so to speak, meaning that you will find two transactions in your payment processor as well as two contribution records in CiviCRM. As for the usefulness of this "feature," I believe the idea is that it makes it easier to distinguish between membership payments, which may or may not be tax-deductible, and additional donations, which typically are. (There may be other reasons to track them separately as well.) I wonder if this is vestigial from before we had line items; it seems that nowadays you could have a single contribution with one line item associated with financial type X and another with financial type Y. There may be some questions about whether or not line item reporting is as advanced as contribution reporting, but aside from those questions I think it's hard to justify the continued existence of the feature. |
@GinkgoFJG Those were exactly my thoughts at #9444 (comment) . |
@davejenx: Whoops, didn't read the whole thread! I think with an audit of sorts of the line items reporting capabilities would need to occur before we dropped the feature, but I think it's a bit more complex than it seems. I seem to recall that contributions have a financial type, too -- we probably should eliminate that if we're definitively moving the classification to line items. |
@GinkgoFJG Agreed that reporting would need to be audited/improved before dropping this feature. Yes, contributions have financial_type_id too. There was discussion on the dev list in April re possibly getting rid of this, in thread "What sort of leap is this?". It's a very long thread. :-) |
Yes, that's what I was thinking of. |
There is also some REALLY funky behaviour around recurring with separate payment. I am not sure I understand it but it is USED by some small number of sites |
I'm not sure that it's working as intended. One of my clients has had issues with this. The idea is: sign up for a recurring membership and make a one-time gift. The implementation... well, not so much. Maybe @eileenmcnaughton's point, however, is that we aren't quite ready to retire the separate membership payments feature, because there's no such thing as a recurring line item -- recurrence is handled at the contribution level. However, if the feature doesn't work under the existing architecture, then I'd argue that it shouldn't hold up re-architecture. Really there's no reason users should have to check that config to handle this use case. If the conditions are "right" -- i.e., a membership registration is set to recur, and a second price field has a non-zero value -- the code could branch and create the additional contribution. |
"The idea is: sign up for a recurring membership and make a one-time gift." We have a lot of demand for variants of this - once off membership + recurring contribution & vice versa - monthly gift & annual membership recurring - there is a world of pain in here |
Yup. If I recall correctly, combining recurrences is a prohibited configuration (e.g., you can't configure a form for auto-renewing memberships and a recurring donation). That's one way to deal with it. ¯_(ツ)_/¯ |
FYI, this appears to have caused the regression described in https://issues.civicrm.org/jira/browse/CRM-20172/. I'm working on a fix now. Any comments there are most welcome. |
Thanks @twomice - you know what I'm going to say don't you.... let's lock in every fix with a test |
@eileenmcnaughton Yes, that's also how we sold it to the sponsor: we're going to fix it with tests so it doesn't. regress. evarrr. (Well, anyway, less likely to regress.) I'll probably have questions about how to test this, so you won't mind if I @ you in the WIP PR -- right? |
no worries |