Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple usage invoice items are created on plan change #1987

Open
reshmabidikar opened this issue Mar 15, 2024 · 3 comments
Open

Multiple usage invoice items are created on plan change #1987

reshmabidikar opened this issue Mar 15, 2024 · 3 comments

Comments

@reshmabidikar
Copy link
Contributor

Steps to reproduce:

  1. Upload catalogTest.xml
  2. Set the time to 2024-03-04T9:00
  3. Create an account in PST timezone with reference time as 2024-03-04T9:00
  4. Set the time to 2024-03-04T9:05
  5. Create a subscription bundle with the pistol-in-arrear-monthly-notrial base and bullets-usage-in-arrear addon plan
  6. Record usagescorresponding to the bullets-usage-in-arrear addon plan as follows:
  • Usage t1 at 2024-03-15T2:00 for 10L units
  • Usage t2 at 2024-04-04T6:30 for 20L units
  • Usage t3 at 2024-04-04T7:30 for 10L units
  • Usage t4 at 2024-04-04T8:30 for 30L units
  1. Move clock to 2024-04-04 - Generated invoice includes t1, t2, t3 as expected
  2. Move clock to 2024-05-04 - Generated invoice includes t4 as expected
  3. Change the addon plan to bullets-usage-in-arrear2 with date=2024-06-04
  4. Record usages corresponding to the bullets-usage-in-arrear2 plan as follows:
  • Usage t5 at 2024-05-15T2:00 for 10L units
  • Usage t6 at 2024-06-04T6:30 for 20L units
  • Usage t7 at 2024-06-04T7:30 for 10L units
  • Usage t8 at 2024-06-04T8:30 for 30L units
  1. Move clock to 2024-06-04 - Generated invoice includes t5, t6, t7, t8 as expected. However, there are separate invoice items created corresponding to the usage items as follows:
  • Item 1 from 2024-05-04 to 2024-06-04 of type RECURRING as expected
  • Item 2 from 2024-05-04 to 2024-06-04 of type USAGE corresponding to t5, t6, t7
  • Item 3 from 2024-06-04 to 2024-06-04 of type USAGE corresponding to t8 - This is unexpected. There should only be a single usage item corresponding to t5, t6, t7, t8.
@reshmabidikar
Copy link
Contributor Author

The issue is reproducible for an account in UTC timezone as well.

@reshmabidikar
Copy link
Contributor Author

This test reproduces the issue. The code is in the reshmabidikar/pst-create-change-cancel branch.

@shaun-forgie
Copy link

You may want to update the title of this ticket if timezone is not relevant

@reshmabidikar reshmabidikar changed the title Multiple usage invoice items are created for PST account on plan change Multiple usage invoice items are created on plan change Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants