[freeside-commits] freeside/httemplate/search report_svc_acct.html, 1.5, 1.5.4.1 cust_bill.html, 1.32.4.1, 1.32.4.2 cust_bill_event.cgi, 1.17, 1.17.4.1 cust_event.html, 1.6.2.1, 1.6.2.2 477.html, 1.2.2.1, 1.2.2.2 cust_pkg.cgi, 1.59.2.1, 1.59.2.2 cust_main.html, 1.15.2.2, 1.15.2.3

Ivan,,, ivan at wavetail.420.am
Thu Dec 3 20:40:45 PST 2009


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

Modified Files:
      Tag: FREESIDE_1_9_BRANCH
	report_svc_acct.html cust_bill.html cust_bill_event.cgi 
	cust_event.html 477.html cust_pkg.cgi cust_main.html 
Log Message:
customer-specific account report (and some small refactoring of method names to clash less), RT#6180

Index: cust_main.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_main.html,v
retrieving revision 1.15.2.2
retrieving revision 1.15.2.3
diff -u -d -r1.15.2.2 -r1.15.2.3
--- cust_main.html	14 Nov 2009 00:08:21 -0000	1.15.2.2
+++ cust_main.html	4 Dec 2009 04:40:43 -0000	1.15.2.3
@@ -85,7 +85,7 @@
 # etc
 ###
 
-my $sql_query = FS::cust_main->search_sql(\%search_hash);
+my $sql_query = FS::cust_main->search(\%search_hash);
 my $count_query   = delete($sql_query->{'count_query'});
 my @extra_headers = @{ delete($sql_query->{'extra_headers'}) };
 my @extra_fields  = @{ delete($sql_query->{'extra_fields'})  };

Index: cust_event.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_event.html,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -d -r1.6.2.1 -r1.6.2.2
--- cust_event.html	30 Oct 2009 23:30:13 -0000	1.6.2.1
+++ cust_event.html	4 Dec 2009 04:40:43 -0000	1.6.2.2
@@ -173,7 +173,7 @@
 $search{'beginning'} = $beginning;
 $search{'ending'}    = $ending;
 
-my $where = ' WHERE '. FS::cust_event->search_sql( \%search );
+my $where = ' WHERE '. FS::cust_event->search_sql_where( \%search );
 
 my $join = FS::cust_event->join_sql();
 

Index: cust_bill_event.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_bill_event.cgi,v
retrieving revision 1.17
retrieving revision 1.17.4.1
diff -u -d -r1.17 -r1.17.4.1
--- cust_bill_event.cgi	13 Jan 2008 20:57:36 -0000	1.17
+++ cust_bill_event.cgi	4 Dec 2009 04:40:43 -0000	1.17.4.1
@@ -96,7 +96,7 @@
   $search{invnum} = $1;
 }
 
-my $where = 'WHERE '. FS::cust_bill_event->search_sql( \%search );
+my $where = 'WHERE '. FS::cust_bill_event->search_sql_where( \%search );
 
 my $join = 'LEFT JOIN part_bill_event USING ( eventpart ) '.
            'LEFT JOIN cust_bill       USING ( invnum    ) '.

Index: 477.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/477.html,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -d -r1.2.2.1 -r1.2.2.2
--- 477.html	1 Nov 2009 23:03:09 -0000	1.2.2.1
+++ 477.html	4 Dec 2009 04:40:43 -0000	1.2.2.2
@@ -106,7 +106,7 @@
       if $column_option_name{$column};
     my $report_option = join(',', @report_option) if @report_option;
 
-    my $sql_query = FS::cust_pkg->search_sql(
+    my $sql_query = FS::cust_pkg->search(
       { %search_hash,
         ($report_option ? ( 'report_option' => $report_option ) : () ),
       }

Index: cust_bill.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_bill.html,v
retrieving revision 1.32.4.1
retrieving revision 1.32.4.2
diff -u -d -r1.32.4.1 -r1.32.4.2
--- cust_bill.html	16 Nov 2009 03:55:27 -0000	1.32.4.1
+++ cust_bill.html	4 Dec 2009 04:40:43 -0000	1.32.4.2
@@ -121,7 +121,7 @@
     $count_query = "SELECT COUNT(DISTINCT cust_bill.custnum), 'N/A', 'N/A'";
   }
 
-  my $extra_sql = ' WHERE '. FS::cust_bill->search_sql( \%search );
+  my $extra_sql = ' WHERE '. FS::cust_bill->search_sql_where( \%search );
 
   unless ( $count_query ) {
     $count_query = 'SELECT COUNT(*), '. join(', ',

Index: cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_pkg.cgi,v
retrieving revision 1.59.2.1
retrieving revision 1.59.2.2
diff -u -d -r1.59.2.1 -r1.59.2.2
--- cust_pkg.cgi	28 Oct 2009 06:15:09 -0000	1.59.2.1
+++ cust_pkg.cgi	4 Dec 2009 04:40:43 -0000	1.59.2.2
@@ -204,7 +204,7 @@
 
 }
 
-my $sql_query = FS::cust_pkg->search_sql(\%search_hash);
+my $sql_query = FS::cust_pkg->search(\%search_hash);
 my $count_query = delete($sql_query->{'count_query'});
 
 my $show = $curuser->default_customer_view =~ /^(jumbo|packages)$/

Index: report_svc_acct.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/report_svc_acct.html,v
retrieving revision 1.5
retrieving revision 1.5.4.1
diff -u -d -r1.5 -r1.5.4.1
--- report_svc_acct.html	24 Jan 2009 21:04:17 -0000	1.5
+++ report_svc_acct.html	4 Dec 2009 04:40:43 -0000	1.5.4.1
@@ -1,7 +1,8 @@
-<% include('/elements/header.html', 'Account Report' ) %>
+<% include('/elements/header.html', $title ) %>
 
 <FORM ACTION="svc_acct.cgi" METHOD="GET">
 <INPUT TYPE="hidden" NAME="magic" VALUE="advanced">
+<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
 
   <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
 
@@ -9,19 +10,21 @@
       <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Search options</FONT></TH>
     </TR>
 
+% unless ( $custnum ) {
     <% include( '/elements/tr-select-agent.html',
                    'curr_value'    => scalar( $cgi->param('agentnum') ),
                    'disable_empty' => 0,
               )
     %>
 
+%   # just this customer's domains?
     <% include( '/elements/tr-select-domain.html',
                    'element_name'  => 'domsvc',
                    'curr_value'    => scalar( $cgi->param('domsvc') ),
                    'disable_empty' => 0,
               )
     %>
-
+% }
 
     <SCRIPT type="text/javascript">
       function toggle(what) {
@@ -92,7 +95,21 @@
 <%init>
 
 die "access denied"
-  unless $FS::CurrentUser::CurrentUser->access_right('List packages');
+  unless $FS::CurrentUser::CurrentUser->access_right('List packages'); #?
+
+my $title = 'Account Report';
+
+#false laziness w/report_cust_pkg.html
+my $custnum = '';
+if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
+  $custnum = $1;
+  my $cust_main = qsearchs({
+    'table'     => 'cust_main', 
+    'hashref'   => { 'custnum' => $custnum },
+    'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
+  }) or die "unknown custnum $custnum";
+  $title .= ': '. $cust_main->name;
+}
 
 </%init>
 <%once>



More information about the freeside-commits mailing list