[freeside] Billing and shell machines

Joel Griffiths griff at aver-computer.com
Wed Jul 21 15:20:46 PDT 1999


Okay. I finally have something in cust_pay_batch. I had to modify the the
cust_pay_batch.pm file to do it though.

!!! MAKE BACKUPS OF YOUR ORIGINAL cust_pay_batch.pm BEFORE DOING ANYTHING I
RECOMMEND HERE !!!

At first, the expiration date as generated by freeside 1.2.1 wasn't in the
correct configuration for the cust_pay_batch.pm file. I modified line ~152 as
follows:   
if ( $self->exp eq '' ) {
    return "Expiration date required";
    $self->exp('');
  } else {
    my $exp_date = $self->exp;
    $self->exp =~ /^(\d{4})[\/\-](\d{1,2})[\/\-](\d{1,2})$/
      or return "Illegal expiration date";
    if ( length($1) == 4 ) {
      $self->exp("$1-$2-01");
    }
  }

Then I had a problem with the Zip code, so I modified line ~175:
-  $self->zip =~ /^([\w\-]{10})$/ or return "Illegal zip";
+  $self->zip =~ /^([\w\-]{5,10})$/ or return "Illegal zip";

The 5,10 might oughta be {5|10} or something. I don't know. The problem was
that the format generated by freeside for Zip codes and Expiration dates did
not match the format expected by the cust_pay_batch.pm file. Once I changed the
cust_pay_batch.pm to accept the appropriate format the bill program worked.

NOTE:::THIS IS A VERY HACKED WAY OF CORRECTING A BUG. I AM SURE AN APPROPRIATE
FIX WILL COME ALONG VERY SOON. IF YOU DON'T KNOW WHY YOUR ARE MAKING THE
CHANGES, YOU PROBABLY SHOULD WAIT FOR A CORRECT PATCH.

On Wed, 21 Jul 1999, you 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.
> 
> 
> 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.
> 
> 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). 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.
> 
> -- Joel Griffiths --
> Senior Internet Engineer                  Aver, Inc.
> (760) 568-4351 Phone              (760) 341-8694 Fax
> "The world won't change just because I complain."
>                Martina McBride
--
Senior Internet Engineer                  Aver, Inc.
(760) 568-4351 Phone              (760) 341-8694 Fax
"The world won't change just because I complain."
               Martina McBride



More information about the freeside-users mailing list