[freeside] Billing and shell machines

Ivan Kohler ivan at sisd.com
Thu Jul 29 00:33:14 PDT 1999


On Wed, Jul 21, 1999 at 10:14:48AM -0700, Joel Griffiths wrote:
> On Fri, 16 Jul 1999, you wrote:
> > The documentation, specifically billing.html, says that a list of cards to
> > batch will be in the cust_pay_batch table in the database.
> I have the same problem except I get this warning when I run bill -c ecove:
> 
> Billing customer #14
> Error reval-ing part_pkg->setup pkgpart 15:  at /usr/lib/perl5/site_perl/FS/cust_main.pm line 413.
> setup is undefinded at /usr/lib/perl5/site_perl/FS/cust_main.pm line 451.
> 
> The setup fee is $0 which may explain line 451 error, but I'm not certain as to
> why Safe::reval doesn't work. I don't even know what it does actually.
> 
> When the bill program exits, the cust_pay_batch is still empty.
> 
> FS 1.2.1
> Perl 5.004_05
> 
> My users all have a email invoice set, some also specify credit cards and some
> don't.
> 
> One more thing. When I run bill -c ecove, the charges get set to $95.00. Don't
> know where the $95 comes from. The account charges are $17.95 with no setup and
> frequency set to 1 (right or wrong).
> 
> 
> OKAY: I JUST PLAYED WITH IT A BIT AND FOUND THE SOLUTION TO THE ABOVE PROBLEMS:
> Redo your package definitions charges so that instead of $19.95 (or whatever),
> it reads "19.95" (without the quotes). It appears that freeside has a problem
> with the $ sign.

Yes - you shouldn't put the dollar sign in there.  All prices are Perl
expressions <http://www.sisd.com/freeside/list-archive/msg00554.html>, so
while `19.95' evaluates to the number 19.95, `$19.95' evaluates as 
`$19 . 95', the value of the $19 scalar concatenated with the number 95.

That's where the 95 comes from.  Neat, eh?

> WARNING: IF YOU ALREADY HAVE TOO MUCH INFORMATION TO EASILY REENTER, DON'T USE
> THIS METHOD. WAIT FOR IVAN TO RESPOND. I AM SURE HE HAS A BETTER WAY OF
> CORRECTING THIS.

No need to shout, hehehe!  :)  Removing the errant `$' from prices is
exactly the right thing to do here. 
 
> Here is what I did (This may cause some financial confusion if you have people
> who have already paid something or you want to start with invoice one. - Ivan
> will have to answer that; I just want the correct numbers coming up).

Delete /usr/local/etc/freeside/counters.<datasource>/cust_bill.invnum if
you want to start with invoice 1 when doing this.

> To protect myself, I made a copy of the database with 
> 'cp -ar /var/lib/mysql/ecove /var/lib/mysql/ecove.bak'.
> 
> I went into mysql and deleted all the records (not the tables themeselves!!!)
> with financial info in them:
> cust_bill
> cust_bill_pkg
> cust_credit
> cust_pay
> 
> then I set the bill field to NULL in cust_pkg for the records I wanted to
> recalculate.
> 
> To fix the problem, I changed the recur and setup fields in part_pkg to the
> correct price without the $ sign. Do a select * from part_pkg; to see what I
> mean.
> 
> Then I reran bill -c ecove and the cust_pay_batch came up properly.
> 
> I did this for a single user to start with so that I could see what would
> happen. You may want to do this one user at a time too. Just delete a specific
> invoice from the above records and reset the bill date to NULL for the user's
> package and rerun bill to see the results.
> 
> WARNING: IF YOU ALREADY HAVE TOO MUCH INFORMATION TO EASILY REENTER, DON'T USE
> THIS METHOD. WAIT FOR IVAN TO RESPOND. I AM SURE HE HAS A BETTER WAY OF
> CORRECTING THIS.

Wow, two emphatic warnings.  :)

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