[freeside-users] Time of "next bill date"

Gerald V. Livingston II gerald.freeside at sysmatrix.net
Sun Sep 10 21:15:24 PDT 2006


On Sun, 10 Sep 2006 19:38:37 -0500 (Central Standard Time) "Gerald V.
Livingston II" <gerald.freeside at sysmatrix.net> wrote:

> On Sun, 10 Sep 2006 16:59:53 -0700 Ivan Kohler <ivan at 420.am> wrote:
> 
> > On Sun, Sep 10, 2006 at 06:35:44AM -0500, Gerald V. Livingston II wrote:
> > > 
> > > Example: (freeside-daily set in cron to run at 09:00)
> > > 
> > > Create new customer at 15:00 on August 9th. Bill for the first month of
> > > service and enter the payment to generate an initial invoice showing
> > > account activation and payment. Next billing date field gets set to
> > > September 9th at 15:00.
> > > 
> > > freeside-daily runs at 09:00 on September 9th. The customer listed above is
> > > NOT billed because it is not yet 09/09/2006 15:00:00 -0500 (CDT). 
> > > 
> > > freeside-daily runs at 09:00 on September 10th and the above account is now
> > > billed -- but now the "next billing date" field is set to 10/10/2006
> > > because the account was actually billed on the 10th this time.
> > 
> > I don't believe this is the case.  Using flat price plans (most of 
> > them), the new next bill date is the old next bill date plus the package 
> > frequency; not the time the daily script is run plus the package 
> > frequency.

You are correct about the anniversary date and time being retained
regardless of when the package is actually billed. See below. Response
posted as a whole rather than intermixed to retain timeline.

> > 
> > The setup date and "current" time (actually, when freeside-daily script 
> > was started) are only used as fallbacks if the next bill date is not yet 
> > populated.
> > 
> > > If it was a new account near the end of the billing list the actual field
> > > may get set to something like "10/10/2006 09:07:03 -0500 (CDT)"
> > 
> > I don't believe this is the case either, even if there isn't an old next 
> > bill date or setup date, the final fallback time used is the time the 
> > freeside-daily script started, not the time the script got around to 
> > billing that specific customer.
> > 
> > I don't think the further suppositions about "slipping" dates are 
> > correct either.
> 
> I'll re-test and post screen shots of the test customer. You may be right
> about my second statement re: continually slipping dates. that was an
> assumption based on observed behavior. 
> 
> But, I know that I was importing accounts on the 9th and managed to work
> past midnight so I ran 'freeside-daily -d "Sat, 9 Sep 06 00:00:01 CDT"
> gerald' and it failed to bill ALL of the customers due on the 9th. And I
> had manually set each "Next Bill Date" to 09/09/2006 as I imported them.
> The time was set to whatever time I actually set that date. I used
> "00:00:01" as the time simply because it's easy to type.
> 
> I wondered why they got missed so I then just ran 'freeside-daily gerald'
> (some time after midnight, now the 10th). All of the ones that were due on
> the 9th, and any that I had set to the 10th shortly after midnight, got
> invoices generated and credits applied correctly when I did that. But, the
> "Next Billing Date" was set to 10/10/2006 01:mm:ss for all of them. (I
> don't recall the exact time but they WERE all the same. That indicates you
> are correct about all billed accounts being treated with the time that
> freeside-daily is started).
> 
> We are having to import each account by hand so we can search for SNAFU's
> created in the old billing system as we do the imports. Can export to a CSV
> and massage the result for import.
> 
> Stand by for message with screenshot links.
> 
> Gerald

OK -- testing done.

I am right that if an account is set up late in the day and freeside-daily
is run early in the day on the anniversary date the account is NOT billed.
It doesn't get billed until the freeside-daily start *TIME* (or -d switch
time) is *LATER* than the time the package was set up for billing.

So, the "-d time" of freeside-daily needs to be set to 23:59:59 if one
needs to ensure all accounts set to be billed on a given day are actually
billed if freeside-daily is run before 23:59:59. 

Further experimentation shows that the WRAPPER SCRIPT is *NOT* needed.
freeside-daily happily accepts just the time on the command line:

'freeside-daily -d 23:59:59 user'

works just fine.

No need for the pictures.

Gerald


More information about the freeside-users mailing list