X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Freport_receivables.cgi;h=9c5c0e2d9fb209280b081dac467a52211b2faa0b;hp=73ebee49d29a8e360a2baed0f50cea1acce7659d;hb=c3da5cf1caa244937d280e0f406927103beef148;hpb=624b2d44625f69d71175c3348cae635d580c890b diff --git a/httemplate/search/report_receivables.cgi b/httemplate/search/report_receivables.cgi index 73ebee49d..9c5c0e2d9 100755 --- a/httemplate/search/report_receivables.cgi +++ b/httemplate/search/report_receivables.cgi @@ -1,9 +1,8 @@ -<% include( 'elements/cust_main_dayranges.html', - 'title' => 'Accounts Receivable Aging Summary', +<& elements/cust_main_dayranges.html, + 'title' => emt('Accounts Receivable Aging Summary'), 'range_sub' => \&balance, 'payment_links' => 1, - ) -%> +&> <%init> die "access denied" @@ -16,7 +15,7 @@ die "access denied" #Example: # # my $balance = balance( -# $start, $end, +# $start, $end, $offset, # 'no_as' => 1, #set to true when using in a WHERE clause (supress AS clause) # #or 0 / omit when using in a SELECT clause as a column # # ("AS balance_$start_$end") @@ -29,23 +28,12 @@ die "access denied" # ) sub balance { - my($start, $end, $offset) = @_; #, %opt ? - #handle start and end ranges (86400 = 24h * 60m * 60s) - my $str2time = str2time_sql; - my $closing = str2time_sql_closing; - - # $end == 0 means "+infinity", while $start == 0 really means 0 - # so we should always include a start condition - $start = "( $str2time now() $closing - ". ($start + $offset) * 86400 . ' )'; - # but only include an end condition if $end != 0 - $end = $end ? - "( $str2time now() $closing - ". ($end + $offset) * 86400 . ' )' - : ''; - - #$opt{'unapplied_date'} = 1; - - FS::cust_main->balance_date_sql( $start, $end, 'unapplied_date'=>1,); + my($start, $end, $cutoff) = @_; #, %opt ? + FS::cust_main->balance_date_sql( $start, $end, + 'cutoff' => $cutoff, + 'unapplied_date'=>1, + ); }