[freeside-users] modifying date range printed on invoices

Peter Bowen pbowen at corp.untd.com
Tue May 20 11:48:02 PDT 2008


LOL - it was on the list...

I believe that the initial submission was correct, but someone had to
twiddle with it...  Although I could ber wrong.

I seem to remember that someone wanted to use a date library, but somebody
else didn't like using the date library - but after three years, I'm a bit
fuzzy. :P  

Calc remain really should just calculate the remaining time in seconds and
multiply that by the cost/second...

(period end - current) * ((period price)/(period end - period start))

Simple. ;)

-Peter


On 5/20/08 12:32 PM, "Ivan Kohler" <ivan at freeside.biz> wrote:

> On Tue, May 20, 2008 at 06:02:19PM +0000, Kristian Hoffmann wrote:
>> 
>> On Tue, 2008-05-06 at 12:04 -0700, Ivan Kohler wrote:
>>> On Tue, May 06, 2008 at 11:51:39AM -0700, Kristian Hoffmann wrote:
>>>> Hi,
>>>> 
>>>> IIRC, the monthly interval is based on the number of the seconds in the
>>>> year (365.2422*24*60*60 = 2629743.84 seconds) divided by 12 months
>>>> (2629743.84 / 12 = 30.43685 days).  So, in freeside 1 month is really
>>>> 30.43685 days.  As far as day of month is concerned, sometimes that
>>>> takes you from the 1st to the 1st, other times it takes you from the 1st
>>>> to the 31st.  Either way, you get 12 even billing intervals per year.
>>> 
>>> Huh?  Gosh no, I don't think things *ever* worked like that.  Where did
>>> you get that idea?
>> 
>> FS::part_pkg::flat::calc_remain
>> 
>> Of course, I'm still wrong, but now I know why I thought that.
> 
> Oh!  And now I know why credits for changed/cancelled packages come out
> a few pennies off.  Cool, thanks.
> 
> I think calc_remain should be reworked a bit.  Something like
> base_recurring * ( next bill date - current date ) / frequency



More information about the freeside-users mailing list