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

CRM-21245: Incorrect Contribution status 'Pending Refund' #11077

Merged
merged 1 commit into from
Dec 18, 2017

Conversation

monishdeb
Copy link
Member

@monishdeb monishdeb commented Oct 6, 2017

Overview

Steps to replicate:
If the participant is registered to an event by admin in backend and event has 3 selections:

  1. 1st - $1500.00
  2. 2nd - $1200.00
    At first '1st' selection was made and partial payment of $500.00 was made, then event participation summary is viewed, it shows correct status. Screenshot: http://prntscr.com/gsfokn
    Now when selection is changed to '2nd' still contact owes $700 but system says the payment status to be "Pending refund". Screenshot: http://prntscr.com/gsfpgg

Before

Contribution status is updated to 'Pending Refund' - Incorrect.
https://www.screencast.com/t/cOfGhsHgQJe

After

Contribution status is retained to 'Partially Paid' - Correct.
event-pending-refund-after


@monishdeb
Copy link
Member Author

Added, unit test is supposed to fail as it depends on #10962. Reason why I am marking it with [WIP]

@monishdeb monishdeb removed the needs-work-not-review-ready Submitter required to take action, will be closed after 1-2 weeks in this state label Dec 18, 2017
@monishdeb
Copy link
Member Author

@eileenmcnaughton this PR is ready for QA and also got unit tests.

@eileenmcnaughton
Copy link
Contributor

There is a lot to like about this PR. It simplifies code, adds a test & fixes a problem!

I think the fact that this was fixed through simplifying & relying on the fee change logic speaks to the fact the previous changes in this area were on the right track.

Merging

@eileenmcnaughton eileenmcnaughton merged commit 05c52f0 into civicrm:master Dec 18, 2017
@monishdeb monishdeb deleted the CRM-21245 branch December 19, 2017 06:24
sluc23 pushed a commit to ixiam/civicrm-core that referenced this pull request Jan 10, 2018
CRM-21245: Incorrect Contribution status 'Pending Refund'
@agh1
Copy link
Contributor

agh1 commented Feb 7, 2018

It appears that the reverse problem is now happening in the 4.7.30 RC. If you create a participant record with a partial payment, and you edit the selections for the participant record to be the same or lower amount than the payments, the participant record still says "partially paid" when it should be "completed" or "pending refund".

@monishdeb
Copy link
Member Author

monishdeb commented Feb 7, 2018

@agh1 isn't that obvious because the original amount was partial and after edit we are not paying rest but rather keeping the same partial amount or lower then it, which is itself a partial amount?

@eileenmcnaughton what do you think?

@eileenmcnaughton
Copy link
Contributor

So on this form (yay) we can edit the amount to be paid and the amount paid separately.

We should be calculating payment status by what portion of the amount has been paid

paid < due = 'Partially paid'
paid = due = 'Completed'
paid > due = 'Pending refund'

THis is REALLY late in the rc to pick this up - my sense is it's obscure enough to review for 4.7.31 rather than revert + review for 4.7.31? (@agh1 )

@agh1
Copy link
Contributor

agh1 commented Feb 7, 2018

Yeah, I wasn't proposing changing anything for 4.7.30--sorry I wasn't clear. I do think this fixes a bug; it just causes a slightly less likely one in the process.

Here's the workflow I was trying:

  1. Register someone for the Rainforest Cup at $1,500 and pay only $1,200.
  2. Change the fee selection to be $1,000.
  3. It should say "pending refund" at this point, but it now says "partially paid".

Another issue (maybe separate) is in the process when I try to record a partial payment from the backend, I get the following popup message:

Payment amount is less than the amount owed. Expected participant status is 'Partially paid'. Are you sure you want to set the participant status to ? Click OK to continue, Cancel to change your entries.

This is the case regardless of what the participant status is.

@pradpnayak
Copy link
Contributor

@agh1 According to your workflow the contribution status should be 'Pending refund' since you have already paid $1,200 and you have updated the line item so that the total amount is now $1,000. Therefore the contribution status should be 'Pending refund' with $200.

@eileenmcnaughton
Copy link
Contributor

@agh1 @pradpnayak @monishdeb looks like the behaviour is agreed & there is a bug remaining so perhaps open a new ticket for it?

@monishdeb
Copy link
Member Author

Yup will submit a separate PR for that. @agh1 can you please create a new ticket?

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.

5 participants