Skip to Content Skip to Menu

Wrong Prorated Amount

  • wjgadmin
  • wjgadmin
  • OFFLINE
  • Posts: 489
  • Thanks: 28
  • Karma: 4
1 year 7 months ago #333642 by wjgadmin
Replied by wjgadmin on topic Wrong Prorated Amount
Nevermind, this is not going to work as an option for this reason...

Proration is based on time; if we used this as a solution a user would receive the total amount they previously paid regardless of how much time they've been subscribed.

EX: user purchases monthly subscription, decides to upgrade to a yearly plan on day 25.... in such case, the user gets 1 yr + 25 days whereas the business only gets paid for 1 yr.

As a business, we're happy to offer many things to our customers such as this, however to be automated it simply isn't an option realistically.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
1 year 7 months ago #333644 by krileon
Replied by krileon on topic Wrong Prorated Amount
It's a bit complicated, but the below should do the trick with CB Auto Actions. Gave it a quick test and confirmed it works to push the paid amount to a field.
Code:
UPDATE `#__comprofiler` SET `FIELD_NAME_HERE` = ( SELECT p.`mc_gross` FROM `#__cbsubs_payments` AS p WHERE p.`payment_basket_id` = ( SELECT i.`payment_basket_id` FROM `#__cbsubs_payment_items` AS i WHERE i.`subscription_id` = '[subscription_id]' ORDER BY i.`id` DESC LIMIT 1 ) ORDER BY p.`id` DESC LIMIT 1 ) WHERE `id` = '[user_id]'

Change FIELD_NAME_HERE to the name of the field you want to set the value into. Set the above to both Activation and Renewal. What it's doing is taking the subscription id and grabbing the latest payment basket item associated with it. It then grabs the latest payment associated with that basket and outputs its mc_gross. You'll probably need to make adjustments here though as auto recurring payments come from mc_amount, but this is a good start.

Sorry, I don't have any other solutions at this time. Anything else would require something more complex and would need CB Auto Actions.


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 or Create an account to join the conversation.

  • wjgadmin
  • wjgadmin
  • OFFLINE
  • Posts: 489
  • Thanks: 28
  • Karma: 4
1 year 7 months ago #333645 by wjgadmin
Replied by wjgadmin on topic Wrong Prorated Amount
No worries, I don't believe this is a realistic option for us at this time. We will temporarily disable all prorating and consider our options.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum