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

Invoice is not generated when an UPCOMING_INVOICE dry run is triggered for an IN_ARREAR subscription with a TRIAL phase #1833

Open
reshmabidikar opened this issue Jan 31, 2023 · 1 comment

Comments

@reshmabidikar
Copy link
Contributor

reshmabidikar commented Jan 31, 2023

Steps to reproduce:

  1. Set date to 2023-01-01.
  2. Upload the attached catalog.
  3. Create a new account.
  4. Create a subscription corresponding to the standard-monthly-in-arrear-with-trial plan.
  5. Trigger invoice dry run of type UPCOMING_INVOICE as follows:
curl -v \
    -X POST \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-Killbill-CreatedBy: demo" \
    -H "X-Killbill-Reason: demo" \
    -H "X-Killbill-Comment: demo" \
    -d '{ "dryRunType": "UPCOMING_INVOICE"}' \
    "http://localhost:8080/1.0/kb/invoices/dryRun?accountId=xxx"  
  1. No invoice is generated.
  2. Move the clock to 2023-02-01.
  3. Trigger invoice dry run again - An invoice is generated this time.
@reshmabidikar
Copy link
Contributor Author

reshmabidikar commented Feb 1, 2023

Update: After creating a test, the following was observed:

  1. Although IN_ARREAR billing is used, the system generates an invoice corresponding to the TRIAL phase as soon as the subscription is created.
  2. Thus, when the UPCOMING_INVOICE dry run is triggered, no invoice is generated (basically there is nothing to invoice for)
  3. When the clock is moved by a month, the TRIAL phase ends. So triggering the UPCOMING_INVOICE dry run results in invoice generation.

So looks like the issue is at step 1, when IN_ARREAR billing is used, the invoice corresponding to the TRIAL phase should be generated after the TRIAL phase ends.

@sbrossie sbrossie added this to the Release-Candidate-0.24.1 milestone Feb 4, 2023
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