Skip to content
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

Remove code to retrieve premium data #19262

Merged
merged 1 commit into from
Dec 23, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Dec 23, 2020

Overview

Remove code to retrieve premium data from previous shared function

Before

Code attempts to calculate deductible amount (ie the donation less the cost of the premium) in code that has been copied from a shared function. However, I looked in the UI & the code & concluded premiums are not available on the back office membership form

After

poof

Technical Details

This is only in one obscure code path on the form - recurring card contributions. If premiums were handled they would be in more than this flow which appears to have shared a lot of code in order to do very little in common

Comments

    After a bit of digging I can't see an evidence we ever have premiums on the backoffice membership forms
@civibot
Copy link

civibot bot commented Dec 23, 2020

(Standard links)

@civibot civibot bot added the master label Dec 23, 2020
@seamuslee001
Copy link
Contributor

@eileenmcnaughton one thing which looking at this is what if the back office user used a Price set that had for some reason a non deductible amount set for the membership option? I.e. should we switch it to a call like https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Form/Contribution/Confirm.php#L223, I agree I don't see products coming into this but Price sets may.

@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 if we agree the existing code isn't doing anything then let's remove it & add a gitlab to follow up & fix what seems to be a pre-existing bug. I think where the change would end up in the code would be very different if we do it when the form is cleaned up

@seamuslee001
Copy link
Contributor

@eileenmcnaughton my point is that I'm not sure that I agree that it isn't doing anything, I'm thinking it might be, I am speculating that if someone was to choose a price set from the back office and one of those price options has a non deductible amount set for some reason then L223 of Confirm.php will cause $nonDecutableAmount to get populated and then returned at L227 before it event gets into the Product matters

@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 I just tried but couldn't figure out how you would configure a price set with a premium for a back office membership

@seamuslee001
Copy link
Contributor

ok so I think I have come to the same conclusion slightly as you now @eileenmcnaughton but I think the bug your getting at there is that the non deductible amount isn't being carried across to the contribution right? So I did this

  1. Create a new membership Type that is an auto renewal able membership type
  2. Create a Price set with that being the only option
  3. Edit the option to set some level of a non deductible amount
  4. Create an Automatic renewal membership on back office via live cc page
  5. See that the Contribution is saved without the non deductable amount that should have been passed in from the price option.

my guess is that this if didn't succeed https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Form/Contribution/Confirm.php#L222 so we didn't check the priceSet for a non deductible amount

@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 my bet is that backoffice contribution forms don't work either - but it seems we agree this line isn't doing anything & there might be a bigger picture of failure?

@seamuslee001
Copy link
Contributor

Yeh that is where I have got to, my thinking is that for the back office forms this should be happening https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Form/Contribution/Confirm.php#L221 but clearly it isn't and its probably better to stand that up independently of the getNonDeductableAmount function on that confirm page

@seamuslee001
Copy link
Contributor

Based on my testing above merging this

@seamuslee001 seamuslee001 merged commit eafb76d into civicrm:master Dec 23, 2020
@seamuslee001 seamuslee001 deleted the recur_test branch December 23, 2020 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants