[freeside-commits] freeside/httemplate/search cust_bill.html, 1.39.2.2, 1.39.2.3 report_cust_bill.html, 1.14.2.1, 1.14.2.2

Mark Wells mark at wavetail.420.am
Thu Dec 8 13:14:00 PST 2011


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

Modified Files:
      Tag: FREESIDE_2_3_BRANCH
	cust_bill.html report_cust_bill.html 
Log Message:
promised payment date for invoices, #13554

Index: report_cust_bill.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/report_cust_bill.html,v
retrieving revision 1.14.2.1
retrieving revision 1.14.2.2
diff -u -w -d -r1.14.2.1 -r1.14.2.2
--- report_cust_bill.html	27 Jul 2011 23:27:15 -0000	1.14.2.1
+++ report_cust_bill.html	8 Dec 2011 21:13:58 -0000	1.14.2.2
@@ -37,6 +37,22 @@
   &>
 % }
 
+% if ( $conf->exists('cust_bill-enable_promised_date') ) {
+  <TR>
+    
+    <TD ALIGN="right" STYLE="vertical-align:text-top">
+      <% emt('Promised payment date:') %></TD>
+    <TD>
+      <INPUT TYPE="checkbox" NAME="promised_date"   CHECKED VALUE="null">
+        <% emt('None') %> <BR>
+      <INPUT TYPE="checkbox" NAME="promised_date"   CHECKED VALUE="past">
+        <% emt('In the past') %><BR>
+      <INPUT TYPE="checkbox" NAME="promised_date"   CHECKED VALUE="future">
+        <% emt('In the future') %><BR>
+    </TD>
+  </TR>
+% }
+
   <TR>
     <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="open" VALUE="1" CHECKED></TD>
     <TD><% mt('Show only open invoices') |h %></TD>
@@ -49,6 +65,7 @@
   </TR>
 % }
 
+
 </TABLE>
 
 <BR>
@@ -62,6 +79,8 @@
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('List invoices');
 
+my $conf = new FS::Conf;
+
 my $title = 'Invoice Report';
 #false laziness w/report_cust_pkg.html
 my @title_arg = ();

Index: cust_bill.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_bill.html,v
retrieving revision 1.39.2.2
retrieving revision 1.39.2.3
diff -u -w -d -r1.39.2.2 -r1.39.2.3
--- cust_bill.html	27 Jul 2011 23:56:55 -0000	1.39.2.2
+++ cust_bill.html	8 Dec 2011 21:13:58 -0000	1.39.2.3
@@ -129,6 +129,25 @@
     $count_query = "SELECT COUNT(DISTINCT cust_bill.custnum), 'N/A', 'N/A'";
   }
   
+  # promised date
+  my $start_of_day = timelocal(0, 0, 0, (localtime(time))[3,4,5]);
+  foreach ( $cgi->param('promised_date') ) {
+    # only if at least one box is checked
+    $search{promised_date} ||= [ $start_of_day, $start_of_day, 0 ];
+    if ($_ eq 'past') {
+      # accept everything before today
+      $search{promised_date}[0] = 0;
+    }
+    elsif ( $_ eq 'future' ) {
+      # accept everything after today
+      $search{promised_date}[1] = 4294967295;
+    }
+    elsif ( $_ eq 'null' ) {
+      # accept nulls
+      $search{promised_date}[2] = 1;
+    }
+  }
+
   my $payby_sql = '';
   $payby_sql = ' AND (' . 
     join(' OR ', map { "cust_main.payby = '$_'" } $cgi->param('payby') ) . 



More information about the freeside-commits mailing list