RT# 82949 - changes section name from fees to pricing, better opiton
[freeside.git] / httemplate / search / report_receivables.cgi
index 6df0161..adbbc85 100755 (executable)
@@ -1,8 +1,9 @@
-<% 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,
+                 'email_checkboxes' => 1,
+&>
 <%init>
 
 die "access denied"
@@ -15,7 +16,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")
@@ -28,18 +29,12 @@ die "access denied"
 # )
 
 sub balance {
-  my($start, $end) = @_; #, %opt ?
-
-  #handle start and end ranges (86400 = 24h * 60m * 60s)
-  my $str2time = str2time_sql;
-  my $closing = str2time_sql_closing;
-  $start = $start ? "( $str2time now() $closing - ".($start * 86400). ' )' : '';
-  $end   = $end   ? "( $str2time now() $closing - ".($end   * 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,
+  );
 }
 
 </%once>