X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=9d317b643781a5b6f603caf27e5368653e065447;hb=e8a09e945986a32f9b7d0a5d546142ada91654ca;hp=9627f9ffdbd1399b47d01c0c5b2a9bba89350301;hpb=e3dd31c479fb51c2a543ef3c0d7aff59bc44d6f4;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 9627f9ffd..9d317b643 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -19,7 +19,7 @@ use String::Approx qw(amatch); use Business::CreditCard 0.28; use Locale::Country; use Data::Dumper; -use FS::UID qw( getotaker dbh ); +use FS::UID qw( getotaker dbh driver_name ); use FS::Record qw( qsearchs qsearch dbdef ); use FS::Misc qw( send_email generate_ps do_print ); use FS::Msgcat qw(gettext); @@ -28,6 +28,7 @@ use FS::cust_svc; use FS::cust_bill; use FS::cust_bill_pkg; use FS::cust_pay; +use FS::cust_pay_pending; use FS::cust_pay_void; use FS::cust_pay_batch; use FS::cust_credit; @@ -1595,8 +1596,8 @@ sub ncancelled_pkgs { } else { - warn "$me ncancelled_pkgs: searching for packages for custnum ". - $self->custnum + warn "$me ncancelled_pkgs: searching for packages with custnum ". + $self->custnum. "\n" if $DEBUG > 1; @cust_pkg = @@ -1681,7 +1682,8 @@ sub num_ncancelled_pkgs { } sub num_pkgs { - my( $self, $sql ) = @_; + my( $self ) = shift; + my $sql = scalar(@_) ? shift : ''; $sql = "AND $sql" if $sql && $sql !~ /^\s*$/ && $sql !~ /^\s*AND/i; my $sth = dbh->prepare( "SELECT COUNT(*) FROM cust_pkg WHERE custnum = ? $sql" @@ -1888,17 +1890,29 @@ Options are passed as name-value pairs. Currently available options are: =over 4 -=item time - bills the customer as if it were that time. Specified as a UNIX timestamp; see L). Also see L and L for conversion functions. For example: +=item time + +Bills the customer as if it were that time. Specified as a UNIX timestamp; see L). Also see L and L for conversion functions. For example: use Date::Parse; ... $cust_main->bill( 'time' => str2time('April 20th, 2001') ); -=item invoice_time - used in conjunction with the I