How to convert plans and subscriptions to a configuration with no included resources
Original Publishing Date:
2020-01-22
Starting from Odin Automation 7.4, an additional resource with a minimum purchase amount is configured without requiring the inclusion of such a resource in a service plan:
-
For a resource, it is possible to set the Included Amount to either zero or no less than the Minimum Amount.
Example: For a resource, a provider can set Included Amount = 0 and Minimum Amount = 1, or Included Amount = 1 and Minimum Amount = 1.
- When subscribing to a service, a customer must purchase at least the minimum amount of each such resource. If a customer does not select an amount of such a resource, OA Billing will automatically add the minimum amount of the resource to an order and warn the customer at the checkout screen.
To migrate configured service plans and subscriptions to the new scheme the base_item_migration.py
script was developed. Download the script.
What the script does
The script performs the following changes to a plan configuration and subscription:
Service plan:
- The Recurring Fee and Setup Fee are set to zero in Subscription Periods.
- The minimum amount of a “License” resource rate is set to the same as the Included Amount value. The included value of the “License” resource rate is set to zero.
Subscription:
- The Setup Fee and Recurring Fee of a subscription are set to zero.
-
The amount of a “License” resource is increased for the Included Amount value. Minimum Amount value is set equal to an Included Amount value. The included value of the resource is set to zero.
Note: A “License” resource has a non-zero Included Amount + Maximum Amount > Included Amount. A resource price cannot be zero.
How to migrate
To migrate your configured product catalog to the new scheme, perform the following actions:
-
Run the pre-check
Use the --precheck
parameter to receive a summary of the proposed migration. The pre-check does not perform any changes and can be run without any risk.
# python base_item_migration.py --precheck
-
Perform a dry run
Use the --dry-run
parameter to perform a migration without committing changes. Pending changes are saved to the /logs/scripts/base_item_dry_run.csv
file.
# python base_item_migration.py --dry-run
-
Perform a migration
Use the --migrate-from-csv
parameter to migrate plans listed in the base_item_dry_run.csv
file together with subscriptions based on these plans. For each migrated plan, you can set a custom Subscription Period fee for a specific child plan.
New Subscription Period fees can be set in the CSV file to be applied during the migration. No other changes from the CSV file are applied.
# python base_item_migration.py --migrate-from-csv
Note: Plans and subscriptions based on these plans are not migrated if a promotion for a plan is set up with the following parameters:
- Status: Active
- Applicability: Applicable To Renewal
- Price Type: Fixed Price
Note: If a subscription does not meet the defined criteria, it will be omitted from the migration and saved to the base_item_skipped_subscr.csv
file. After migration blocking issues are resolved you can re-run the migration script. See below.
Additional options
-
Use the --resource-id
parameter to perform a migration based on a resource with a specified ID.
This optional parameter is required to determine a “License” resource to migrate plans or subscriptions that have more than one resource which meet the default criterion: a “License” resource has a non-zero Included Amount + Maximum Amount > Included Amount. A resource price cannot be zero.
Therefore, resource limits will be updated for a resource rate linked with a passed resource ID.
Note: Composite resources are not supported, that is, a “regular” resource must be passed.
-
Use the --ignore-order-statuses
parameter to migrate subscriptions with orders in specified statuses.
This is an optional parameter. By default, the script ignores orders in statuses “CP”, “CL”, “WI”, and Billing orders in the “WP” status. Passed statuses are applied to all order types. A status must be passed in two-letter format, case-insensitive.
Note: You can find all available order statuses in the PCP at Billing > System > Settings > Order Processing > Order Flow > select order type > Order Statuses.
-
Use the --reprocess-skipped
parameter to migrate subscriptions listed in the /logs/scripts/base_item_skipped_subscr.csv
file.
Subscriptions that do not meet the criteria defined below are not migrated. They are saved to the base_item_skipped_subscr.csv
file to be reprocessed later.
The following subscriptions are not suitable for migration:
- with errors during migration
- with non-“Active” service status
- with unprocessed orders
- without a resource that can be migrated
- with an unprocessed “Change Order” for a resource
To re-run the script after migration blocking issues are resolved, run this command:
# python base_item_migration.py --reprocess-skipped
If the migration script was first run with the --resource-id
parameter, it also must be passed this time:
# python base_item_migration.py --reprocess-skipped --resource-id <resource_id>
Note: The following subscriptions are not migrated at all:
- subscriptions in the “Trial” status
- subscriptions in the “Terminated“ or “Not Provisioned” status
- subscriptions with the “Removed” service status
Internal content