[freeside] print_text usage

Christopher Brill cb at majornet.com
Wed Sep 26 20:54:30 PDT 2001


this is a test script i whipped up trying to test this stuff out:

use FS::cust_bill;

$cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
@lines = $cust_bill->print_text;
print @lines;

it complains about method table being called with an undefined variable (i
think $table).. am i missing something?.. sorry to bother you guys with such
a simple question.

-Chris

-----Original Message-----
From: ivan [mailto:ivan at 420.am]
Sent: Wednesday, September 26, 2001 7:15 PM
To: ivan-freeside at sisd.com
Subject: Re: [freeside] print_text usage


On Wed, Sep 26, 2001 at 07:05:21PM -0700, Christopher Brill wrote:
> What is the correct format for calling the print_text sub in cust_bill..
> what args do I have to have present or pass to it?

That's a method call on an FS::cust_bill object, not a subroutine.  See
the FS::cust_bill manpage:

         @lines = $cust_bill->print_text;
         @lines = $cust_bill->print_text $time;


       print_text [TIME];
           Returns an text invoice, as a list of lines.

           TIME an optional value used to control the printing of
           overdue messages.  The default is now.  It isn't the
           date of the invoice; that's the `_date' field.  It is
           specified as a UNIX timestamp; see the time entry in
           the perlfunc manpage.  Also see the Time::Local man­
           page and the Date::Parse manpage for conversion func­
           tions.

> I am using this to print an invoice to stdout which is then dumped to
> an outbound email script that delivers a post payment invoice via email
>
> -Chris
>
> ---
>
> .--------------------------------------------------.
> | Christopher Brill     Majornet Internet Services |
> | System Administrator  4417 Peralta Blvd          |
> | cb at majornet.com       Fremont, CA 94536          |
> |                       Phone: 510-796-0603        |
> |                       Fax: 510-894-0038          |
> '--------------------------------------------------'
>

--
_ivan




More information about the freeside-users mailing list