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

Changing membership type should change related contribution


    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Important
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7.16
    • Fix Version/s: 4.7.24
    • Component/s: None
    • Labels:
    • Versioning Impact:
      Minor (add functionality in backwards-compatible manner)
    • Documentation Required?:
      User and Admin Doc
    • Funding Source:
      Needs Funding
    • Verified?:


      Suppose Membership Type A is configured with Financial Type A and Membership Type B is configured with Financial Type B. When a membership of type A is changed to a membership of type B, currently an informational message is popped up regarding the possibility the user may want to update the financial type of the related contribution. This was a quick and dirty work-around to handle not having enough budget to implement it properly.

      NB: Fixing it could be considered either a bug fix or a minor enhancement or a breaking change...not sure which categorization is best. I'm not sure how much unapproved scope would be added by requiring this to be an extension.

      IIDA has asked for this as a fix to core, but I'd like feedback before implementing.

      1. Add a CiviMember Component Setting, 'Automatically update related contributions when Membership Type is changed'.
      2. When editing a Membership, if the membership type changes and there is either a change in the financial type or a change in the cost of the membership, on save, in place of the existing warnings (see attached image), display the new message (also attached).
      When 1) is true, change the contribution's line item's financial type as appropriate when membership type of a membership changes through browser. If the contribution has only a single line item, change the contribution's financial type as well. As part of updating the contribution's line item's financial type, the current code should create appropriate -ve / +ve transactions in financial_trxn and financial_item and entity_financial_trxn tables as per https://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+Data+Flow#CiviAccountsDataFlow-Changecontributionfinancialtype(backofficeform). If Deferred revenue is enabled, deferred revenue transactions should also be appropriately cancelled and reposted.
      3. When 1) is true, change the contribution line item's amount as appropriate and change the total for the contribution as well. These amount changes should result in related changes of Contribution status to Partially Paid or overpaid, as well as updating the relevant financial item's status.

      Excluded from scope:
      1) Pro-rating the difference in cost of the membership according to how much of the membership year has already passed.
      2) Editing the price of the new membership type before it is saved.
      3) When membership type is changed in the middle of the membership year, leaving the revenue already recognized for existing type alone, and only changing the account for current and future months.

      Brian Shaughnessy this is IIDA-65.


        1. 2017-03-28_12-52-27.png
          79 kB
          Joe Murray
        2. 2017-03-28_13-04-27.png
          49 kB
          Joe Murray
        3. image-2017-04-24-16-35-29-467.png
          38 kB



            • Assignee:
              monish.deb Monish Deb
              joemurray Joe Murray
            • Votes:
              0 Vote for this issue
              5 Start watching this issue


              • Created: