[freeside-commits] freeside/httemplate/search report_unapplied_cust_pay.html, 1.1, 1.2 unapplied_cust_pay.html, 1.1, 1.2

Ivan,,, ivan at wavetail.420.am
Thu Jul 9 14:05:56 PDT 2009


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

Modified Files:
	report_unapplied_cust_pay.html unapplied_cust_pay.html 
Log Message:
unapplied payments report, RT#4861

Index: unapplied_cust_pay.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/unapplied_cust_pay.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- unapplied_cust_pay.html	8 Jul 2009 03:33:44 -0000	1.1
+++ unapplied_cust_pay.html	9 Jul 2009 21:05:54 -0000	1.2
@@ -2,7 +2,8 @@
                  #'title'       => 'Prepaid Balance Aging Summary', #???
                  'title'       => 'Unapplied Payments Aging Summary',
                  'range_sub'   => \&unapplied_payments,
-          );
+          )
+%>
 <%init>
 
 die "access denied"
@@ -11,35 +12,16 @@
 </%init>
 <%once>
 
-#Example:
-#
-# my $balance = balance(
-#   $start, $end, 
-#   '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")
-#   'sum'    => 1, #set to true to get a SUM() of the values, for totals
-#
-#   #obsolete? options for totals (passed to cust_main::balance_date_sql)
-#   'total'  => 1, #set to true to remove all customer comparison clauses
-#   'join'   => $join,   #JOIN clause
-#   'where'  => \@where, #WHERE clause hashref (elements "AND"ed together)
-# )
-
-#sub balance {
 sub unapplied_payments {
   my($start, $end, %opt) = @_;
 
-#XXX fill-in
-#  #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, %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). ' )' : '';
+
+  FS::cust_main->unapplied_payments_date_sql( $start, $end );
 
 }
 

Index: report_unapplied_cust_pay.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/report_unapplied_cust_pay.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- report_unapplied_cust_pay.html	8 Jul 2009 03:33:44 -0000	1.1
+++ report_unapplied_cust_pay.html	9 Jul 2009 21:05:54 -0000	1.2
@@ -21,8 +21,8 @@
   <TR>
     <TD ALIGN="right">Customers</TD>
     <TD>
-      <INPUT TYPE="radio" NAME="all_customers" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.days.disabled=true; document.OneTrueForm.days.style.backgroundColor = '#dddddd'; } else { document.OneTrueForm.days.disabled=false; document.OneTrueForm.days.style.backgroundColor = '#ffffff'; }">All customers (even those without an outstanding balance)<BR>
-      <INPUT TYPE="radio" NAME="all_customers" VALUE="0" CHECKED onClick="if ( ! this.checked ) { document.OneTrueForm.days.disabled=true; document.OneTrueForm.days.style.backgroundColor = '#dddddd'; } else { document.OneTrueForm.days.disabled=false; document.OneTrueForm.days.style.backgroundColor = '#ffffff'; }">Customers with a balance over <INPUT NAME="days" TYPE="text" SIZE=4 MAXLENGTH=3 VALUE="0"> days old
+      <INPUT TYPE="radio" NAME="all_customers" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.days.disabled=true; document.OneTrueForm.days.style.backgroundColor = '#dddddd'; } else { document.OneTrueForm.days.disabled=false; document.OneTrueForm.days.style.backgroundColor = '#ffffff'; }">All customers (even those without unapplied payments)<BR>
+      <INPUT TYPE="radio" NAME="all_customers" VALUE="0" CHECKED onClick="if ( ! this.checked ) { document.OneTrueForm.days.disabled=true; document.OneTrueForm.days.style.backgroundColor = '#dddddd'; } else { document.OneTrueForm.days.disabled=false; document.OneTrueForm.days.style.backgroundColor = '#ffffff'; }">Customers with unapplied payments <INPUT NAME="days" TYPE="text" SIZE=4 MAXLENGTH=3 VALUE="0"> days old
     </TD>
   </TR>
 



More information about the freeside-commits mailing list