3. Payment Plan/ Instalments (Phase 4-)

Phase 4 - Membership Periods

Requirement/ user storySpecificationNotes and Wireframes
As a staff member, I want to see all different membership types that a contact holds so that I can have an overview of the current and past membership levels this contact have.
The memberships a contact holds should reflect each different membership type.

Option 1: When a membership is added to a contact, if the contact does not hold any membership of the same type, a new membership should be created. Otherwise the membership with the same type should be extended/ updated.

Option 2 (minimal): Do not change the current way CiviCRM creates membership records but fix any potential webform and reporting problems caused by that.

(Nice to have) Allow creating overlapped memberships from the same organisation in CiviCRM back-office.

As a staff member, I want to record the period of each membership so that I can view the complete history of exact dates of signup, renewal and end, and any gaps in the membership where it is cancelled or paused.
Membership period schema
  1. Create a database table "membershipextras_membership_period" upon installation of the extension. The database table have following columns: 
    1. id - primary key - required
    2. membership_id - foreign key to membership entity - required
    3. period_start_date - date when the membership period starts
    4. period_end_date - date when the membership period ends
    5. payment_entity_table - civicrm_contribution or civicrm_contribution_recur
    6. payment_entity_id - id of the payment entity
    7. is_activated - whether the period has taken effect or not
    8. is_historic - whether it is an historical period created before the membership extras is installed



Membership signup
  1. Every time a new membership is signed up, a new membership period should also be created under that membership.
  2. Period start date and period end date should be the membership start date and end date.
  3. Payment entity should be recurring contribution if paid via payment plan. Otherwise it should be contribution

Membership renewal (upgrade/ downgrade/ renew same type)
  1. Every time a membership is renewed, a new membership period should also be created under that membership.
  2. Period start date should be today or a day after the last active period end date whichever is later. Period end date should period start date plus the length of a full term.
  3. The user should be able to manually set the date for renewal.
  4. Within a membership, there cannot be two overlapped active periods.

As a staff member, I want to be able to keep memberships and membership periods up to date so that I can maintain an accurate membership history.
Edit membership periods
  1. Allow updating the dates of each membership period.
  2. Within a membership, there cannot be two overlapped active periods.
  3. When a period is updated, the membership dates and status should be updated accordingly.


Admin should no longer be able to edit membership dates when editing a membership.
Cancel membership periods

Allow deactivating membership periods


If a payment for an active membership period is overdue for a certain length of time, the membership period should be cancelled.

Create a setting that allows staff to set the number of days after a payment is overdue that a membership period should become inactive.



Create a setting that allows staff to set the number of days after a payment is overdue that a membership period end date should be adjusted.
Delete membership periodsAllow deleting membership periods.Permission
As a staff member, I want to see the period of each membership signup and renewal so that I can know the complete membership history of this contact.
Display membership periods (pending wireframes)
  1. Membership periods should be nested under each membership type.
  2. (Could have) Ideally when staff see a membership, they should be able to drill down to the membership periods.
  3. (Would like to have but not this time) Membership period gantt chart


As a customer, I want my membership activated immediately after purchase so I can start using my membership on the day of the signup.
If a membership is paid via Direct Debit, the membership should be activated immediately.Create a setting that allows staff to specify a list of payment methods. If any membership order is made via these payment methods, the membership period should be activated even if the payment hasn't been completed.
Installation and uninstallation
Upgrader
  1. Add an upgrader to the extension to install the membershipextras_membership_period table for existing installations
  2. The upgrader should also generate a historic period for each membership record in membership table

UninstallerTBC

TBC - Contribution Page Support


Spec
Wireframes and notes
Contibutuon Page Configuration
  1. On contribution page "Memberships" tab, add a checkbox option "Enable Payment Plan Options".
  2. If "Enable Payment Plan Options" is checked, the following configurations are reviewed:
    1. Disable pay by one off contribution
    2. Payment plan options
  3. With "Disable pay by one off contribution" option allows admin to prevent customers to pay for the membership in a one off full contribution as usual.
  4. Payment plan options is a table with all available payment plan options listed as rows with the following columns:
    1. Enabled? - whether the payment plan option is available to user
    2. Recurring Unit - the unit that should be used to calculate the interval. It should have the following options: day, week, month and year
    3. Recurring Interval - the number of interval units
    4. Status Override? - whether using this payment plan option will override ths status of the membership or not. The admin will be able to choose from: No, Override Permanently and Override to until selected date. If the Admin chose "Override to until selected date", two options will be provided:
      1. Specific date: this option will bring up an extra datepicker to allow admin to pick a date
      2. Contribution date + days: this option will bring up an extra number field to allow admin to define how many days after the contribution dates the override should expire.
    5. Instalment Number - number of instalments the full amount should be split into
  5. Admin can use the "Add more" button below the table to add a new row to the payment plan table.
  6. A new payment plan option will have all columns in edit state. Admin will be able to save the option after Recurring Unit, Recurring Interval and Instalment Number are filled out. Alternatively, they can click on cancel link to discard the row.
  7. Admin can also edit or delete existing payment options.

Contribution Page for Users
  1. If "Enable Payment Plan Options" is checked, a new "Payment and Instalment" section will appear above payment processor selection section.
  2. A "Full Payment" option and all enabled payment plan options will appear as radio button options under "Payment and Instalment" section.
  3. If "Disable pay by one off contribution" is checked, the "Full Payment" option will not be shown.
  4. If the user chose "Full Payment", the membership and a single contribution will be created as per current contribution page behaviour.
  5. If the user chose any payment plan option with pay later:
    1. a pending membership will be created with a payment plan stating the amount and inverval specified by admin
    2. all instalment contribution will be generated linking to the payment plan and membership. Status of all instalment contribution will be pending.
    3. If "Status Override" of the payment plan option is set to "No", the membership will be pending until the any contribution is marked as completed.
    4. If "Status Override" of the payment plan option is set to "Override permanently", the membership will be set to the status specified by the admin until the override is cancelled by the admin.
    5. If "Status Override" of the payment plan option is set to "Override until the selected date", the membership will be set to the status specified by the admin until the date admin appointed.
  6. If the user chose any payment plan option with payment processor other than pay later, the membership and the recurring contribution will be created as per current webform civicrm behaviour.
  7. If the auto-renew option is checked:
    1. If the user chose "Full Payment", a recurring contribution will be created with auto-renew marked as true and instalment = NULL;
    2. If the user chose any payment plan option, the recurring contribution's auto-renew field will be marked as true.

Confirmation Page
  1. A new "Payment and Instalment" section will appear above payment processor selection section. It will display the payment plan option the user chose.
  2. If the user chose to pay with one of the payment plan option, a payment plan summary section will be added underneath the item summary. The payment plan summary section will display:
    1. a summary of how the payment plan will be fulfilled. e.g. "A total of £120 are to be paid in 12 instalments on every 6st day of the month."
    2. a first instalment summary showing the invoice date (contribution received) and the total amount of the instalment.

System emailsTBC

Features for later

  • Maybe add a new status override option in the future that will cancel itself based on certain status update of linked contribution
  • Currently CiviCRM records a line item with quantity = 1 even when more than one terms are sold. In the future, CiviCRM should record a line item with quantity = number of terms and unit price = total amount/ No. of terms.