[freeside] Bill late fee based on percentage

fox at vader.aacc.edu fox at vader.aacc.edu
Sun Nov 9 18:18:13 PST 2003


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

-- 
Remember: i before e, except on Unix machines.





More information about the freeside-users mailing list