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

Invalid DISCOUNT invoicing for 3 phases plan #1243

Open
pierre opened this issue Nov 8, 2019 · 0 comments
Labels
bug

Comments

@pierre
Copy link
Member

@pierre pierre commented Nov 8, 2019

Given the catalog below:

  1. Dry-run invoicing with a target date in the middle of the DISCOUNT period only invoices for that month (instead of catching-up)
  2. Actual invoicing past the DISCOUNT phase doesn't reflect the EVERGREEN price

Here's a simple catalog to reproduce it (we also have ReducedSpyCarAdvancedWithThreePhasesAddOns.xml in our Ruby integration tests):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="https://docs.killbill.io/latest/catalog.xsd">
    <effectiveDate>2019-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>
        </product>
    </products>
    <rules>
        <changePolicy>
            <changePolicyCase>
                <policy>END_OF_TERM</policy>
            </changePolicyCase>
        </changePolicy>
        <cancelPolicy>
            <cancelPolicyCase>
                <policy>END_OF_TERM</policy>
            </cancelPolicyCase>
        </cancelPolicy>
    </rules>
    <plans>
        <plan name="standard-monthly">
            <product>Standard</product>
            <initialPhases>
                <phase type="TRIAL">
                    <duration>
                        <unit>DAYS</unit>
                        <number>30</number>
                    </duration>
                    <fixed>
                        <fixedPrice>
                            <price>
                                <currency>USD</currency>
                                <value>0</value>
                            </price>
                        </fixedPrice>
                    </fixed>
                </phase>
                <phase type="DISCOUNT">
                    <duration>
                        <unit>MONTHS</unit>
                        <number>6</number>
                    </duration>
                    <recurring>
                        <billingPeriod>MONTHLY</billingPeriod>
                        <recurringPrice>
                            <price>
                                <currency>USD</currency>
                                <value>4.95</value>
                            </price>
                        </recurringPrice>
                    </recurring>
                </phase>
            </initialPhases>
            <finalPhase type="EVERGREEN">
                <duration>
                    <unit>UNLIMITED</unit>
                </duration>
                <recurring>
                    <billingPeriod>MONTHLY</billingPeriod>
                    <recurringPrice>
                        <price>
                            <currency>USD</currency>
                            <value>24.95</value>
                        </price>
                    </recurringPrice>
                </recurring>
            </finalPhase>
        </plan>
    </plans>
    <priceLists>
        <defaultPriceList name="DEFAULT">
            <plans>
                <plan>standard-monthly</plan>
            </plans>
        </defaultPriceList>
    </priceLists>
</catalog>
@pierre pierre added the bug label Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.