how does killbill calculate prices?

26 views
Skip to first unread message

daniel.n...@gmail.com

unread,
Sep 25, 2021, 4:21:08 AMSep 25
to Kill Bill users mailing-list
Hi Killbill team.

I have a question about the price calculation in killbill.

I have an evergreen plan TVM-BS-326-QUARTERLY with an billing_cycle of Quarterly with a price of 783.84.

I have created an account with the tag AUTO_INVOICING_OFF
added a subscription with the plan  TVM-BS-326-QUARTERLY with a start date 2021-09-13
I then have blocked the invoicing via blocking states
block_billing 13-9-2021
unblock_billing 30-9-2021

remove tag AUTO_INVOICING_OFF from account

If i then run a invoice run(or dry run) for 30-9 I get an invoice line for  TVM-BS-326-QUARTERLY

start_date 2021-09-30
end_date 2021-12-01   
amount 534.04 DKK

Our current billing-system handles billing of monthly prices subscriptions that do not line up with months simply by assuming all months have 30 days and setting a day price by dividing the price with the months.
In this case the monthly price is
261.28/30

Since the period (2021-09-30 - 2021-12-01) is 62 days in our current billing-system we would calculate
62 * (261.28/30)
This adds up to
539.9786667

We are at the moment testing the invoices generated by kill-bill.
I have been asked to explain how the amount is calculated.
Can you help me explain how 534.04 DKK  has been calculated.

I need to explain this to my billing the department and later when killbill is production to my customers.

I would also like to know where in the code these calculations are.

I have attached a catalog and a small script to generate and account with a subscription in the above state.
I had to change the dates one year in the future to get it to work.

/Daniel
catalog.xml
generate_state.sh

stephane brossier

unread,
Sep 30, 2021, 6:58:56 PMSep 30
to daniel.n...@gmail.com, Kill Bill users mailing-list
The quarterly period going from 13-9-2021 -> 13-12-2021 contains 91 days, i.e 30 (sept) + 31 (oct) +30 (nov) 
The # days you are billing for is 92 days

783.84 / 91 * 62 = 534.04




--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/dfad0f49-0a8c-4592-8906-188b119c71a2n%40googlegroups.com.

stephane brossier

unread,
Sep 30, 2021, 6:59:52 PMSep 30
to daniel.n...@gmail.com, Kill Bill users mailing-list
Correction:

> The # days you are billing for is 92 days

The # days you are billing for is 62 days

daniel nielsen

unread,
Oct 1, 2021, 4:26:04 AMOct 1
to stephane brossier, Kill Bill users mailing-list
Thank you stephane.
That makes sense.

/Daniel
Reply all
Reply to author
Forward
0 new messages