[freeside] Bill late fee based on percentage

ivan at 420.am ivan at 420.am
Sun Nov 9 20:45:32 PST 2003


On Sun, Nov 09, 2003 at 09:17:23PM -0500, fox at vader.aacc.edu wrote:
> On Sun, 9 Nov 2003 ivan at 420.am wrote:
> 
> > On Sat, Nov 08, 2003 at 12:23:08PM -0800, Joseph Tanner wrote:
> > > 
> > > $cust_main->balance_date(time-10 * 86400) * 0.05
> > 
> > Secondly (though this is a moot point if you use $cust_bill->owed),
> > "time-10" is not a number of days.  "time" returns the current time in
> > seconds since the epoch.  See "perldoc -f time".  Subtracting ten backs
> > up 10 seconds, and multiplying by 86400 (the number of seconds in a day)
> > results in an absurdly large number.
> 
> Ivan, check your coffee. I think someone substituted decaf. No matter what
> spacing would suggest, this is time - (10*86400), not (time-10) * 86400.
> 
> % perl -e 'print time, " ", time-10 * 86400, "\n";'
> 1068429934 1067565934
> 
> (Yes, I had to check. You had me doubting my grip on reality.)

Yes, complete lack of brain activity on my part here.  Sorry about that.
I think the spacing in the original threw me off.

I'm pretty sure $cust_bill->owed is still more appropriate than
$cust_main->balance_date, though, which does still makes the whole thing
moot. :)

-- 
_ivan



More information about the freeside-users mailing list