Automattic / woocommerce-subscriptions-core

Subscriptions core package for WooCommerce
Other
86 stars 32 forks source link

Subscription Switching prorated calculations incorrect on second switch #723

Open BFlorek95 opened 6 days ago

BFlorek95 commented 6 days ago

Describe the bug

When a customer has a subscription that renews for 30$ a month on 10/26 They then upgrade to a 40$ a month subscription on 11/5 which creates prorated order of $6.77 They then upgrade again to a 50$ a month subscription on 11/10 which creates another prorated order for $22.31 Renewal date never changes as next renewal is still 11/26

The second upgrade created a prorated order for $22.31 when it should have been less than 10$

Things to note:

  1. the billing date never changed
  2. the billing interval did not change all billed monthly
  3. Based on the normal prorated "upgrade" switching calculation Days until next payment * ( New Price Per Day – Old Price Per Day ) the $6.77 is correct but the $22.31 wouldnt even be possible

Screenshots

Screenshot below shows renewal sub at $30 Then the first switch changing from 30$ sub to 40$ sub Then 5 days later another switch changing from 40$ sub to 50$ sub

Note next renewal date did not change is still set to 11/26 Image

Expected behavior

subscriptions prorated correctly using chart provided Image

Desktop (please complete the following information):

Unknown device

Smartphone (please complete the following information):

Unknown device

Additional context

Current plugins are a few versions behind but update logs do not mention this error

woocommerce 9.1.4 woocommerce subscriptions 6.5.0

Logs only show intents/payment completions to strip. Unsure if calculations are shown in logs anywhere

wjrosa commented 3 days ago

Hey @BFlorek95! We are working on a potential fix that must be available on our next extension release (7.0.0). This version is scheduled for release on the next month.