[freeside] Variation on pkg part

Kristian Hoffmann khoff at pc-intouch.com
Thu Mar 1 10:29:47 PST 2001


I am going to use this method but in a different way.  My plan was to have
recur be a perl expression that checked how many services in a package
were actually set up, and then bill based on that.  For example, lets say
you have a package with 30 dialup accounts for one customer who adds and
deletes dialups on a regular basis.  You end up with piles of canceled
packages and probably 30 different bill dates.  Accountants don't like
that for some reason.  Anyway, this way you could have 1 package with a
price per service defined in the price, but only bill them for 25 of the
services if that's all their using.  It basically turns the number of
services in a package into the maximum number of packages in the package
and you can use up to that amount without getting billed for services
you're not using.

But that doesn't really help you.  From what I understand, when the recur
value is evaled, it's still in the context of cust_main->bill so you
should be able to use the values of any variables already in use before
the eval.  If you need some data from another table, you should just be
able to do a qsearch or a qsearchs in the expression as well.  My
suggestion is to write whatever perl code you need in a script.  Once you
have that working, you should be able to put in the recur field.

-Kristian

On Thu, 1 Mar 2001, Dale Walker wrote:

> 
> Hi guys, 
> 
> I've just started playing the freeside packages, our company currently
> bills people for a monthly account which includes an allocation of
> dialup hours, if the user exceeds this, we charge an 'excess' fee per
> hour in addition to the plan.
> 
> ie. $50 = 30hours, excess @ $2.00/hr
> 
> I've done a search of the mailing list archives, and I found a reference
> that the 'recur' figure could be a perl expression.. I'm keen to
> implement this, but I'm a bit put off with what I think may need to be a
> combersome perl-sql'ish style of expression.. Am I missing something??
> or does someone have an example of this that I may be able to apply to
> my circumstances.. I noticed in searching the devel Docs, that Ivan was
> going to work on explaining this in the Aug of 1999, but I haven't found
> any other references to it that cover in any more depth..
> 
> Thanks for you input..
> 
> --
> Dale Walker < dale at icr.com.au >
> Independent Computer Retailers (ICR) Pty Ltd
> http://www.icr.com.au/
> 




More information about the freeside-users mailing list