Freeside Billing Methods...

Ivan Kohler ivan at sisd.com
Thu Apr 22 06:20:19 PDT 1999


Please wrap your mail at 80 columns in the future.

On Wed, Mar 24, 1999 at 02:35:43AM +0000, Kristian Hoffmann wrote:
> Is there a rundown on how the billing works?  I want to find a good
> place to setup batch billing on a certain day of the month and then
> prorate based on the setup date.

htdocs/docs/billing.html

Some more information on how to implement pro-rates, metering, and
arbitrary billing schemes is found at
<http://www.sisd.com/freeside/list-archive/msg00423.html> and is repeated
below:

    I'm hoping Freeside can support arbitrailly complex pricing plans
    because of a simple concept: all prices are perl expressions.  So if
    you use `19.95' for example, perl evalates that to be `19.95'.  But if
    you need to do a complex pricing scheme, you just need to write an
    appropriate perl expression, which will most likely pull data from the
    database to return pricing.  Some things will already log to SQL; for
    example most RADIUS servers can or have a patch available.  Getting
    Freeside to bill based on any sort of data then becomes a matter of
    importing the data into the database.

    There are some issues involved with pro-rating, partial month charges,
    that sort of thing.  Expressions will need a standard way to have the
    applicable time/data ranges passed to them.  Also the expressions are
    current running under the Safe perl module, and the opmask might not
    be right in all situations.  I'll try to spend some time working on
    this if you are using it. 

And, in fact, I am working on this sort of thing now.  I post more
information soon.

>  Would the bin/bill command be better
> for this?

The bin/bill script just calls the bill and collect methods in
FS::cust_main; see htdocs/docs/man/cust_main.txt (and the source!)

>  Besides that I want to add a function to write to a
> transaction file so a daily transaction summary report
> can be e-mailed to the bookkeeper instead of having to enter each
> transaction manually in the books as well as freeside.

Yes, that's pretty silly.

The information you want is in the cust_bill, cust_pay, cust_credit and
cust_refund tables.  See htdocs/schema.html as well as
htdocs/docs/man/cust_bill.txt htdocs/docs/man/cust_pay.txt etc.

>  I'll submit the code when I'm done if you want.  It may need 
> a bit of cleaning up though :P

Thanks!  No need to wait until you're "done"; using CVS we can all play!
:)

-- 
Ivan Kohler <ivan at sisd.com> - finger for PGP key - <moc.dsis at navi> Relhok Navi
Open-source billing and administration for ISPs - http://www.sisd.com/freeside
20 4,16 * * * saytime # please don't be surprised if you find me dreaming too



More information about the freeside-users mailing list