-
-
Notifications
You must be signed in to change notification settings - Fork 824
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-21201: Tax recalculated when pay later contribution is completed using Pay Now #11026
Conversation
This looks like a code improvement but I have managed to stay blissfully ignorant of the ins & outs of what should happen here. I like the extraction. @KarinG should weigh in |
I was able to recreate this bug on a clean build by following @monishdeb documentation and can confirm that this patch fixes it. If @KarinG thinks it looks good I think it is ready to be merged. |
Thank you! @alifrumin - I'll will look at it today. |
@monishdeb and @alifrumin - I am trying recreate this but on the user dashboard -> I just have a Print Invoice button [ both on my d47.localhost - as well as on http://dmaster.demo.civicrm.org/civicrm/user?reset=1 ] - any idea as to what I may be missing? Not seeing the Pay Now |
@KarinG in order to get the pay now button on the user dashboard you have to enable deferred payments and set a default page on the civi contribute settings page. I did it on the Jenkins build and will send better documentation in a second when I get to my computer |
Ah - of course... |
Ok reproduced that... |
from there, if you create a pending pay later contribution with a financial type that has taxes, and go to pay for it from the pay now button. It should look good when you pay and on the thank you. BUT when save a contribution that has been taxed twice |
let me know if you have questions.. It took me a minute to recreate too |
Reproduced it -PS: do you know anything about the reasoning behind the fact that in order to get a Pay Now button on the User Dashboard -> one has to enable Deferred Revenue (Accounting)? |
I don't and I had to ask Tommy to figure it out, certainly not super intuitive |
Ok - great - thanks @monishdeb - this PR is working well - I've confirmed for price - and non-priceset scenarios; I'm comfortable with this being merged; Two notes
|
Thanks @alifrumin @KarinG for reviewing it :) Regarding 'Pay Now' button appearance in contact dashboard, it's NOT dependent on Deferred Revenue Accounting any more (this was the PR #11003 which fixed it), but on this setting: |
@eileenmcnaughton can you merge it? |
@monishdeb - Ah great - so one no longer needs to hit the Checkbox Deferred Revenue in order to get to the Default invoice Payment page option. Thanks for pointing to that. |
Merging based on review by @KarinG & @alifrumin |
Overview
Steps to replicate:
Before
The confirm and thank you page shows correct amount i.e $110 but contribution total amount is updated to $121.00(i.e tax is recalculated for $110 + 11 = $121) and also there is unbalance transaction recorded in financial table.
After
Technical Details
Moved the form variable assignment into a separate function that also calculates and set tax amount unlike earlier. Unfortunately, cannot add a unit test to assert the contribution details updated after
CRM_Contribute_Form_Contribution_Confirm
form submission as per 'Pay Now' workflow.