Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-13973

Change event registration selections for an existing participant (back-office)

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.5
    • Fix Version/s: 4.5
    • Component/s: CiviContribute, CiviEvent
    • Labels:
      None

      Description

      -------------
      Summary
      -------------
      Back-office staff may:

      • Update event registration selections for an existing participant.
      • Record a payment or a refund if the participant has already paid AND the new fee total is different the original payment
      • The contribution amount will adjusted to the new amount owing, as appropriate.
      • If amount owing is greater than amount paid, contribution and participant status will be set to "Partially paid". User can over-ride participant status on the form.
      • If amount owing is less than amount paid, contribution and participant status will be set to "Pending refund". User can over-ride participant status on the form.

      ---------------------
      Implementation
      ----------------------
      1. Add new activity type - Change Registration. Reserved=True, Component=CiviEvent, Description="Changes to an existing event registration."

      • add to civicrm_data.tpl
      • insert for upgrades


      2. Edit Participant / View Participant forms

      • Add a button below the line-item table: "Change Selections"
        (see screenshot EditRegistration.png).
      • Button click redirects to a new Change Registration Selections form, passing contact ID and participant ID in the URL.


      3. Change Registration Selections form
      3.1 New form class (see screenshot attached - ChangeRegistrationSelections.png)

      • Read-only fields for participant display name, event title and event date
      • Read-only display of existing line-items and Event Total amount
      • Embeds the existing price set form snippet
      • Below price set form, 3 additional read-only fields; Total Fees (dynamically calculated based on price set form selections); Total Paid (same as Event Fees above); Balance (=Total Fees - Total Paid, may be negative in refund case)
      • Participant Status field (default to existing status)
      • Participant Confirmation and Notes fields
      • Submit buttons are 'Save' and 'Save and Record Payment'

      Client Side form behaviors (jQuery)
      ------------------------------------------------

      • If calculated Balance is positive, set Participant Status to 'Partially paid' (user MAY override this and change it to something else later)
      • If calculated Balance is negative, set Participant Status to 'Pending refund' (user MAY override this and change it to something else later)
      • When user clicks "Save" if the Balance is positive AND the participant status != 'Partially paid', put up a jScript confirm dialog:
        "Balance is owing for the updated selections. Expected participant status is 'Partially paid'. Are you sure you want to set the participant status to $statusLabel? Click OK to continue, Cancel to change your entries."
      • When user clicks "Save" if the Balance is negative AND the participant status != 'Pending refund', put up a jScript confirm dialog:
        "Balance is overpaid for the updated selections. Expected participant status is 'Pending refund'. Are you sure you want to set the participant status to $statusLabel? Click OK to continue, Cancel to change your entries."

      3.2 Pre process

      • If related participant (contact) does not have a valid email address, display status re: can not send a confirmation and hide the Send Confirmation and From fields (same as existing event registration form).

      3.3 Post Process

      • Update and insert line_item rows as needed. If an existing line_item is no longer selected, set QTY and LINE_TOTAL to 0 rather than deleting the line_item
      • If new fee total is != to total paid:
      • Insert financial_trxn and entity_financial_trxn for adjustment to total contribution amount.
      • Update contribution amount to new Total Fee(s) amount.
      • Update contribution status to 'Partially paid' if Balance is positive. Update to 'Pending refund' if Balance is negative.
      • If [x] Send Confirmation is checked - trigger the existing Event Confirmation (offline) message template. User is responsible for explaining that this is a 'change notification' in their confirmation message.
      • Create new activity (type = Change Registration). Data pattern similar to Contribution activity:
        Source Contact = logged in user's contact
        Target Contact = payee contact
        Subject = "Registration selections changed for $eventTitle - $eventDate"
      • If 'Save and Record Payment' button is clicked, redirect to Financial Transaction form after save, pass contact ID and participant ID.
      • Cancel on form should return to last form or page that the user was on. Successful submit should return to contact's Event tab.


      4. Tests
      4.1 Extend existing Event (participant) and Financial BAO tests to cover changing registration selections for a participant record. Check for expected participant and contribution status changes as well as expected new activity record.

      4.2 Extend existing Event (participant) and Financial BAO tests to cover recording 'refund' for a 'Pending refund' participant record. Check for expected participant and contribution status changes as well as expected new activity record.

      4.3 Create web-tests which covers the change selections flow (no fee change, balance owed, and refund due cases).

        Attachments

        1. afterChangeAndPayment.PNG
          42 kB
          David Greenberg
        2. afterChangeBalanceOwed.PNG
          42 kB
          David Greenberg
        3. ChangeRegistrationSelections.PNG
          111 kB
          David Greenberg
        4. EditRegistration.PNG
          78 kB
          David Greenberg
        5. extra200FinTrxn_AR-account.PNG
          45 kB
          David Greenberg
        6. extra200PaymentListed.PNG
          44 kB
          David Greenberg
        7. extraFinancialItem.PNG
          41 kB
          David Greenberg
        8. extraLineItem.PNG
          36 kB
          David Greenberg
        9. FeeLevel-Junior_AmountWrong.PNG
          18 kB
          David Greenberg
        10. missingSelectionsTable_editParticipant.PNG
          70 kB
          David Greenberg
        11. PayLater1-BeforeChangeSelections.PNG
          116 kB
          David Greenberg
        12. PayLater2-ChangeSelections.PNG
          84 kB
          David Greenberg
        13. PayLater3-AfterChangeSelections.PNG
          128 kB
          David Greenberg
        14. postProcessBug_ChangeSelections.PNG
          80 kB
          David Greenberg
        15. postProcessBug_ContributionRecord.PNG
          77 kB
          David Greenberg
        16. postProcessBug_priceFields.PNG
          43 kB
          David Greenberg
        17. postProcessBug_viewAfterChangeSelections.PNG
          75 kB
          David Greenberg
        18. postProcessBug_viewBeforeChangeSelections.PNG
          80 kB
          David Greenberg
        19. registration1.JPG
          60 kB
          Joanne Chester
        20. registration2 showing change before saving.JPG
          74 kB
          Joanne Chester
        21. Registration3 shows screen that appears after selecting save and record payment.JPG
          74 kB
          Joanne Chester
        22. Screen Shot 2014-03-12 at 4.17.08 PM.PNG
          24 kB
          David Greenberg
        23. Screen Shot 2014-03-12 at 4.21.56 PM.PNG
          95 kB
          David Greenberg
        24. Screen Shot 2014-03-12 at 4.23.21 PM.PNG
          103 kB
          David Greenberg
        25. Screen Shot 2014-03-12 at 5.02.29 PM.PNG
          40 kB
          David Greenberg

          Issue Links

            Activity

              People

              • Assignee:
                pratik.joshi Pratik Joshi
                Reporter:
                dgg David Greenberg
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 days, 2 hours, 30 minutes
                  4d 2h 30m