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

Deleting pledge payment (contribution) makes pledge inconsistent?

    Details

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

      Description

      When deleting a contribution record, check to see if the contribution is linked to a Pledge Payment (i.e. check for matching civicrm_pledge_payment.contribution_id value). If found, we will reset the status of the pledge payment to Pending and unlink it from the contribution. Specific steps:

      • set pledge_payment.contribution_id NULL
      • set pledge_payment.status_id = "Pending" (get id value)
      • if no OTHER payments have been completed on this pledge, and the current status is "In Progress", set the pledge status to "Pending"

      — Bug report (how to recreate) from Michal —
      Testcase (with vanilla example data):

      1. Go to CiviPledge, one of "In Progress" example pledges has 4 transactions, one of them paid, three still scheduled. Make note about the paid transaction.
      2. Go to appropriate contact record, contribution tab and delete the contribution that you just saw.

      Now, potential problems that look to me as inconsistencies:

      1. Pledge is still "In Progress", although it has only three scheduled payments. The comment on Pledge edit screen claims that: "Pledges are "Pending" until the first payment is received. Once a payment is received, status is "In Progress" until all scheduled payments are completed."

      2. After deleting the payment, it also disappears from pledge schedule (original pledge had 4 payments, after deleting the one which was paid already, pledge has 3 only). The total pledge amount doesn't match the sum of scheduled payments, that's the most obvious problem.

        Attachments

          Activity

            People

            • Assignee:
              sunil Sunil Pawar
              Reporter:
              mover Michał Mach
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 2 hours
                2h
                Remaining:
                Remaining Estimate - 2 hours
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified