Investigate possible issue with BUNDLE billing alignment and ANNUAL plans
There might be an issue with BUNDLE billing alignment and ANNUAL plans.
Steps to reproduce:
- Upload the following catalog:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
~ Copyright 2020-2023 Equinix, Inc
~ Copyright 2014-2023 The Billing Project, LLC
~
~ The Billing Project licenses this file to you under the Apache License, version 2.0
~ (the "License"); you may not use this file except in compliance with the
~ License. You may obtain a copy of the License at:
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
~ License for the specific language governing permissions and limitations
~ under the License.
-->
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://docs.killbill.io/latest/catalog.xsd">
<effectiveDate>2020-01-01T00:00:00+00:00</effectiveDate>
<catalogName>ExampleCatalog</catalogName>
<recurringBillingMode>IN_ADVANCE</recurringBillingMode>
<currencies>
<currency>USD</currency>
</currencies>
<products>
<product name="Standard">
<category>BASE</category>
<available>
<addonProduct>standard-ao</addonProduct>
</available>
</product>
<product name="standard-ao">
<category>ADD_ON</category>
</product>
</products>
<rules>
<changePolicy>
<changePolicyCase>
<policy>END_OF_TERM</policy>
</changePolicyCase>
</changePolicy>
<cancelPolicy>
<cancelPolicyCase>
<policy>END_OF_TERM</policy>
</cancelPolicyCase>
</cancelPolicy>
<createAlignment>
<createAlignmentCase>
<product>standard-ao</product>
<alignment>START_OF_BUNDLE</alignment>
</createAlignmentCase>
<createAlignmentCase>
<alignment>START_OF_BUNDLE</alignment>
</createAlignmentCase>
</createAlignment>
<billingAlignment>
<billingAlignmentCase>
<alignment>BUNDLE</alignment>
</billingAlignmentCase>
</billingAlignment>
</rules>
<plans>
<plan name="standard-monthly">
<product>Standard</product>
<initialPhases>
</initialPhases>
<finalPhase type="EVERGREEN">
<duration>
<unit>UNLIMITED</unit>
</duration>
<recurring>
<billingPeriod>MONTHLY</billingPeriod>
<recurringPrice>
<price>
<currency>USD</currency>
<value>30</value>
</price>
</recurringPrice>
</recurring>
</finalPhase>
</plan>
<plan name="standard-ao-monthly">
<product>standard-ao</product>
<initialPhases>
</initialPhases>
<finalPhase type="EVERGREEN">
<duration>
<unit>UNLIMITED</unit>
</duration>
<recurring>
<billingPeriod>MONTHLY</billingPeriod>
<recurringPrice>
<price>
<currency>USD</currency>
<value>10</value>
</price>
</recurringPrice>
</recurring>
</finalPhase>
</plan>
<plan name="standard-annual">
<product>Standard</product>
<initialPhases>
</initialPhases>
<finalPhase type="EVERGREEN">
<duration>
<unit>UNLIMITED</unit>
</duration>
<recurring>
<billingPeriod>ANNUAL</billingPeriod>
<recurringPrice>
<price>
<currency>USD</currency>
<value>300</value>
</price>
</recurringPrice>
</recurring>
</finalPhase>
</plan>
<plan name="standard-ao-annual">
<product>standard-ao</product>
<initialPhases>
</initialPhases>
<finalPhase type="EVERGREEN">
<duration>
<unit>UNLIMITED</unit>
</duration>
<recurring>
<billingPeriod>ANNUAL</billingPeriod>
<recurringPrice>
<price>
<currency>USD</currency>
<value>120</value>
</price>
</recurringPrice>
</recurring>
</finalPhase>
</plan>
</plans>
<priceLists>
<defaultPriceList name="DEFAULT">
<plans>
<plan>standard-monthly</plan>
<plan>standard-ao-monthly</plan>
<plan>standard-annual</plan>
<plan>standard-ao-annual</plan>
</plans>
</defaultPriceList>
</priceLists>
</catalog>
- Set the date to
2023-05-15 - Create a subscription corresponding to the
standard-annualplan - An invoice is generated for the duration2023-05-15to2024-05-15as expected - Set the date to
2023-07-19 - Create an
ADDONsubscription corresponding to thestandard-ao-annualplan - An invoice is generated for the duration2023-07-19to2024-07-15.
Since BUNDLE billing alignment is used, one would expect the invoice to be generated for the duration 2023-07-19 to 2024-05-15.
We need to investigate what is the proper semantics and whether this is really a bug.
The issue is not reproducible when a different set of dates is used:
- Set the date to
2023-06-01 - Create a subscription corresponding to the
standard-annual plan- An invoice is generated for the duration2023-06-01to2024-06-01as expected. - Set the date to
2023-06-10. - Create an
ADDONsubscription corresponding to thestandard-ao-annualplan - An invoice is generated for the duration2023-06-10to2024-06-01as expected.
The issue is also not reproducible with monthly plans.
- Set the date to
2023-06-01 - Create a subscription corresponding to the
standard-monthlyplan - An invoice is generated for the duration2023-06-01to2023-07-01as expected. - Set the date to
2023-06-10. - Create an ADDON subscription corresponding to the
standard-ao-monthlyplan - An invoice is generated for the duration2023-06-10to2023-07-01as expected.
Looks like the issue only occurs for ANNUAL subscriptions when the ADDON is created in a different month than the base subscription.
Hello @reshmabidikar any update on that?
Hi @Rxbsxn, nothing so far. We'll update the ticket once the issue is addressed.
@reshmabidikar Thanks for your quick response
Adding another related scenario reported here : https://groups.google.com/g/killbilling-users/c/rWvX8TwjrQ0
Scenario 1
- Use the catalog present at https://github.com/KBbitsP/FileUploads/blob/main/bundle-billing-alignment.xml
- Set the date to 26th Feb.
- Create a base annual subscription starting 26th Feb.
- Create the add on annual subscription starting 26th Feb too.
- Invoice generated attached in Scenario 1 screenshot.
Since the user has set bundle billing alignment, the expected charged through date for add-on subscription should be 11th march 2025, where as currently it shows as 11th Feb 2025.
Scenario 2
- Use the catalog present at https://github.com/KBbitsP/FileUploads/blob/main/bundle-billing-alignment.xml
- Set the date to 1st March.
- Create a base annual subscription starting 1st March.
- Create the add on annual subscription starting 1st March too.
- Invoice generated attached in Scenario 2 screenshot.
Since the user has set bundle billing alignment, the expected charged through date for add-on subscription should be 15th march 2025. This scenario is working fine.