From: ivan Date: Sat, 9 Jun 2007 00:43:15 +0000 (+0000) Subject: skycatcher modifications for pre-printing invoices, but with today's date X-Git-Tag: freeside_1_7_3rc1~427 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=9d689f9d05189f41b464b3a3316024f02cae8bb1;p=freeside.git skycatcher modifications for pre-printing invoices, but with today's date --- diff --git a/FS/FS/Cron/bill.pm b/FS/FS/Cron/bill.pm index fb9e5499d..967e6a8d8 100644 --- a/FS/FS/Cron/bill.pm +++ b/FS/FS/Cron/bill.pm @@ -24,6 +24,8 @@ sub bill { my($time)= $opt{'d'} ? str2time($opt{'d'}) : $^T; $time += $opt{'y'} * 86400 if $opt{'y'}; + my $invoice_time = $opt{'n'} ? $^T : $time; + # select * from cust_main where my $where_pkg = <<"END"; 0 < ( select count(*) from cust_pkg @@ -101,8 +103,9 @@ END if $error; } - my $error = $cust_main->bill( 'time' => $time, - 'resetup' => $opt{'s'}, + my $error = $cust_main->bill( 'time' => $time, + 'invoice_time' => $invoice_time, + 'resetup' => $opt{'s'}, ); warn "Error billing, custnum ". $cust_main->custnum. ": $error" if $error; diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index e5688d5b2..b219c6ce8 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -1814,22 +1814,23 @@ sub agent { Generates invoices (see L) for this customer. Usually used in conjunction with the collect method. -Options are passed as name-value pairs. +If there is an error, returns the error, otherwise returns false. -Currently available options are: +Options are passed as name-value pairs. Currently available options are: -resetup - if set true, re-charges setup fees. +=over 4 -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 resetup - if set true, re-charges setup fees. + +=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