stray closing /TABLE in the no-ticket case
[freeside.git] / httemplate / search / unapplied_cust_pay.html
index 161c650..f5c2bf0 100755 (executable)
@@ -1,9 +1,8 @@
-<% include( 'elements/cust_main_dayranges.html',
+<& elements/cust_main_dayranges.html,
                  #'title'       => 'Prepaid Balance Aging Summary', #???
                  'title'       => 'Unapplied Payments Aging Summary',
                  'range_sub'   => \&unapplied_payments,
-          )
-%>
+&>
 <%init>
 
 die "access denied"
@@ -13,19 +12,11 @@ die "access denied"
 <%once>
 
 sub unapplied_payments {
-  my($start, $end, $offset) = @_;
-
-  #handle start and end ranges (86400 = 24h * 60m * 60s)
-  my $str2time = str2time_sql;
-  my $closing = str2time_sql_closing;
-  $start = "( $str2time now() $closing - ".($start + $offset) * 86400 . ' )';
-  $end = $end ? 
-           "( $str2time now() $closing - ".($end   + $offset) * 86400 . ' )'
-           : '';
+  my($start, $end, $cutoff) = @_;
 
   FS::cust_main->unapplied_payments_date_sql( $start, $end, 
-          'cutoff' => "( $str2time now() $closing - ".$offset * 86400 . ')'  );
-
+          'cutoff' => $cutoff,
+  );
 }
 
 </%once>