#jkimling-schedule-testlock
1 messages · Page 1 of 1 (latest)
Hello @copper prairie. We close threads quickly as we help in real time here (the server can get really busy at times). What do you need help with?
I linked the latest message in the thread, but I'm trying to update a subscription schedule and I'm getting behavior that I don't expect
Sure but I can't talk to you in that thread, and my colleague asked more details but then you said you deleted the Subscription. Can you share an exact summary of the issue, with existing objects that are still visible for me to look at?
jkimling-schedule-testlock
If you have a simple script to reproduce end to end that would be great too, it's not easy to make sense of Schedules + Test Clocks in abstract
Ok I'll share more technical details in a second, but here's a summary of what I'm trying to do:
I create a subscription such that the first invoice is sent immediately after the subscription is created and is due immediately. The next invoice is sent tomorrow (Dec 6) and is due in 28 days. All subsequent invoices are sent on the 6th of the month and are due within 28 days of sending. So, my first phase lasts from today until tomorrow, then the second phase lasts from tomorrow until 12 total invoices are sent (1 in the first phase and 11 in the second). Then, I want to modify this schedule so that:
- The first phase stays exactly the same
- A new second phase is created that still starts on Dec 6, but only lasts 1 month, ending on Jan 6. This should send an invoice on Dec 6. Again, due in 28 days
- The thirds phase is similar to the previous second phase in that is sends an invoice on the 6th of every month, except now it starts on Jan 6 and only sends 10 invoices (because one invoice was sent in phase 1, and another will be send in the new phase 2).
I try to apply an update to the subscriptionSchedule to achieve this, and when I apply the update, the scheduled updates seem to indicated exactly the changes I want. But, the second invoice doesn't get sent until Jan 5 when I want it to send on Dec 6
I can share the technical calls/details in a bit
I don't really understand
The next invoice is sent tomorrow (Dec 6) and is due in 28 days
Didn't you already send an invoice for the full amount the day before? That will prorate right?
The reason I want to update the subscription schedule is because the full amount changes. Say the total is $1200 billed over 12 months, the first invoice sent when the subscription is created is for $100 and the rest will be $100 as well. But, then I change the total amount to $2700 so now I want to spread the additional $1500 over the remaining 11 invoices. Normally, we bill for each month exactly a month before, so ideally the invoice that was sent today, when the subscription is created, would be sent on November 6 and due 28 days later, Dec 4. But since Dec 4 has already passed, we send the invoice ASAP and it's due ASAP
the "date the Invoice is due" doesn't matter at all in this case
So if I subscribe on December 7, I get an Invoice on Dec 7 and the next one on January 6. But if I subscribe on January 5 I get an Invoice on January 5 and another one on January 6?
(I ask all those questions to make sure we're aligned on what you really want to do with the schedule)
It depends on the period for the service that you're subscribing for. If you subscribe on December 7 and your service starts December 7, then you'll get an invoice on December 7 for twice the normal rate (e.g. $200 if the total cost is $1200). That's because the invoice for using the service December 7 - January 7 is normally sent on November 7 and the invoice for using the service January 7 - February 7 is normally sent on December 7. We always want to sent the invoice exactly a month before. If you subscribe on December 7 AND your subscription starts on December 7, then we send an invoice for double the monthly amount to charge for December 7 - January 7 (normally sent on November 7, but we send it right away because November 7 is passed) and also to charge for January 7 - February 7 (normally sent on December 7, which is "today" in this scenario, so send the invoice right away)
If we need to backdate months like this, we combine all past invoices into the first invoice and send that immediately
Ah so you're doing some kind of weird backdating too?
I'm struggling to reason about the schedule you're designing unfortunately
I'm not I can say much more to help. I can write a script to replicate this scenario though. We have most of the logic for what I've described working, it's just this specific scenario that I'm having problems with
yeah that would likely help since I can't make sense of what the issue is
It's going to take me a bit though, is this thread going to close? Or should I just create a new thread/post when I'm done?
this thread will be archived if you don't reply for a while yes but you can always ask again with a clear repro if needed. But we won't close it immediately