[freeside-commits] freeside/httemplate/search cust_bill.html, 1.14, 1.15

Ivan,,, ivan at wavetail.420.am
Thu Jul 14 04:18:08 PDT 2005


Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail:/tmp/cvs-serv8692/httemplate/search

Modified Files:
	cust_bill.html 
Log Message:
move account search (httemplate/search/svc_acct.cgi) to new template, cust-fields configuration value to control which customer fields are shown on reports

Index: cust_bill.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_bill.html,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- cust_bill.html	15 Jun 2005 00:44:28 -0000	1.14
+++ cust_bill.html	14 Jul 2005 11:18:06 -0000	1.15
@@ -95,7 +95,7 @@
                         'cust_bill.*',
                         #( map "cust_main.$_", qw(custnum last first company) ),
                         'cust_main.custnum as cust_main_custnum',
-                        ( map "cust_main.$_", qw(last first company) ),
+                        FS::UI::Web::cust_sql_fields(),
                         "$owed as owed",
                       ),
        'extra_sql' => "$extra_sql $orderby"
@@ -106,8 +106,7 @@
    my $link  = [ "${p}view/cust_bill.cgi?", 'invnum', ];
    my $clink = sub {
      my $cust_bill = shift;
-     my $cust_main = $cust_bill->cust_main;
-     $cust_main
+     $cust_bill->cust_main_custnum
        ? [ "${p}view/cust_main.cgi?", 'custnum' ]
        : '';
    };
@@ -154,32 +153,18 @@
                  'count_query' => $count_query,
                  'count_addl'  => $count_addl,
                  'redirect'    => $link,
-                 'header'      =>
-                   [ 'Invoice #', qw(Balance Amount Date), 'Contact name',
-                     'Company' ],
+                 'header'      => [ 'Invoice #',
+                                    'Balance',
+                                    'Amount',
+                                    'Date',
+                                    FS::UI::Web::cust_header(),
+                                  ],
                  'fields'      => [
                    'invnum',
                    sub { sprintf($money_char.'%.2f', shift->get('owed') ) },
                    sub { sprintf($money_char.'%.2f', shift->charged     ) },
                    sub { time2str('%b %d %Y', shift->_date ) },
-                   sub { my $cust_bill = shift;
-                         # my $cust_main = $cust_bill->cust_main;
-                         # $cust_main
-                         #   ? $cust_main->get('last'). ', '. $cust_main->first
-                         #   : "WARNING: can't find cust_main.custnum ".
-                         #     $cust_bill->custnum. ' (cust_bill.invnum '.
-                         #     $cust_bill->invnum. ')';
-                         if ( $cust_bill->cust_main_custnum ) {
-                           FS::cust_main::name($cust_bill);
-                         } else {
-                           "WARNING: can't find cust_main.custnum ".
-                              $cust_bill->custnum. ' (cust_bill.invnum '.
-                              $cust_bill->invnum. ')';
-                         }
-                       },
-                   sub { my $cust_main = shift->cust_main;
-                         $cust_main ? $cust_main->company : '';
-                       },
+                   \&FS::UI::Web::cust_fields,
                  ],
                  'align' => 'rrrrll',
                  'links' => [
@@ -187,8 +172,7 @@
                    $link,
                    $link,
                    $link,
-                   $clink,
-                   $clink,
+                   ( map { $clink } FS::UI::Web::cust_header() ),
                  ],
   
       )



More information about the freeside-commits mailing list