diff options
author | mark <mark> | 2010-07-22 07:25:36 +0000 |
---|---|---|
committer | mark <mark> | 2010-07-22 07:25:36 +0000 |
commit | f4658067b9a1dd0564be8fd590a1e541681bfe27 (patch) | |
tree | 2ce49bb2b66631161f9a14691bd3ffbbff525279 /httemplate/search/report_receivables.cgi | |
parent | 342e2bfbe6aad470ab9dee40640f8ac7d9653003 (diff) |
Fix weird behavior of aging report, RT#9234
Diffstat (limited to 'httemplate/search/report_receivables.cgi')
-rwxr-xr-x | httemplate/search/report_receivables.cgi | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/httemplate/search/report_receivables.cgi b/httemplate/search/report_receivables.cgi index 3696ed40d..57228a501 100755 --- a/httemplate/search/report_receivables.cgi +++ b/httemplate/search/report_receivables.cgi @@ -29,24 +29,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, - 'cutoff' => "( $str2time now() $closing - ".$offset * 86400 . ')' ); + my($start, $end, $cutoff) = @_; #, %opt ? + FS::cust_main->balance_date_sql( $start, $end, + 'cutoff' => $cutoff, + 'unapplied_date'=>1, + ); } </%once> |