I am wondering if it is possible to configure a usage-based plan where the invoice is generated a few days after the billing cycle date. For example, I'd like an invoice to be generated on the 2nd of Sept, and to include usage for the previous calendar month (1st Aug - 31st Aug).
The reason for the delay is to allow for the jobs posting daily usage data for the last day of the month to have a chance to run before the invoice is generated.
Is such a configuration possible?
Thanks for any advice,
Matt
--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to killbilling-users@googlegroups.com.
Visit this group at https://groups.google.com/group/killbilling-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/0ca764fd-bd42-42bf-a452-b43f76256e96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Yes, I think that would be great, thanks. Just so I'm clear, would this new "usage offset" property be used to offset the end date of the usage billing period by X days, and the start date of the usage billing period would be derived from that based on the billingPeriod defined on the usage?
I'm using a MONTHLY billingPeriod for this usage, but I suppose for other billingPeriod values like WEEKLY this new "usage offset" would still use the expected range of 1 week, ending X days before the BCD?
I'd be happy to test it out in the 0.19.x branch as well.
-- m@
> I went through the code, and i am wondering if we could reverse the model -- implementation would be simpler, main work would be to write good tests to verify behavior.
>
>
> 1. You could configure your customer BCD to be on the 2nd -- not the 1st.
> 2. We could modify the code -- invoice config -- to fetch usage with an offset, let's say to 2 days in a such way that on sept 2nd, it pulls usage from 1st Aug - 31st Aug.
>
>
> Would that work for you?
>
>
> Something to keep in mind is that such code modification would only be available in our development branch `work-for-release-0.19.x` and not against current versions 0.18.x.
--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to killbilling-users@googlegroups.com.
Visit this group at https://groups.google.com/group/killbilling-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/9ec2fcbc-2126-46b9-9da5-2b4aaa90646e%40googlegroups.com.
-- m@
On Saturday, September 2, 2017 at 8:23:02 AM UTC+12, stephane brossier wrote:
> So the point i am trying to illustrate here is that there is not really a startDate per say. Instead there is:
> a targetDate (or endDate, up to where to invoice)some boundaries (in this case one per month) to ensure we have different invoice usage items for the different month. The system always recomputes everything-- although we have some optimization code to not really do that, but that's not important for this discussion-- and generates the delta with what is missing.
Hi Stéphane,Thank you for the feedback. My understanding in the actual technical implementation details are limited as I am too inexperienced with Kill Bill. From reading the code and unit tests, I came to understand the dates added to transitionTimes as essentially BCD dates, but sometimes they are not because of that line you pointed to. Then I proposed any date added to transitionTimes should have the offset applied.Still, the semantics of the billing dates and these transition dates are not completely clear in my head, or I suppose the significance of the rawUsageStartDate, which is the effective date of the first billing event, or which I thought was a BCD.Looking at this line of an existing test:I don’t understand why raw1 shouldn’t be included in the resulting rolled up usage, if it hasn’t been included in any invoice item yet?
I’ve tweaked the code to not offset the start date now, along with the unit tests I added so they pass again. I could add more tests, but quite frankly I’m not confident I understand what type of inputs in terms of billing events and their dates are passed into this class in the first place. Maybe it would help me if you could explain the intention of the ContiguousIntervalUsageInArrear constructor arguments in more detail?
I know what my objective is, which for the simple case of an invoice generated on a BCD > 1 to include usage up to (but excluding) the 1st of that month… resulting in invoices generated say on the 2nd of October to include usage to to the 30th of September (inclusive). Essentially I would always want this offset to be (BCD - 1).
Test Case
|
BillingEvent count
|
BillingEvent[0] effectiveDate
|
BillingEvent[n] effectiveDate
|
targetDate
|
rawUsageStartDate
|
First invoice event on BCD
|
2
|
2017-01-10
|
2017-02-03
|
2017-02-03
|
2017-01-10
|
Second invoice event on BCD
|
3
|
2017-01-10
|
2017-03-03
|
2017-03-03
|
2017-01-10
|
Subscription ends not on BCD
|
4
|
2017-01-10
|
2017-03-20
|
2017-03-20
|
2017-01-10
|
Matt,
Hi, I meant to build off your example, so
- Subscription:
- startDate: 2017-01-10 (I thought this was always BillingEvent[0].effectiveDate?)
- endDate: null until #3, then 2017-03-20
- BillingPeriod: Monthly
- BCD: 3
- Offset: 2
OK, your dates match my BillingEvent[n].effectiveDates in the table, so I think we’re on the same page. What I was asking was about the expected output from the getTransitionTimes() method, because that is what I’m effectively changing. Going back to these inputs then, is it correct to say the output of calling getTransitionTimes() on each of the invocation corresponding to rows in the table would be:
- 2017-01-10, 2017-02-01
- 2017-01-10, 2017-02-01, 2017-03-01
- 2017-01-10, 2017-02-01, 2017-03-01, 2017-03-20
So essentially to me it is like the first transition date is the subscription start date (the offset is not applied),
if the subscription has ended the final transition date is the subscription end date (the offset is not applied),
and all other dates are BCD dates with the offset applied.
Is this reasoning correct?