[freeside] Bug

Ivan Kohler ivan at sisd.com
Wed Aug 11 13:37:26 PDT 1999

On Wed, Aug 11, 1999 at 12:52:43AM -0600, Ben Leibig wrote:
> I think I found a bug, although maybe not... You never know.
> 1: My problems coming from cust_pay_batch were due to the fact that people
> were hitting the bill now button when then added a new customer.  The bill
> script doesn't look at invoices, only unbilled customers...

The bill script just calls the bill and collect methods of the appropriate
FS::cust_main objects.

It does currently only call collect if there are new invoices.

Since I'm working on this anyway, I added the `-a' option to attempt
collection in all cases.  Does this do what you need?

Note the script has changed from bin/bill to FS/bin/freeside-bill, and is
now installed along with the Perl modules... meaning you can do `man
freeside-bill' and get usage instructions. 

Incidentally, I would not really this as a bug.  The code worked as
documented, non? 

This script was originally written to be run daily from cron.  In this
context, you don't want to be collecting (i.e. printing invoices and
batching cards) for all open invoices. 

> Due to this, the customers bill wouldn't show up in cust_pay_batch.
> Maybe I misunderstood the code.
> 2: I was poking around my database, and there's a lot of invoices in
> cust_bill that have the owed amount = the charged amount.

That's how they're set when they're created.

>  The customers had
> paid by check, and the payment showed up when I looked at the customer in
> freeside.  It seems like when you enter a payment into freeside it doesn't
> subtract it from the amount owed in the corresponding invoice in cust_bill.

On the contrary, yes, it most certainly does; see the insert subroutine in

If there's an error generated, Freeside will warn and the error will wind
up in the Apache error.log as "Error modifying cust_bill: _some_error_".

Perhaps you're entering the payment against the wrong invoice?

> Also, looking at the schema reference it appears that a customer can only be
> billed by email OR postal mail (due to the definition of dest in
> cust_main_invoice).  This is fine, but wouldn't it make more sense to
> change the option on the web page to a radio button.

No, a customer can be billed both by email and postal mail.

Each customer (cust_main record) can have zero-to-many invoice
destinations (cust_main_invoice records).  See the SQL tutorial FAQ 
<http://w3.one.net/~jhoffman/sqltut.htm#Common SQL Questions>, question
13: "What are _relationships_?"

> Lastly, how's the automated signup coming along?

See for yourself.  :)  It lives in the fs_signup directory.

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