[SOLVED] Prorate price to upgraded plan incorrect

13 years 8 months ago #137138 by ozneilau
OK, have read the FAQ, the documentation and searched the forums but still can't solve an issue I am having with CBSubs plan upgrade charges where a user has purchased one plan and then upgraded to another plan but CBSubs seems to be undercharging.

Exact PHP version: 5.2.6
Exact CB version: 1.2.2
Exact CBSubs version: 1.0.3
Exact Joomla version: 1.5.18
Detailed description of problem: See below
Error messages: None
ACL modification components: None
SEF components: None
Move or encrypt configuration.php: No
Upgrade from CB version or fresh install: Fresh Install
Migrated from Joomla version or fresh install: Fresh Install
What browser is issue present in: Various

Example of what is happening:

Plans:
Plan 1:
First period Pricing: $30
Regular Price of Plan: $20
Plan 2:
First period Pricing: $45
Regular Price of Plan: $35

Scenario:
User purchases Plan 1 and then 2.5 weeks later upgrades to Plan 2.

Expected Charge using "regular" pricing:
Residual should be 49.5/52 x $20 = $19.04
Upgrade charge should be $35 - $19.04 = $15.96

Expected Charge using "first period" pricing:
Residual should be 49.5/52 x $30 = $28.55
Upgrade charge should be $45 - $19.04 = $25.96

Actual Charge: $6.52

The actual amount charged seems to low whether you calculate the pro rata value using the regular plan pricing or the initial period pricing.

Am I missing something?

Neil.

Post edited by: krileon, at: 2010/07/12 15:58

NEIL ROBERTSON
Web: webilicious.com.au

Please Log in to join the conversation.

13 years 8 months ago #137159 by krileon
Hmm, your formula does not appear correct. It basically subtracts remaining value of existing plan. The value appears correct. What is the duration of your plans? Example $20/month, etc.... This too is important in the calculation of the prorate value.

The amount the user has already paid for duration they have already used is NOT factored in, but rather the amount they have paid for duration they have NOT used IS factored in.

For example if I pay $30 for 1 month (30 days), but only am active for 1 week (7 days) then upgrade, I have 23 days prorated that I paid for but did not use. So after determining the cost per date ($1) I am then credited towards the upgrade plan the remainder ($23). This is a basic representation of the prorating and may not be entirely accurate as the prorate calculation is rather more complex then as such.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 8 months ago #137165 by ozneilau
Hi Kyle,

Thanks for the prompt reply!

The plans are for 1 year. In my calculation, I am working out the residual amount (49.5 weeks remaining out of 52 weeks in a whole year) that is credited to the new plan so I think my calculation is correct according to what you are saying.

I am not clear on whether the $10 joining fee should be taken into account or not but in either case, the upgrade fee should have been at least twice as much as what was actually charged.

Neil.

NEIL ROBERTSON
Web: webilicious.com.au

Please Log in to join the conversation.

13 years 8 months ago #137204 by krileon
It would appear initial fees are not considered within the prorating calculations. Please see your following example.

Expected Charge using "regular" pricing:
Residual should be 49.5/52 x $20 = $19.04
Upgrade charge should be $35 - $19.04 = $15.96


Once you add in the additional $10 purchase you didn't mention earlier you would get $5.96 (not exact as CB is reporting, but you've done some rounding which CB does not appear to do as you've done).

$35 - ( $19.04 + 10 ) = $5.96

We've other users that have confirmed is working properly. Am suspecting some other purchase(s?) or configuration is in place that is resulting in the value you are seeing.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 8 months ago #137221 by ozneilau
Sorry, I don't think that's it.

The "joining fee" is created by charging an extra $10 for the first period of membership.

I couldn't attach the screen dumps in the original post because they were too big but have uploaded the configuration of the relevant plans to: hbln.org.au/images/stories/plans_pricing.jpg

Let me put this another way.

As a new member signing up I have the choice of 2 plans:
Plan 1 costs $30.00 for 1 year (associate member)
Plan 2 costs $45.00 for 1 year (full member)

I join Plan 1 and spend $30. 2 and a half weeks later I upgrade and am charged $6.52. I am now a full member and I have only spent $36.52. The organisation has missed out on collecting $8.48. I understand there may be rounding involved but surely not to this extent! :)

Are there another settings I should be checking?

Neil

NEIL ROBERTSON
Web: webilicious.com.au

Please Log in to join the conversation.

13 years 8 months ago #137460 by beat
ozneilau wrote:

Plan 1:
First period Pricing: $30
Regular Price of Plan: $20
Plan 2:
First period Pricing: $45
Regular Price of Plan: $35

Scenario:
User purchases Plan 1 and then 2.5 weeks later upgrades to Plan 2.

Actual Charge: $6.52

....


I agree it might look surprising at first glance, but there is a logic in the CBSubs prorating computation ;) :

Your different first rate is for registration only, NOT for upgrade, as seen on your screenshots. You may want to ask for that also in case of upgrades, then it will look more correct for your case..

Here is the computation made by CB for that setting "FIrst amount and period different for REGISTRATION ONLY" : as that first charge applied to registration, but doesn't apply to UPGRADE, that's how the calculation is done:

Residual value is 49.5/52 x $30 = $28.55
Upgrade charge is $35 for 12 months - $28.55 unused value left = $6.45

I guess it's not EXACTLY 2.5 weeks left, as it's not exactly 52 weeks in the year. CBSubs will compute the exact value up to the second, hence the small difference you have.

If the person upgrades middle of *second* year, then it would be:

Residual value is 26/52 x $20 = $10
Upgrade charge is $35 for 12 months - $10 unused value left = $25 to pay

Change the "FIrst amount and period different" setting to also be different for upgrades, and you will have a model which is probably more what you expect for your case.

The setting you made makes sense for other cases, as CBSubs is very flexible to fit many business models, so testing your configuration before deployment is really a good idea... ;)

EDIT: fixed bbcode

Post edited by: beat, at: 2010/07/10 02:19

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.323 seconds

Facebook Twitter LinkedIn