[freeside-commits] freeside/httemplate/search report_receivables.cgi, 1.49.2.3, 1.49.2.4 unapplied_cust_pay.html, 1.2.2.2, 1.2.2.3

Mark Wells mark at wavetail.420.am
Thu Jul 22 00:25:50 PDT 2010


Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv15658/httemplate/search

Modified Files:
      Tag: FREESIDE_1_9_BRANCH
	report_receivables.cgi unapplied_cust_pay.html 
Log Message:
Fix weird behavior of aging report, RT#9234

Index: unapplied_cust_pay.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/unapplied_cust_pay.html,v
retrieving revision 1.2.2.2
retrieving revision 1.2.2.3
diff -u -w -d -r1.2.2.2 -r1.2.2.3
--- unapplied_cust_pay.html	11 Jun 2010 21:18:11 -0000	1.2.2.2
+++ unapplied_cust_pay.html	22 Jul 2010 07:25:47 -0000	1.2.2.3
@@ -13,19 +13,11 @@
 <%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>

Index: report_receivables.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/report_receivables.cgi,v
retrieving revision 1.49.2.3
retrieving revision 1.49.2.4
diff -u -w -d -r1.49.2.3 -r1.49.2.4
--- report_receivables.cgi	20 May 2010 01:34:20 -0000	1.49.2.3
+++ report_receivables.cgi	22 Jul 2010 07:25:47 -0000	1.49.2.4
@@ -29,24 +29,12 @@
 # )
 
 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>



More information about the freeside-commits mailing list