[freeside-commits] freeside/httemplate/search cust_bill.html, 1.32, 1.33

Ivan,,, ivan at wavetail.420.am
Sat Oct 24 17:29:29 PDT 2009


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

Modified Files:
	cust_bill.html 
Log Message:
import legacy invoice numbers to cust_bill.agent_invid, RT#5351

Index: cust_bill.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_bill.html,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- cust_bill.html	12 Sep 2008 02:02:01 -0000	1.32
+++ cust_bill.html	25 Oct 2009 00:29:27 -0000	1.33
@@ -15,7 +15,7 @@
                                     FS::UI::Web::cust_header(),
                                   ],
                  'fields'      => [
-                   'invnum',
+                   'display_invnum',
                    sub { sprintf($money_char.'%.2f', shift->get('owed') ) },
                    sub { sprintf($money_char.'%.2f', shift->get('net') ) },
                    sub { sprintf($money_char.'%.2f', shift->charged     ) },
@@ -69,15 +69,17 @@
 
 if ( $cgi->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/ ) {
 
-  $count_query =
-    "SELECT COUNT(*) FROM cust_bill $join_cust_main".
-    "  WHERE invnum = $2 AND $agentnums_sql"; #agent virtualization
+  my $invnum_or_invid = "( invnum = $2 OR agent_invid = $2 )";
+  my $where = "WHERE $invnum_or_invid AND $agentnums_sql";
+  
+  $count_query = "SELECT COUNT(*) FROM cust_bill $join_cust_main $where";
+
   $sql_query = {
+    #'select'    => '*',
     'table'     => 'cust_bill',
     'addl_from' => $join_cust_main,
-    'hashref'   => { 'invnum' => $2 },
-    #'select'    => '*',
-    'extra_sql' => " AND $agentnums_sql", #agent virtualization
+    'hashref'   => {},
+    'extra_sql' => $where,
   };
 
 } else {



More information about the freeside-commits mailing list