|
|
|
---|
Offline Recurring Contribution Line Item Table | - Create a database table "membershipextras_subscription_line" upon installation of the extension. The database table have following columns:
- contribution_recur_id - integer - required
- line_item_id - integer - required
- auto_renew - boolean
- is_removed - boolean
|
|
Create Line Item for Offline Recurring Contribution and create reference | - Adding a hook or adding into an existing hook so that when a recurring contribution is created using an offline payment processor (payment processor with Payment Manual class):
- create a copy of each line item of a instalment contribution
- the contribution_id of the copied line items should NULL
- a record should be created in "membershipextras_subscription_line" table for each of the copied line item:
- contribution_recur_id - the id of the recurring contribution
- line_item_id - the id of the copied line item
- start_date - start date of the recurring contribution
- end_date - leave empty
- auto_renew - true if the recurring contribution auto-renews, otherwise false
- is_removed - false
|
|
Payment plan period links | - Creating a custom fieldset "Related Payment Plan Periods" for recurring contribution entity. It should contain two read-only integer fields:
- Previous Payment Plan Period
- Next Payment Plan Period
|
|
View/Modify Future Instalments action - current period | - Add a "View/Modify Future Instalments" action to any recurring contribution that uses an offline payment processor (payment processor with payment manual class).
- When the action is selected, a "Manage Instalments" modal popup should appear.
- In the current period tab (default), each "membershipextras_subscription_line" whose start date is not empty and is_removed = false should be displayed. each row should have the following information:
- Item - line item label
- Start date - start_date in membershipextras_subscription_line
- End date -
- Renew automatically - auto_renew in membershipextras_subscription_line. This should not show if the recurring contribution is not auto-renew.
- Financial type - financial type of the line item
- Tax - the tax percentage of the financial type, show N/A if there is no tax account in the financial type
- Amount - line total of the line item
- Remove button - show as bin icon
- An "Add Membership" button and an "Add Other Amount" button should be shown under the last row
- At the bottom of the tab, the following information should be shown:
- Untaxed Amount - total amount of the line_totals
- Tax - total amount of tax_amounts
- Total per instalment - sum of a and b
| |
View/Modify Future Instalments action - next period | - In the "Manage Instalments" modal popup, a next period tab should be shown if the recurring contribution has auto-renew enabled and it has at least one membership.
- In the next period tab (default), each "membershipextras_subscription_line" with auto-renew = TRUE should be displayed. each row should have the following information:
- Item - line item label
- Financial type - financial type of the line item
- Tax - the tax percentage of the financial type, show N/A if there is no tax account in the financial type
- Amount - line total of the line item
- Remove button - show as bin icon
- An "Add Membership" button and an "Add Other Amount" button should be shown under the last row
- At the bottom of the tab, the following information should be shown:
- Untaxed Amount - total amount of the line_totals
- Tax - total amount of tax_amounts
- Total per instalment - sum of a and b
| |
Remove a line from a standard multi-line membership order | - In the "View/Modify Future Instalments" current period tab, user can click on the bin button on each of the line item to perform a removal action.
- Once the bin button is clicked, if the item is the last item in the current period tab, a notice with warning sign should appear with text "Cannot remove the last item in an order" and action should be cancelled.
- Once the bin button is clicked, if the item is not the last item in the current period tab, a dialog with title "Remove LINE_ITEM_LABEL ?" should appear with the following components:
- Adjust end date - checkbox option
- End date - datepicker that should only be shown if "Adjust end date" is checked, default to today's date
- Cancel button
- Apply button
- If user clicked on "Apply":
- auto_renew in membershipextras_subscription_line for the corresponding item should set to False.
- is_removed in membershipextras_subscription_line for the corresponding item should set to True.
- for any "Pending" instalment contribution with "Received Date" equals to or after the end_date, any line_item with same label as the recurring line item should be removed. Contribution amounts should be adjusted.
- if the line item is a membership, update the corresponding membership (linked to the recurring contribution) to have the new end_date and clear the contribution_recurr_id
- a notice should appear with text "LINE_ITEM_LABEL has been removed from the active order."
- a notice should appear with text "LINE_ITEM_LABEL should no longer be continued in the next period."
- the content of "Manage Instalments" modal should be reloaded.
- If user clicked on "Cancel", the action should be cancelled and no change is made.
| |
Remove a line from a standard multi-line membership order - next period only | - In the "View/Modify Future Instalments" next period tab, user can click on the bin button on each of the line item to perform a removal action.
- Once the bin button is clicked, a dialog with title "Remove LINE_ITEM_LABEL ?" should appear with the following components:
- dialog body text - "Please note the changes should take effect immediately after "Apply"."
- Cancel button
- Apply button
- If user clicked on "Apply":
- auto_renew in membershipextras_subscription_line for the corresponding item should set to False.
- is_removed in membershipextras_subscription_line for the corresponding item should set to True.
- if the line item is a membership, clear the contribution_recurr_id of the corresponding membership (linked to the recurring contribution)
- a notice should appear with text "LINE_ITEM_LABEL should no longer be continued in the next period."
- the content of "Manage Instalments" modal should be reloaded.
- If user clicked on "Cancel", the action should be cancelled and no change is made.
- User can also uncheck "Renew automatically" field for any of the line in "Current period" tab to perform the same action. Point 2-4 also apply here.
| |
Add a membership line to a standard multi-line membership order | - In the "View/Modify Future Instalments" current period tab, user can use "Add Membership" and "Add Other Amount" buttons to add line items to the current order.
- Once the "Add Membership" is clicked, a new row should appear in current period tab with the following information:
- Item - required - a dropdown contains all membership types which are not belong to any of the membership organisation for the existing lines
- Start date - required - a datepicker default to today's date. If there is an active membership of the same type, default to the start date of that membership.
- End date - required - a date picker default to biggest end date among all linked memberships
- Renew automatically - a checkbox checked by default, only show if the recurring contribution has auto-renew enabled.
- Financial type - text showing the financial type of the selected membership
- Tax - text showing the tax percentage of the financial type, show N/A if there is no tax account in the financial type
- Amount - required - a money input box defaulted to the minimum_fee of the membership type divided by number_of_instalments.
- cross icon - cancel action
- check icon - confirm action
- When a row is added but not yet confirmed/ cancelled, any parts of the modal popup other then the row itself should be made unclickable. If the user tries to click on any other parts, the row should flash to remind the user an item is yet to be completed.
- If user clicked on cross icon, the row should be cancelled and no change is made.
- When user clicked on the check icon, if there is no "Pending" instalment contribution with "Received Date" equals to or after the today/ start date (whichever is later), a notice with warning sign should appear with text "No outstanding instalment contribution from the selected start date. Suggest to follow the steps below:
1. Add the the item to next period instead. 2. (optional) Create the membership or contribution outside the reucrring order." - When user clicked on the check icon, if there are "Pending" instalment contributions with "Received Date" equals to or after the today/ start date (whichever is later), a dialog with title "Add LINE_ITEM_LABEL ?" should appear with the following components:
- dialog body text - "Please note the changes should take effect immediately after "Apply"."
- a "Adjust the amount of the first instalment" checkbox option.
- a "First instalment amount" money text input. Defaults to the instalment amount. This is only revealed when "Adjust the amount of the first instalment" checkbox is ticked.
- Cancel button
- Apply button
- If user click on "Apply" button:
- a line item with empty contribution_id should be created according to the information user inputted. Note that the tax_amount will calculated by multiplying amount with tax rate.
- a membershipextras_subscription_line should be created linking the line item and the recurring contribution. It's start date should be the selected start date and it's end date should be empty.
- for any "Pending" instalment contribution with "Received Date" equals to or after the today/ start date (whichever is later), a copy of the line_item should be added. Contribution amounts should be adjusted. If "Adjust the amount of the first instalment" is checked, the first "Pending" instalment contribution should apply "First instalment amount".
- if a membership of the same type doesn't yet exist, a new membership should be created with the start date and end date and linked to all "Pending" instalment contribution with "Received Date" equals to or after the today/ start date (whichever is later).
- if a membership of the same type already exists, it should be updated with the new start date and end date and linked to all "Pending" instalment contribution with "Received Date" equals to or after the today/ start date (whichever is later).
- if auto_renew is checked, the auto_renew in membershipextras_subscription_line for the corresponding item should set to TRUE. The membership contribution_recurr_id should be set to the id of the recurring contribution.
- if auto_renew is not checked, the auto_renew in membershipextras_subscription_line for the corresponding item should set to FALSE. The membership contribution_recurr_id should be emptied.
- a notice should appear with text "LINE_ITEM_LABEL has been added to the active order."
- if auto-renew is selected, a notice should appear with text "LINE_ITEM_LABEL will now be continued in the next period."
- the content of "Manage Instalments" modal should be reloaded.
- If user clicked on "Cancel", the action should be cancelled and no change is made.
| |
Add an other amount line to a standard multi-line membership order | - In the "View/Modify Future Instalments" current period tab, user can use "Add Membership" and "Add Other Amount" buttons to add line items to the current order.
- Once the "Add Other Amount" is clicked, a new row should appear in current period tab with the following information:
- Item - required - a text box
- Start date - required - a datepicker default to today's date.
- End date - text "N/A"
- Renew automatically - a checkbox checked by default, only show if the recurring contribution has auto-renew enabled.
- Financial type - select list with all available financial types
- Tax - text showing the tax percentage of the selected financial type, show N/A if there is no tax account in the selected financial type
- Amount - required - a money input box
- cross icon - cancel action
- check icon - confirm action
- When a row is added but not yet confirmed/ cancelled, any parts of the modal popup other then the row itself should be made unclickable. If the user tries to click on any other parts, the row should flash to remind the user an item is yet to be completed.
- If user clicked on cross icon, the row should be cancelled and no change is made.
- When user clicked on the check icon, if there is no "Pending" instalment contribution with "Received Date" equals to or after the today/ start date (whichever is later), a notice with warning sign should appear with text "There are no instalments left for this period. Suggest to follow the steps below:
1. Add the the item to the next period. 2. (optional) Create the membership or a one-off contribution outside the recurring order." - When user clicked on the check icon, if there are "Pending" instalment contributions with "Received Date" equals to or after the today/ start date (whichever is later), a dialog with title "Add LINE_ITEM_LABEL ?" should appear with the following components:
- dialog body text - "Please note the changes should take effect immediately after "Apply"."
- a "Adjust the amount of the first instalment" checkbox option.
- a "First instalment amount" money text input. Defaults to the instalment amount. This is only revealed when "Adjust the amount of the first instalment" checkbox is ticked.
- Cancel button
- Apply button
- If user click on "Apply" button:
- a line item with empty contribution_id should be created according to the information user inputted. Note that the tax_amount will calculated by multiplying amount with tax rate.
- a membershipextras_subscription_line should be created linking the line item and the recurring contribution. It's start date should be the selected start date and it's end date should be empty.
- for any "Pending" instalment contribution with "Received Date" equals to or after the today/ start date (whichever is later), a copy of the line_item should be added. Contribution amounts should be adjusted. If "Adjust the amount of the first instalment" is checked, the first "Pending" instalment contribution should apply "First instalment amount".
- if auto_renew is checked, the auto_renew in membershipextras_subscription_line for the corresponding item should set to TRUE. Otherwise FALSE.
- a notice should appear with text "LINE_ITEM_LABEL has been added to the active order."
- if auto-renew is selected, a notice should appear with text "LINE_ITEM_LABEL will now be continued in the next period."
- the content of "Manage Instalments" modal should be reloaded.
- If user clicked on "Cancel", the action should be cancelled and no change is made.
| |
Add a membership line to a standard multi-line membership order - next period only | - In the "View/Modify Future Instalments" next period tab, user can use "Add Membership" and "Add Other Amount" buttons to add line items to the current order.
- Once the "Add Membership" is clicked, a new row should appear in next period tab with the following information:
- Item - required - a dropdown contains all membership types which are not belong to any of the membership organisation for the existing lines
- Financial type - text showing the financial type of the selected membership
- Tax - text showing the tax percentage of the financial type, show N/A if there is no tax account in the financial type
- Amount - required - a money input box defaulted to the minimum_fee of the membership type divided by number_of_instalments.
- cross icon - cancel action
- check icon - confirm action
- When a row is added but not yet confirmed/ cancelled, any parts of the modal popup other then the row itself should be made unclickable. If the user tries to click on any other parts, the row should flash to remind the user an item is yet to be completed.
- If user clicked on cross icon, the row should be cancelled and no change is made.
- When user clicked on the check icon, a dialog with title "Add LINE_ITEM_LABEL ?" should appear with the following components:
- dialog body text - "Please note the changes should take effect immediately after "Apply"."
- Cancel button
- Apply button
- If user click on "Apply" button:
- a line item with empty contribution_id should be created according to the information user inputted. Note that the tax_amount will calculated by multiplying amount with tax rate.
- a membershipextras_subscription_line should be created linking the line item and the recurring contribution. It's start date and end date should be empty.
- a notice should appear with text "LINE_ITEM_LABEL will now be continued in the next period."
- the content of "Manage Instalments" modal should be reloaded.
- If user clicked on "Cancel", the action should be cancelled and no change is made.
- User can also check "Renew automatically" field for any of membership lines in "Current period" tab to perform the same action. A notice with warning sign will appear with text "This membership type is already enrolled in next period." when there is another membershipextras_subscription_line:
- linked to a line item with same membership type and membershipextras_subscription_line
- end date is empty
- auto-renew is TRUE
- If user checks the "Renew automatically" field for any of membership lines in "Current period" tab and the scenario in point 8 does not apply, point 5-7 should apply here.
| |
Add an other amount line to a standard multi-line membership order - next period only | - In the "View/Modify Future Instalments" next period tab, user can use "Add Membership" and "Add Other Amount" buttons to add line items to the current order.
- Once the "Add Other Amount" is clicked, a new row should appear in next period tab with the following information:
- Item - required - a text box
- Financial type - select list with all available financial types
- Tax - text showing the tax percentage of the selected financial type, show N/A if there is no tax account in the selected financial type
- Amount - required - a money input box
- cross icon - cancel action
- check icon - confirm action
- When a row is added but not yet confirmed/ cancelled, any parts of the modal popup other then the row itself should be made unclickable. If the user tries to click on any other parts, the row should flash to remind the user an item is yet to be completed.
- If user clicked on cross icon, the row should be cancelled and no change is made.
- When user clicked on the check icon, a dialog with title "Add LINE_ITEM_LABEL ?" should appear with the following components:
- dialog body text - "Please note the changes should take effect immediately after "Apply"."
- Cancel button
- Apply button
- If user click on "Apply" button:
- a line item with empty contribution_id should be created according to the information user inputted. Note that the tax_amount will calculated by multiplying amount with tax rate.
- a membershipextras_subscription_line should be created linking the line item and the recurring contribution. It's start date and end date should be empty.
- a notice should appear with text "LINE_ITEM_LABEL will now be continued in the next period."
- the content of "Manage Instalments" modal should be reloaded.
- If user clicked on "Cancel", the action should be cancelled and no change is made.
- User can also check "Renew automatically" field for any of other amount lines in "Current period" tab to perform the same action. Point 5-7 also apply here.
| |
Set subscription line end date | - When a payment plan is marked as completed, all lines that meet the below conditions should have their end date set to the payment plan end date:
- start date is not empty
- end date is empty
|
|
Upgrader | Part 1: - As a part of phase 3 upgrader, the extension should find all pre-existing offline payment plans and populate the "Offline Recurring Contribution Line Item" information for them.
- For each pre-existing recurring contribution using an offline payment processor (payment processor with Payment Manual class):
- create a copy of each line item of the last instalment contribution
- the contribution_id of the copied line items should NULL
- a record should be created in "membershipextras_subscription_line" table for each of the copied line item:
- contribution_recur_id - the id of the recurring contribution
- line_item_id - the id of the copied line item
- start_date - start date of the recurring contribution
- end_date - end date of the recurring contribution. If empty, leave empty.
- auto_renew - true if the recurring contribution auto-renews, otherwise false
- is_removed - False
Part 2: - As a part of phase 3 upgrader, the extension should find all pre-existing payment plans that meet the criteria below and populate the "Related Payment Plan Periods" for them.
- payment plan that uses an offline payment processor (payment processor with Payment Manual class)
- payment plan whose number of instalment is larger than 0
- payment plan whose end date is not empty and is more a month earlier than toady
- payment plans whose auto-renew is set to True
- the contact has more than one payment plans that meet criteria a, b and c
- Find all memberships that are linked to payment plan that meets the criteria. Fill in the "Previous Payment Plan Period" and "Next Payment Plan Period" with number 0.
- This needs to be part of the installer too.
(ON HOLD) Part 3: - As a part of phase 3 upgrader, the extension should find all pre-existing payment plans that meet the criteria below and populate the "Related Payment Plan Periods" for them.
- any payment plans that use an offline payment processor (payment processor with Payment Manual class)
- any payment plan whose number of instalment is larger than 0
- any payment plans whose auto-renew is set to True
- the contact has more than one payment plans that meet criteria a, b and c
- Find all memberships that are linked to payment plan that meets the criteria. If two payment plans are linked to the same membership, fill in the "Previous Payment Plan Period" and "Next Payment Plan Period" with the ID of the payment plans according to payment plan start dates.
Note: we probably don't need to populate any records on installation of the extension since there should not be any offline payment plans without using the extension. If there is, it is probably not created by our extension, so it is probably safe to not populate records for them. |
|
Auto-renew adjustment for payment plans with instalments | - When "Renew offline auto-renewal memberships" scheduled job is run, it finds and processes any recurring contribution that meets all following conditions:
it is using an offline payment processor (payment manual class) - has an end date
it is set to auto-renew it is not in status cancelled - number of instalments is not 0 or null
- it's "Next Payment Plan Period" is empty
has any linked membership that meets the following conditions: end date is equal to or smaller than today - the membership's type matches with any "membershipextras_subscription_line" that is auto-renew and not is_removed
- if the job finds any payment plan that meets the conditions in point 1:
- a new recurring contribution should be created using the existing recurring contribution as a template (unchanged from phase 2)
- The "Next Payment Plan Period" of the template recurring contribution should be filled with the id of the new recurring contribution
- The "Previous Payment Plan Period" of the new recurring contribution should be filled with the id of the template recurring contribution
- for each membershipextras_subscription_line which is auto-renew and not is_removed in the template recurring contribution:
- make a copy of the linked line item and link it to the new recurring contribution
- make a copy of the membershipextras_subscription_line and link it to the new recurring contribution. The copied membershipextras_subscription_line should have same start date as the recurring contribution and empty end date.
- use the last instalment as a template to create the instalments for the new recurring contribution:
- All information excepts the amount fields and line items should be generated the same way they are being generated in phase 2
- Each instalments should contain a copy of the auto-renew line items linked to the membershipextras_subscription_line
- the amount fields should reflect the actual amount based on the line items
- for each membership line items:
- if the user already have a membership with same type, extend that membership for a term
- if the user do not have any membership with same type, a new membership need to be created with start date of the recurring contribution start date.
|
|
Auto-renew adjustment for payment plans without instalments | - When "Renew offline auto-renewal memberships" scheduled job is run, it finds and processes any recurring contribution that meets all following conditions:
it is using an offline payment processor (payment manual class) - has an end date
it is set to auto-renew it is not in status cancelled - number of instalments is 0 or null
has any linked membership that meets the following conditions: end date is equal to or smaller than today - the membership's type matches with any "membershipextras_subscription_line" that is auto-renew and not is_removed
- if the job finds any payment plan that meets the conditions in point 1:
- for each membershipextras_subscription_line which is auto-renew and not is_removed in the recurring contribution:
- make a copy of the linked line item and link it to the recurring contribution
- make a copy of the membershipextras_subscription_line and link it to the recurring contribution. The start date of the copied membershipextras_subscription_line should be the received date of the last instalment plus one interval. the end date should be empty.
- the end date of the original membershipextras_subscription_line should be 1 day earlier than the new membershipextras_subscription_line's start date.
- use the last instalment as a template to create a new pending instalment contribution under the same recurring contribution:
- All information excepts the amount fields and line items should be generated the same way they are being generated in phase 2
- Each instalments should contain a copy of the auto-renew line items linked to the membershipextras_subscription_line
- the amount fields should reflect the actual amount based on the line items
- for each membership line items:
- if the user already have a membership with same type, extend that membership for a term
- if the user do not have any membership with same type, a new membership need to be created with start date of the recurring contribution start date.
|
|
Price auto-update | In the auto-renew process, if price auto-update is turned on and a membership is not opt-out of the price auto-update, the new/ copied line item for the membership should reflect the latest minimum membership price configured in the membership type. |
|