I've ran into a problem trying to calculate prorating of a service. Hoping to get some help/hint from the community.
I apologize if this isn't the right place to ask this question - will appreciate help in finding the right StackExchange service.
- An online service that issues "licenses" that can be purchased for the time periods in multiples of 30 days/1 month (for simplicity, let's assume that all months have 30 days)
- "Base" subscription costs $15/month
- On top of base subscription there are also 20 "feature add-ons". Their price varies between $2 and $5 per month
- Customer is allowed to purchase "base" subscription without any add-ons
- Having paid the "base" $15, customer is allowed to add any "feature add-on" any time he desires without paying extra for it.
a. Item #5 above needs a bit of explanation. The idea there is to allow customers who are paying the base amount to "try out" any "feature add-on" without collecting more money from them.
"Customer X has already paid me $15 for 30days of service. Now, I will let him add a new "feature add-on" worth of $5/mo without sending him to shopping cart. However, I'll recalculate the expiry of the license based on $15+$5/mo rate. Thus the license would have fewer days until it expires".
a. The newly added $5 add-on should itself be prorated. It is also possible that customer selects the amount of add-ons that would lead to the situation when the service would owe the customer.
b. There is a "cut-off" date that's determined by the amount the new add-ons cost after which moving license expiry date "to the left" (i.e. closer to current moment in time) would essentially make it expire immediately.
- How do I calculate the updated expiry of a license based on the rationale above?
- How do I calculate the highest value of add-ons that can be selected without making license expire?