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

Gerald V. Livingston II gerald.freeside at sysmatrix.net
Sun Sep 10 17:38:37 PDT 2006


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.
> 
> 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


More information about the freeside-users mailing list