X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Freport_receivables.cgi;h=ac94e1a5c14b3e101e4db0c49e506d226c664aa4;hb=3a6c2ddaaf43951b8cc8fb989b45691bb91fbdaa;hp=fdd3779a983e2d0f521da586d0a31af4767a82cb;hpb=c0567c688084e89fcd11bf82348b6c418f1254ac;p=freeside.git diff --git a/httemplate/search/report_receivables.cgi b/httemplate/search/report_receivables.cgi index fdd3779a9..ac94e1a5c 100755 --- a/httemplate/search/report_receivables.cgi +++ b/httemplate/search/report_receivables.cgi @@ -1,19 +1,225 @@ - <% -my $user = getotaker; + sub owed { + my($start, $end, %opt) = @_; -print header('Current Receivables Report Results'); + my @where = (); -open (REPORT, "freeside-receivables-report -v $user |"); + #handle start and end ranges -print '
'; -while('; + #24h * 60m * 60s + push @where, "cust_bill._date <= extract(epoch from now())-". + ($start * 86400) + if $start; + + push @where, "cust_bill._date > extract(epoch from now()) - ". + ($end * 86400) + if $end; -print ') { - print $_; -} -print '