[freeside] Bill late fee based on percentage

Joseph Tanner josetann at yahoo.com
Sat Nov 8 12:23:36 PST 2003


Ok, think I figured it out.  Probably not the best way
to do it, but it works.  When you add an invoice event
to charge a late fee, instead of putting a number
there put this:

$cust_main->balance_date(time-10 * 86400) * 0.05

Now, the "time-10" should reflect the number of days
you set the invoice event for (in my example I set it
to do this after 10 days).  The 0.05 is for the
percentage it should charge (in this case, 5%).

Shouldn't be too hard to incorporate this into
freeside.  Since it seems even simple patches to
freeside are beyond me, I'll describe how someone can
go about making the patch.  Please note I'm not
demanding nor requesting a patch, as my way works fine
for me.

When you execute an invoice event, check to see if
there is a percent sign present.  If not, execute it
the old way.  If so, check to see what the late
balance is, something like:

$cust_main->balance_date(time-10 * 86400)

Of course, substitute "10" with the whatever variable
is appropriate.  Now convert the percentage into an
integer, i.e. 5% becomes 0.05.  Multiply the two
together, and that's how much should be billed.

--- Joseph Tanner <josetann at yahoo.com> wrote:
> I have freeside setup and it works great.  Have a
> few
> customers that seem to always pay late, so I added
> some new invoice events.  One to send out a reminder
> after 8 days, another to charge a late fee.  I have
> a
> test account that I let charges accrue on, which
> shows
> as being a few months overdue (so both invoice
> events
> should work on it).  Well it sends out a reminder,
> but
> doesn't add a late charge.
> 
> I added the late fee as 5%, I'm guessing it's
> looking
> for a regular integer such as 5.  I really need it
> to
> charge based on a percentage, as I have packages
> ranging from $10/mo to $275/mo (I use it to bill my
> webhosting customers as well).  Obviously $5 on a
> $10
> account is too much, and $5 on a $275 account isn't
> enough.
> 
> Will Freeside handle this natively?  If so then what
> format should I enter it in?  If not, can someone
> direct me to the code I'd need to alter?  Thanks!
> 
> __________________________________
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard
> http://antispam.yahoo.com/whatsnewfree


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree



More information about the freeside-users mailing list