From: ivan Date: Sat, 9 Jun 2007 00:43:14 +0000 (+0000) Subject: skycatcher modifications for pre-printing invoices, but with today's date X-Git-Tag: TRIXBOX_2_6~497 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=893a697cfa7c60c9663057a02a251e7397813acc 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 4d77fd08d..9926fea9e 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 @@ -102,8 +104,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 252a5ca95..3dbd9c4d5 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -1815,22 +1815,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